Sha256: 30f4b92d0784c4844ed387f94ed1f3cf0ee02627e81f4b01f29fa6eebd684180

Contents?: true

Size: 1.48 KB

Versions: 6

Compression:

Stored size: 1.48 KB

Contents

/*
 * Copyright 2019-present MongoDB, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"){}
 *
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "kms_message/kms_message.h"
#include "kms_message_private.h"
#include "kms_message/kms_b64.h"
#include "kms_request_str.h"


kms_request_t *
kms_caller_identity_request_new (const kms_request_opt_t *opt)
{
   kms_request_t *request;
   kms_request_str_t *payload = NULL;

   request = kms_request_new ("POST", "/", opt);
   if (kms_request_get_error (request)) {
      goto done;
   }

   if (!(kms_request_add_header_field (
          request, "Content-Type", "application/x-www-form-urlencoded"))) {
      goto done;
   }

   payload = kms_request_str_new ();
   kms_request_str_appendf (payload,
                            "Action=GetCallerIdentity&Version=2011-06-15");
   if (!kms_request_append_payload (request, payload->str, payload->len)) {
      KMS_ERROR (request, "Could not append payload");
      goto done;
   }

done:
   kms_request_str_destroy (payload);

   return request;
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
libmongocrypt-helper-1.12.0.0.1001 ext/libmongocrypt/libmongocrypt/kms-message/src/kms_caller_identity_request.c
libmongocrypt-helper-1.11.0.0.1001 ext/libmongocrypt/libmongocrypt/kms-message/src/kms_caller_identity_request.c
libmongocrypt-helper-1.8.0.0.1001 ext/libmongocrypt/libmongocrypt/kms-message/src/kms_caller_identity_request.c
libmongocrypt-helper-1.7.4.0.1002 ext/libmongocrypt/libmongocrypt/kms-message/src/kms_caller_identity_request.c
libmongocrypt-helper-1.7.4.0.1001 ext/libmongocrypt/libmongocrypt/kms-message/src/kms_caller_identity_request.c
libmongocrypt-helper-1.7.4.0.1000 ext/libmongocrypt/libmongocrypt/kms-message/src/kms_caller_identity_request.c