885 lines
29 KiB
JavaScript
885 lines
29 KiB
JavaScript
import { parseXmlBody as parseBody, parseXmlErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
import { collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, strictParseInt32 as __strictParseInt32, withBaseException, } from "@smithy/smithy-client";
|
|
import { ExpiredTokenException, IDPCommunicationErrorException, IDPRejectedClaimException, InvalidAuthorizationMessageException, InvalidIdentityTokenException, MalformedPolicyDocumentException, PackedPolicyTooLargeException, RegionDisabledException, } from "../models/models_0";
|
|
import { STSServiceException as __BaseException } from "../models/STSServiceException";
|
|
export const se_AssumeRoleCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_AssumeRoleRequest(input, context),
|
|
[_A]: _AR,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
export const se_AssumeRoleWithSAMLCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_AssumeRoleWithSAMLRequest(input, context),
|
|
[_A]: _ARWSAML,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
export const se_AssumeRoleWithWebIdentityCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_AssumeRoleWithWebIdentityRequest(input, context),
|
|
[_A]: _ARWWI,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
export const se_DecodeAuthorizationMessageCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_DecodeAuthorizationMessageRequest(input, context),
|
|
[_A]: _DAM,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
export const se_GetAccessKeyInfoCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_GetAccessKeyInfoRequest(input, context),
|
|
[_A]: _GAKI,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
export const se_GetCallerIdentityCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_GetCallerIdentityRequest(input, context),
|
|
[_A]: _GCI,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
export const se_GetFederationTokenCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_GetFederationTokenRequest(input, context),
|
|
[_A]: _GFT,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
export const se_GetSessionTokenCommand = async (input, context) => {
|
|
const headers = SHARED_HEADERS;
|
|
let body;
|
|
body = buildFormUrlencodedString({
|
|
...se_GetSessionTokenRequest(input, context),
|
|
[_A]: _GST,
|
|
[_V]: _,
|
|
});
|
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
};
|
|
export const de_AssumeRoleCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await parseBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_AssumeRoleResponse(data.AssumeRoleResult, context);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
export const de_AssumeRoleWithSAMLCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await parseBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_AssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
export const de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await parseBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
export const de_DecodeAuthorizationMessageCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await parseBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_DecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
export const de_GetAccessKeyInfoCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await parseBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_GetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
export const de_GetCallerIdentityCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await parseBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_GetCallerIdentityResponse(data.GetCallerIdentityResult, context);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
export const de_GetFederationTokenCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await parseBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_GetFederationTokenResponse(data.GetFederationTokenResult, context);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
export const de_GetSessionTokenCommand = async (output, context) => {
|
|
if (output.statusCode >= 300) {
|
|
return de_CommandError(output, context);
|
|
}
|
|
const data = await parseBody(output.body, context);
|
|
let contents = {};
|
|
contents = de_GetSessionTokenResponse(data.GetSessionTokenResult, context);
|
|
const response = {
|
|
$metadata: deserializeMetadata(output),
|
|
...contents,
|
|
};
|
|
return response;
|
|
};
|
|
const de_CommandError = async (output, context) => {
|
|
const parsedOutput = {
|
|
...output,
|
|
body: await parseErrorBody(output.body, context),
|
|
};
|
|
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
switch (errorCode) {
|
|
case "ExpiredTokenException":
|
|
case "com.amazonaws.sts#ExpiredTokenException":
|
|
throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
|
|
case "MalformedPolicyDocument":
|
|
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
|
throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
|
|
case "PackedPolicyTooLarge":
|
|
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
|
throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
|
|
case "RegionDisabledException":
|
|
case "com.amazonaws.sts#RegionDisabledException":
|
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
case "IDPRejectedClaim":
|
|
case "com.amazonaws.sts#IDPRejectedClaimException":
|
|
throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
|
|
case "InvalidIdentityToken":
|
|
case "com.amazonaws.sts#InvalidIdentityTokenException":
|
|
throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
|
|
case "IDPCommunicationError":
|
|
case "com.amazonaws.sts#IDPCommunicationErrorException":
|
|
throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
|
|
case "InvalidAuthorizationMessageException":
|
|
case "com.amazonaws.sts#InvalidAuthorizationMessageException":
|
|
throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context);
|
|
default:
|
|
const parsedBody = parsedOutput.body;
|
|
return throwDefaultError({
|
|
output,
|
|
parsedBody: parsedBody.Error,
|
|
errorCode,
|
|
});
|
|
}
|
|
};
|
|
const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_ExpiredTokenException(body.Error, context);
|
|
const exception = new ExpiredTokenException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return __decorateServiceException(exception, body);
|
|
};
|
|
const de_IDPCommunicationErrorExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_IDPCommunicationErrorException(body.Error, context);
|
|
const exception = new IDPCommunicationErrorException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return __decorateServiceException(exception, body);
|
|
};
|
|
const de_IDPRejectedClaimExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_IDPRejectedClaimException(body.Error, context);
|
|
const exception = new IDPRejectedClaimException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return __decorateServiceException(exception, body);
|
|
};
|
|
const de_InvalidAuthorizationMessageExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_InvalidAuthorizationMessageException(body.Error, context);
|
|
const exception = new InvalidAuthorizationMessageException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return __decorateServiceException(exception, body);
|
|
};
|
|
const de_InvalidIdentityTokenExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_InvalidIdentityTokenException(body.Error, context);
|
|
const exception = new InvalidIdentityTokenException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return __decorateServiceException(exception, body);
|
|
};
|
|
const de_MalformedPolicyDocumentExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_MalformedPolicyDocumentException(body.Error, context);
|
|
const exception = new MalformedPolicyDocumentException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return __decorateServiceException(exception, body);
|
|
};
|
|
const de_PackedPolicyTooLargeExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_PackedPolicyTooLargeException(body.Error, context);
|
|
const exception = new PackedPolicyTooLargeException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return __decorateServiceException(exception, body);
|
|
};
|
|
const de_RegionDisabledExceptionRes = async (parsedOutput, context) => {
|
|
const body = parsedOutput.body;
|
|
const deserialized = de_RegionDisabledException(body.Error, context);
|
|
const exception = new RegionDisabledException({
|
|
$metadata: deserializeMetadata(parsedOutput),
|
|
...deserialized,
|
|
});
|
|
return __decorateServiceException(exception, body);
|
|
};
|
|
const se_AssumeRoleRequest = (input, context) => {
|
|
const entries = {};
|
|
if (input[_RA] != null) {
|
|
entries[_RA] = input[_RA];
|
|
}
|
|
if (input[_RSN] != null) {
|
|
entries[_RSN] = input[_RSN];
|
|
}
|
|
if (input[_PA] != null) {
|
|
const memberEntries = se_policyDescriptorListType(input[_PA], context);
|
|
if (input[_PA]?.length === 0) {
|
|
entries.PolicyArns = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `PolicyArns.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_P] != null) {
|
|
entries[_P] = input[_P];
|
|
}
|
|
if (input[_DS] != null) {
|
|
entries[_DS] = input[_DS];
|
|
}
|
|
if (input[_T] != null) {
|
|
const memberEntries = se_tagListType(input[_T], context);
|
|
if (input[_T]?.length === 0) {
|
|
entries.Tags = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `Tags.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_TTK] != null) {
|
|
const memberEntries = se_tagKeyListType(input[_TTK], context);
|
|
if (input[_TTK]?.length === 0) {
|
|
entries.TransitiveTagKeys = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `TransitiveTagKeys.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_EI] != null) {
|
|
entries[_EI] = input[_EI];
|
|
}
|
|
if (input[_SN] != null) {
|
|
entries[_SN] = input[_SN];
|
|
}
|
|
if (input[_TC] != null) {
|
|
entries[_TC] = input[_TC];
|
|
}
|
|
if (input[_SI] != null) {
|
|
entries[_SI] = input[_SI];
|
|
}
|
|
if (input[_PC] != null) {
|
|
const memberEntries = se_ProvidedContextsListType(input[_PC], context);
|
|
if (input[_PC]?.length === 0) {
|
|
entries.ProvidedContexts = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `ProvidedContexts.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
return entries;
|
|
};
|
|
const se_AssumeRoleWithSAMLRequest = (input, context) => {
|
|
const entries = {};
|
|
if (input[_RA] != null) {
|
|
entries[_RA] = input[_RA];
|
|
}
|
|
if (input[_PAr] != null) {
|
|
entries[_PAr] = input[_PAr];
|
|
}
|
|
if (input[_SAMLA] != null) {
|
|
entries[_SAMLA] = input[_SAMLA];
|
|
}
|
|
if (input[_PA] != null) {
|
|
const memberEntries = se_policyDescriptorListType(input[_PA], context);
|
|
if (input[_PA]?.length === 0) {
|
|
entries.PolicyArns = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `PolicyArns.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_P] != null) {
|
|
entries[_P] = input[_P];
|
|
}
|
|
if (input[_DS] != null) {
|
|
entries[_DS] = input[_DS];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_AssumeRoleWithWebIdentityRequest = (input, context) => {
|
|
const entries = {};
|
|
if (input[_RA] != null) {
|
|
entries[_RA] = input[_RA];
|
|
}
|
|
if (input[_RSN] != null) {
|
|
entries[_RSN] = input[_RSN];
|
|
}
|
|
if (input[_WIT] != null) {
|
|
entries[_WIT] = input[_WIT];
|
|
}
|
|
if (input[_PI] != null) {
|
|
entries[_PI] = input[_PI];
|
|
}
|
|
if (input[_PA] != null) {
|
|
const memberEntries = se_policyDescriptorListType(input[_PA], context);
|
|
if (input[_PA]?.length === 0) {
|
|
entries.PolicyArns = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `PolicyArns.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_P] != null) {
|
|
entries[_P] = input[_P];
|
|
}
|
|
if (input[_DS] != null) {
|
|
entries[_DS] = input[_DS];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_DecodeAuthorizationMessageRequest = (input, context) => {
|
|
const entries = {};
|
|
if (input[_EM] != null) {
|
|
entries[_EM] = input[_EM];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_GetAccessKeyInfoRequest = (input, context) => {
|
|
const entries = {};
|
|
if (input[_AKI] != null) {
|
|
entries[_AKI] = input[_AKI];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_GetCallerIdentityRequest = (input, context) => {
|
|
const entries = {};
|
|
return entries;
|
|
};
|
|
const se_GetFederationTokenRequest = (input, context) => {
|
|
const entries = {};
|
|
if (input[_N] != null) {
|
|
entries[_N] = input[_N];
|
|
}
|
|
if (input[_P] != null) {
|
|
entries[_P] = input[_P];
|
|
}
|
|
if (input[_PA] != null) {
|
|
const memberEntries = se_policyDescriptorListType(input[_PA], context);
|
|
if (input[_PA]?.length === 0) {
|
|
entries.PolicyArns = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `PolicyArns.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
if (input[_DS] != null) {
|
|
entries[_DS] = input[_DS];
|
|
}
|
|
if (input[_T] != null) {
|
|
const memberEntries = se_tagListType(input[_T], context);
|
|
if (input[_T]?.length === 0) {
|
|
entries.Tags = [];
|
|
}
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
const loc = `Tags.${key}`;
|
|
entries[loc] = value;
|
|
});
|
|
}
|
|
return entries;
|
|
};
|
|
const se_GetSessionTokenRequest = (input, context) => {
|
|
const entries = {};
|
|
if (input[_DS] != null) {
|
|
entries[_DS] = input[_DS];
|
|
}
|
|
if (input[_SN] != null) {
|
|
entries[_SN] = input[_SN];
|
|
}
|
|
if (input[_TC] != null) {
|
|
entries[_TC] = input[_TC];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_policyDescriptorListType = (input, context) => {
|
|
const entries = {};
|
|
let counter = 1;
|
|
for (const entry of input) {
|
|
if (entry === null) {
|
|
continue;
|
|
}
|
|
const memberEntries = se_PolicyDescriptorType(entry, context);
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
entries[`member.${counter}.${key}`] = value;
|
|
});
|
|
counter++;
|
|
}
|
|
return entries;
|
|
};
|
|
const se_PolicyDescriptorType = (input, context) => {
|
|
const entries = {};
|
|
if (input[_a] != null) {
|
|
entries[_a] = input[_a];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_ProvidedContext = (input, context) => {
|
|
const entries = {};
|
|
if (input[_PAro] != null) {
|
|
entries[_PAro] = input[_PAro];
|
|
}
|
|
if (input[_CA] != null) {
|
|
entries[_CA] = input[_CA];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_ProvidedContextsListType = (input, context) => {
|
|
const entries = {};
|
|
let counter = 1;
|
|
for (const entry of input) {
|
|
if (entry === null) {
|
|
continue;
|
|
}
|
|
const memberEntries = se_ProvidedContext(entry, context);
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
entries[`member.${counter}.${key}`] = value;
|
|
});
|
|
counter++;
|
|
}
|
|
return entries;
|
|
};
|
|
const se_Tag = (input, context) => {
|
|
const entries = {};
|
|
if (input[_K] != null) {
|
|
entries[_K] = input[_K];
|
|
}
|
|
if (input[_Va] != null) {
|
|
entries[_Va] = input[_Va];
|
|
}
|
|
return entries;
|
|
};
|
|
const se_tagKeyListType = (input, context) => {
|
|
const entries = {};
|
|
let counter = 1;
|
|
for (const entry of input) {
|
|
if (entry === null) {
|
|
continue;
|
|
}
|
|
entries[`member.${counter}`] = entry;
|
|
counter++;
|
|
}
|
|
return entries;
|
|
};
|
|
const se_tagListType = (input, context) => {
|
|
const entries = {};
|
|
let counter = 1;
|
|
for (const entry of input) {
|
|
if (entry === null) {
|
|
continue;
|
|
}
|
|
const memberEntries = se_Tag(entry, context);
|
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
entries[`member.${counter}.${key}`] = value;
|
|
});
|
|
counter++;
|
|
}
|
|
return entries;
|
|
};
|
|
const de_AssumedRoleUser = (output, context) => {
|
|
const contents = {};
|
|
if (output[_ARI] != null) {
|
|
contents[_ARI] = __expectString(output[_ARI]);
|
|
}
|
|
if (output[_Ar] != null) {
|
|
contents[_Ar] = __expectString(output[_Ar]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_AssumeRoleResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_C] != null) {
|
|
contents[_C] = de_Credentials(output[_C], context);
|
|
}
|
|
if (output[_ARU] != null) {
|
|
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
|
|
}
|
|
if (output[_PPS] != null) {
|
|
contents[_PPS] = __strictParseInt32(output[_PPS]);
|
|
}
|
|
if (output[_SI] != null) {
|
|
contents[_SI] = __expectString(output[_SI]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_AssumeRoleWithSAMLResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_C] != null) {
|
|
contents[_C] = de_Credentials(output[_C], context);
|
|
}
|
|
if (output[_ARU] != null) {
|
|
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
|
|
}
|
|
if (output[_PPS] != null) {
|
|
contents[_PPS] = __strictParseInt32(output[_PPS]);
|
|
}
|
|
if (output[_S] != null) {
|
|
contents[_S] = __expectString(output[_S]);
|
|
}
|
|
if (output[_ST] != null) {
|
|
contents[_ST] = __expectString(output[_ST]);
|
|
}
|
|
if (output[_I] != null) {
|
|
contents[_I] = __expectString(output[_I]);
|
|
}
|
|
if (output[_Au] != null) {
|
|
contents[_Au] = __expectString(output[_Au]);
|
|
}
|
|
if (output[_NQ] != null) {
|
|
contents[_NQ] = __expectString(output[_NQ]);
|
|
}
|
|
if (output[_SI] != null) {
|
|
contents[_SI] = __expectString(output[_SI]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_AssumeRoleWithWebIdentityResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_C] != null) {
|
|
contents[_C] = de_Credentials(output[_C], context);
|
|
}
|
|
if (output[_SFWIT] != null) {
|
|
contents[_SFWIT] = __expectString(output[_SFWIT]);
|
|
}
|
|
if (output[_ARU] != null) {
|
|
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
|
|
}
|
|
if (output[_PPS] != null) {
|
|
contents[_PPS] = __strictParseInt32(output[_PPS]);
|
|
}
|
|
if (output[_Pr] != null) {
|
|
contents[_Pr] = __expectString(output[_Pr]);
|
|
}
|
|
if (output[_Au] != null) {
|
|
contents[_Au] = __expectString(output[_Au]);
|
|
}
|
|
if (output[_SI] != null) {
|
|
contents[_SI] = __expectString(output[_SI]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_Credentials = (output, context) => {
|
|
const contents = {};
|
|
if (output[_AKI] != null) {
|
|
contents[_AKI] = __expectString(output[_AKI]);
|
|
}
|
|
if (output[_SAK] != null) {
|
|
contents[_SAK] = __expectString(output[_SAK]);
|
|
}
|
|
if (output[_STe] != null) {
|
|
contents[_STe] = __expectString(output[_STe]);
|
|
}
|
|
if (output[_E] != null) {
|
|
contents[_E] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_E]));
|
|
}
|
|
return contents;
|
|
};
|
|
const de_DecodeAuthorizationMessageResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_DM] != null) {
|
|
contents[_DM] = __expectString(output[_DM]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_ExpiredTokenException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = __expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_FederatedUser = (output, context) => {
|
|
const contents = {};
|
|
if (output[_FUI] != null) {
|
|
contents[_FUI] = __expectString(output[_FUI]);
|
|
}
|
|
if (output[_Ar] != null) {
|
|
contents[_Ar] = __expectString(output[_Ar]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_GetAccessKeyInfoResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_Ac] != null) {
|
|
contents[_Ac] = __expectString(output[_Ac]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_GetCallerIdentityResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_UI] != null) {
|
|
contents[_UI] = __expectString(output[_UI]);
|
|
}
|
|
if (output[_Ac] != null) {
|
|
contents[_Ac] = __expectString(output[_Ac]);
|
|
}
|
|
if (output[_Ar] != null) {
|
|
contents[_Ar] = __expectString(output[_Ar]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_GetFederationTokenResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_C] != null) {
|
|
contents[_C] = de_Credentials(output[_C], context);
|
|
}
|
|
if (output[_FU] != null) {
|
|
contents[_FU] = de_FederatedUser(output[_FU], context);
|
|
}
|
|
if (output[_PPS] != null) {
|
|
contents[_PPS] = __strictParseInt32(output[_PPS]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_GetSessionTokenResponse = (output, context) => {
|
|
const contents = {};
|
|
if (output[_C] != null) {
|
|
contents[_C] = de_Credentials(output[_C], context);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_IDPCommunicationErrorException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = __expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_IDPRejectedClaimException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = __expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_InvalidAuthorizationMessageException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = __expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_InvalidIdentityTokenException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = __expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_MalformedPolicyDocumentException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = __expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_PackedPolicyTooLargeException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = __expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const de_RegionDisabledException = (output, context) => {
|
|
const contents = {};
|
|
if (output[_m] != null) {
|
|
contents[_m] = __expectString(output[_m]);
|
|
}
|
|
return contents;
|
|
};
|
|
const deserializeMetadata = (output) => ({
|
|
httpStatusCode: output.statusCode,
|
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
cfId: output.headers["x-amz-cf-id"],
|
|
});
|
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
const throwDefaultError = withBaseException(__BaseException);
|
|
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
const contents = {
|
|
protocol,
|
|
hostname,
|
|
port,
|
|
method: "POST",
|
|
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
headers,
|
|
};
|
|
if (resolvedHostname !== undefined) {
|
|
contents.hostname = resolvedHostname;
|
|
}
|
|
if (body !== undefined) {
|
|
contents.body = body;
|
|
}
|
|
return new __HttpRequest(contents);
|
|
};
|
|
const SHARED_HEADERS = {
|
|
"content-type": "application/x-www-form-urlencoded",
|
|
};
|
|
const _ = "2011-06-15";
|
|
const _A = "Action";
|
|
const _AKI = "AccessKeyId";
|
|
const _AR = "AssumeRole";
|
|
const _ARI = "AssumedRoleId";
|
|
const _ARU = "AssumedRoleUser";
|
|
const _ARWSAML = "AssumeRoleWithSAML";
|
|
const _ARWWI = "AssumeRoleWithWebIdentity";
|
|
const _Ac = "Account";
|
|
const _Ar = "Arn";
|
|
const _Au = "Audience";
|
|
const _C = "Credentials";
|
|
const _CA = "ContextAssertion";
|
|
const _DAM = "DecodeAuthorizationMessage";
|
|
const _DM = "DecodedMessage";
|
|
const _DS = "DurationSeconds";
|
|
const _E = "Expiration";
|
|
const _EI = "ExternalId";
|
|
const _EM = "EncodedMessage";
|
|
const _FU = "FederatedUser";
|
|
const _FUI = "FederatedUserId";
|
|
const _GAKI = "GetAccessKeyInfo";
|
|
const _GCI = "GetCallerIdentity";
|
|
const _GFT = "GetFederationToken";
|
|
const _GST = "GetSessionToken";
|
|
const _I = "Issuer";
|
|
const _K = "Key";
|
|
const _N = "Name";
|
|
const _NQ = "NameQualifier";
|
|
const _P = "Policy";
|
|
const _PA = "PolicyArns";
|
|
const _PAr = "PrincipalArn";
|
|
const _PAro = "ProviderArn";
|
|
const _PC = "ProvidedContexts";
|
|
const _PI = "ProviderId";
|
|
const _PPS = "PackedPolicySize";
|
|
const _Pr = "Provider";
|
|
const _RA = "RoleArn";
|
|
const _RSN = "RoleSessionName";
|
|
const _S = "Subject";
|
|
const _SAK = "SecretAccessKey";
|
|
const _SAMLA = "SAMLAssertion";
|
|
const _SFWIT = "SubjectFromWebIdentityToken";
|
|
const _SI = "SourceIdentity";
|
|
const _SN = "SerialNumber";
|
|
const _ST = "SubjectType";
|
|
const _STe = "SessionToken";
|
|
const _T = "Tags";
|
|
const _TC = "TokenCode";
|
|
const _TTK = "TransitiveTagKeys";
|
|
const _UI = "UserId";
|
|
const _V = "Version";
|
|
const _Va = "Value";
|
|
const _WIT = "WebIdentityToken";
|
|
const _a = "arn";
|
|
const _m = "message";
|
|
const buildFormUrlencodedString = (formEntries) => Object.entries(formEntries)
|
|
.map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value))
|
|
.join("&");
|
|
const loadQueryErrorCode = (output, data) => {
|
|
if (data.Error?.Code !== undefined) {
|
|
return data.Error.Code;
|
|
}
|
|
if (output.statusCode == 404) {
|
|
return "NotFound";
|
|
}
|
|
};
|