@aws-sdk/client-sts
Version:
AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native
135 lines (134 loc) • 5.96 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.STS = void 0;
const AssumeRoleCommand_1 = require("./commands/AssumeRoleCommand");
const AssumeRoleWithSAMLCommand_1 = require("./commands/AssumeRoleWithSAMLCommand");
const AssumeRoleWithWebIdentityCommand_1 = require("./commands/AssumeRoleWithWebIdentityCommand");
const DecodeAuthorizationMessageCommand_1 = require("./commands/DecodeAuthorizationMessageCommand");
const GetAccessKeyInfoCommand_1 = require("./commands/GetAccessKeyInfoCommand");
const GetCallerIdentityCommand_1 = require("./commands/GetCallerIdentityCommand");
const GetFederationTokenCommand_1 = require("./commands/GetFederationTokenCommand");
const GetSessionTokenCommand_1 = require("./commands/GetSessionTokenCommand");
const STSClient_1 = require("./STSClient");
/**
* <fullname>Security Token Service</fullname>
* <p>Security Token Service (STS) enables you to request temporary, limited-privilege
* credentials for Identity and Access Management (IAM) users or for users that you
* authenticate (federated users). This guide provides descriptions of the STS API. For
* more information about using this service, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html">Temporary Security Credentials</a>.</p>
*/
class STS extends STSClient_1.STSClient {
assumeRole(args, optionsOrCb, cb) {
const command = new AssumeRoleCommand_1.AssumeRoleCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
assumeRoleWithSAML(args, optionsOrCb, cb) {
const command = new AssumeRoleWithSAMLCommand_1.AssumeRoleWithSAMLCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
assumeRoleWithWebIdentity(args, optionsOrCb, cb) {
const command = new AssumeRoleWithWebIdentityCommand_1.AssumeRoleWithWebIdentityCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
decodeAuthorizationMessage(args, optionsOrCb, cb) {
const command = new DecodeAuthorizationMessageCommand_1.DecodeAuthorizationMessageCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
getAccessKeyInfo(args, optionsOrCb, cb) {
const command = new GetAccessKeyInfoCommand_1.GetAccessKeyInfoCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
getCallerIdentity(args, optionsOrCb, cb) {
const command = new GetCallerIdentityCommand_1.GetCallerIdentityCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
getFederationToken(args, optionsOrCb, cb) {
const command = new GetFederationTokenCommand_1.GetFederationTokenCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
getSessionToken(args, optionsOrCb, cb) {
const command = new GetSessionTokenCommand_1.GetSessionTokenCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
}
else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object")
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
}
else {
return this.send(command, optionsOrCb);
}
}
}
exports.STS = STS;