mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-11-27 18:54:22 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58b282f00f | ||
|
|
472e549195 | ||
|
|
187737abc2 | ||
|
|
8d8bc098cc | ||
|
|
fa078d278f |
No files matched your search
@@ -2,6 +2,13 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [1.4.0](https://github.com/aws-actions/configure-aws-credentials/compare/v1.3.5...v1.4.0) (2020-06-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Refresh and validate credentials after setting env var creds ([#71](https://github.com/aws-actions/configure-aws-credentials/issues/71)) ([472e549](https://github.com/aws-actions/configure-aws-credentials/commit/472e549195ba1f153e9fb72e39dc2a094e5de13e))
|
||||
|
||||
### [1.3.5](https://github.com/aws-actions/configure-aws-credentials/compare/v1.3.4...v1.3.5) (2020-05-27)
|
||||
|
||||
|
||||
|
||||
Vendored
+57
-5
@@ -265,6 +265,50 @@ async function exportAccountId(maskAccountId, region) {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
function loadCredentials() {
|
||||
// Force the SDK to re-resolve credentials with the default provider chain.
|
||||
//
|
||||
// This action typically sets credentials in the environment via environment variables.
|
||||
// The SDK never refreshes those env-var-based credentials after initial load.
|
||||
// In case there were already env-var creds set in the actions environment when this action
|
||||
// loaded, this action needs to refresh the SDK creds after overwriting those environment variables.
|
||||
//
|
||||
// The credentials object needs to be entirely recreated (instead of simply refreshed),
|
||||
// because the credential object type could change when this action writes env var creds.
|
||||
// For example, the first load could return EC2 instance metadata credentials
|
||||
// in a self-hosted runner, and the second load could return environment credentials
|
||||
// from an assume-role call in this action.
|
||||
aws.config.credentials = null;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
aws.config.getCredentials((err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
resolve(aws.config.credentials);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async function validateCredentials(expectedAccessKeyId) {
|
||||
let credentials;
|
||||
try {
|
||||
credentials = await loadCredentials();
|
||||
|
||||
if (!credentials.accessKeyId) {
|
||||
throw new Error('Access key ID empty after loading credentials');
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(`Credentials could not be loaded, please check your action inputs: ${error.message}`);
|
||||
}
|
||||
|
||||
const actualAccessKeyId = credentials.accessKeyId;
|
||||
|
||||
if (expectedAccessKeyId && expectedAccessKeyId != actualAccessKeyId) {
|
||||
throw new Error('Unexpected failure: Credentials loaded by the SDK do not match the access key ID configured by the action');
|
||||
}
|
||||
}
|
||||
|
||||
function getStsClient(region) {
|
||||
return new aws.STS({
|
||||
region,
|
||||
@@ -305,6 +349,13 @@ async function run() {
|
||||
exportCredentials({accessKeyId, secretAccessKey, sessionToken});
|
||||
}
|
||||
|
||||
// Regardless of whether any source credentials were provided as inputs,
|
||||
// validate that the SDK can actually pick up credentials. This validates
|
||||
// cases where this action is on a self-hosted runner that doesn't have credentials
|
||||
// configured correctly, and cases where the user intended to provide input
|
||||
// credentials but the secrets inputs resolved to empty strings.
|
||||
await validateCredentials(accessKeyId);
|
||||
|
||||
const sourceAccountId = await exportAccountId(maskAccountId, region);
|
||||
|
||||
// Get role credentials if configured to do so
|
||||
@@ -318,6 +369,7 @@ async function run() {
|
||||
roleSessionName
|
||||
});
|
||||
exportCredentials(roleCredentials);
|
||||
await validateCredentials(roleCredentials.accessKeyId);
|
||||
await exportAccountId(maskAccountId, region);
|
||||
}
|
||||
}
|
||||
@@ -1815,7 +1867,7 @@ AWS.util.update(AWS, {
|
||||
/**
|
||||
* @constant
|
||||
*/
|
||||
VERSION: '2.684.0',
|
||||
VERSION: '2.686.0',
|
||||
|
||||
/**
|
||||
* @api private
|
||||
@@ -7428,7 +7480,7 @@ module.exports = AWS.MediaStoreData;
|
||||
/***/ 2304:
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = {"metadata":{"apiVersion":"2018-11-14","endpointPrefix":"kafka","signingName":"kafka","serviceFullName":"Managed Streaming for Kafka","serviceAbbreviation":"Kafka","serviceId":"Kafka","protocol":"rest-json","jsonVersion":"1.1","uid":"kafka-2018-11-14","signatureVersion":"v4"},"operations":{"CreateCluster":{"http":{"requestUri":"/v1/clusters","responseCode":200},"input":{"type":"structure","members":{"BrokerNodeGroupInfo":{"shape":"S2","locationName":"brokerNodeGroupInfo"},"ClientAuthentication":{"shape":"Sa","locationName":"clientAuthentication"},"ClusterName":{"locationName":"clusterName"},"ConfigurationInfo":{"shape":"Sd","locationName":"configurationInfo"},"EncryptionInfo":{"shape":"Sf","locationName":"encryptionInfo"},"EnhancedMonitoring":{"locationName":"enhancedMonitoring"},"OpenMonitoring":{"shape":"Sl","locationName":"openMonitoring"},"KafkaVersion":{"locationName":"kafkaVersion"},"LoggingInfo":{"shape":"Sq","locationName":"loggingInfo"},"NumberOfBrokerNodes":{"locationName":"numberOfBrokerNodes","type":"integer"},"Tags":{"shape":"Sw","locationName":"tags"}},"required":["BrokerNodeGroupInfo","KafkaVersion","NumberOfBrokerNodes","ClusterName"]},"output":{"type":"structure","members":{"ClusterArn":{"locationName":"clusterArn"},"ClusterName":{"locationName":"clusterName"},"State":{"locationName":"state"}}}},"CreateConfiguration":{"http":{"requestUri":"/v1/configurations","responseCode":200},"input":{"type":"structure","members":{"Description":{"locationName":"description"},"KafkaVersions":{"shape":"S4","locationName":"kafkaVersions"},"Name":{"locationName":"name"},"ServerProperties":{"locationName":"serverProperties","type":"blob"}},"required":["ServerProperties","KafkaVersions","Name"]},"output":{"type":"structure","members":{"Arn":{"locationName":"arn"},"CreationTime":{"shape":"S12","locationName":"creationTime"},"LatestRevision":{"shape":"S13","locationName":"latestRevision"},"Name":{"locationName":"name"}}}},"DeleteCluster":{"http":{"method":"DELETE","requestUri":"/v1/clusters/{clusterArn}","responseCode":200},"input":{"type":"structure","members":{"ClusterArn":{"location":"uri","locationName":"clusterArn"},"CurrentVersion":{"location":"querystring","locationName":"currentVersion"}},"required":["ClusterArn"]},"output":{"type":"structure","members":{"ClusterArn":{"locationName":"clusterArn"},"State":{"locationName":"state"}}}},"DescribeCluster":{"http":{"method":"GET","requestUri":"/v1/clusters/{clusterArn}","responseCode":200},"input":{"type":"structure","members":{"ClusterArn":{"location":"uri","locationName":"clusterArn"}},"required":["ClusterArn"]},"output":{"type":"structure","members":{"ClusterInfo":{"shape":"S18","locationName":"clusterInfo"}}}},"DescribeClusterOperation":{"http":{"method":"GET","requestUri":"/v1/operations/{clusterOperationArn}","responseCode":200},"input":{"type":"structure","members":{"ClusterOperationArn":{"location":"uri","locationName":"clusterOperationArn"}},"required":["ClusterOperationArn"]},"output":{"type":"structure","members":{"ClusterOperationInfo":{"shape":"S1i","locationName":"clusterOperationInfo"}}}},"DescribeConfiguration":{"http":{"method":"GET","requestUri":"/v1/configurations/{arn}","responseCode":200},"input":{"type":"structure","members":{"Arn":{"location":"uri","locationName":"arn"}},"required":["Arn"]},"output":{"type":"structure","members":{"Arn":{"locationName":"arn"},"CreationTime":{"shape":"S12","locationName":"creationTime"},"Description":{"locationName":"description"},"KafkaVersions":{"shape":"S4","locationName":"kafkaVersions"},"LatestRevision":{"shape":"S13","locationName":"latestRevision"},"Name":{"locationName":"name"}}}},"DescribeConfigurationRevision":{"http":{"method":"GET","requestUri":"/v1/configurations/{arn}/revisions/{revision}","responseCode":200},"input":{"type":"structure","members":{"Arn":{"location":"uri","locationName":"arn"},"Revision":{"location":"uri","locationName":"revision","type":"long"}},"required":["Revision","Arn"]},"output":{"type":"structure","members":{"Arn":{"locationName":"arn"},"CreationTime":{"shape":"S12","locationName":"creationTime"},"Description":{"locationName":"description"},"Revision":{"locationName":"revision","type":"long"},"ServerProperties":{"locationName":"serverProperties","type":"blob"}}}},"GetBootstrapBrokers":{"http":{"method":"GET","requestUri":"/v1/clusters/{clusterArn}/bootstrap-brokers","responseCode":200},"input":{"type":"structure","members":{"ClusterArn":{"location":"uri","locationName":"clusterArn"}},"required":["ClusterArn"]},"output":{"type":"structure","members":{"BootstrapBrokerString":{"locationName":"bootstrapBrokerString"},"BootstrapBrokerStringTls":{"locationName":"bootstrapBrokerStringTls"}}}},"ListClusterOperations":{"http":{"method":"GET","requestUri":"/v1/clusters/{clusterArn}/operations","responseCode":200},"input":{"type":"structure","members":{"ClusterArn":{"location":"uri","locationName":"clusterArn"},"MaxResults":{"location":"querystring","locationNameLine truncated
|
||||
module.exports = {"metadata":{"apiVersion":"2018-11-14","endpointPrefix":"kafka","signingName":"kafka","serviceFullName":"Managed Streaming for Kafka","serviceAbbreviation":"Kafka","serviceId":"Kafka","protocol":"rest-json","jsonVersion":"1.1","uid":"kafka-2018-11-14","signatureVersion":"v4"},"operations":{"CreateCluster":{"http":{"requestUri":"/v1/clusters","responseCode":200},"input":{"type":"structure","members":{"BrokerNodeGroupInfo":{"shape":"S2","locationName":"brokerNodeGroupInfo"},"ClientAuthentication":{"shape":"Sa","locationName":"clientAuthentication"},"ClusterName":{"locationName":"clusterName"},"ConfigurationInfo":{"shape":"Sd","locationName":"configurationInfo"},"EncryptionInfo":{"shape":"Sf","locationName":"encryptionInfo"},"EnhancedMonitoring":{"locationName":"enhancedMonitoring"},"OpenMonitoring":{"shape":"Sl","locationName":"openMonitoring"},"KafkaVersion":{"locationName":"kafkaVersion"},"LoggingInfo":{"shape":"Sq","locationName":"loggingInfo"},"NumberOfBrokerNodes":{"locationName":"numberOfBrokerNodes","type":"integer"},"Tags":{"shape":"Sw","locationName":"tags"}},"required":["BrokerNodeGroupInfo","KafkaVersion","NumberOfBrokerNodes","ClusterName"]},"output":{"type":"structure","members":{"ClusterArn":{"locationName":"clusterArn"},"ClusterName":{"locationName":"clusterName"},"State":{"locationName":"state"}}}},"CreateConfiguration":{"http":{"requestUri":"/v1/configurations","responseCode":200},"input":{"type":"structure","members":{"Description":{"locationName":"description"},"KafkaVersions":{"shape":"S4","locationName":"kafkaVersions"},"Name":{"locationName":"name"},"ServerProperties":{"locationName":"serverProperties","type":"blob"}},"required":["ServerProperties","Name"]},"output":{"type":"structure","members":{"Arn":{"locationName":"arn"},"CreationTime":{"shape":"S12","locationName":"creationTime"},"LatestRevision":{"shape":"S13","locationName":"latestRevision"},"Name":{"locationName":"name"}}}},"DeleteCluster":{"http":{"method":"DELETE","requestUri":"/v1/clusters/{clusterArn}","responseCode":200},"input":{"type":"structure","members":{"ClusterArn":{"location":"uri","locationName":"clusterArn"},"CurrentVersion":{"location":"querystring","locationName":"currentVersion"}},"required":["ClusterArn"]},"output":{"type":"structure","members":{"ClusterArn":{"locationName":"clusterArn"},"State":{"locationName":"state"}}}},"DescribeCluster":{"http":{"method":"GET","requestUri":"/v1/clusters/{clusterArn}","responseCode":200},"input":{"type":"structure","members":{"ClusterArn":{"location":"uri","locationName":"clusterArn"}},"required":["ClusterArn"]},"output":{"type":"structure","members":{"ClusterInfo":{"shape":"S18","locationName":"clusterInfo"}}}},"DescribeClusterOperation":{"http":{"method":"GET","requestUri":"/v1/operations/{clusterOperationArn}","responseCode":200},"input":{"type":"structure","members":{"ClusterOperationArn":{"location":"uri","locationName":"clusterOperationArn"}},"required":["ClusterOperationArn"]},"output":{"type":"structure","members":{"ClusterOperationInfo":{"shape":"S1i","locationName":"clusterOperationInfo"}}}},"DescribeConfiguration":{"http":{"method":"GET","requestUri":"/v1/configurations/{arn}","responseCode":200},"input":{"type":"structure","members":{"Arn":{"location":"uri","locationName":"arn"}},"required":["Arn"]},"output":{"type":"structure","members":{"Arn":{"locationName":"arn"},"CreationTime":{"shape":"S12","locationName":"creationTime"},"Description":{"locationName":"description"},"KafkaVersions":{"shape":"S4","locationName":"kafkaVersions"},"LatestRevision":{"shape":"S13","locationName":"latestRevision"},"Name":{"locationName":"name"}}}},"DescribeConfigurationRevision":{"http":{"method":"GET","requestUri":"/v1/configurations/{arn}/revisions/{revision}","responseCode":200},"input":{"type":"structure","members":{"Arn":{"location":"uri","locationName":"arn"},"Revision":{"location":"uri","locationName":"revision","type":"long"}},"required":["Revision","Arn"]},"output":{"type":"structure","members":{"Arn":{"locationName":"arn"},"CreationTime":{"shape":"S12","locationName":"creationTime"},"Description":{"locationName":"description"},"Revision":{"locationName":"revision","type":"long"},"ServerProperties":{"locationName":"serverProperties","type":"blob"}}}},"GetBootstrapBrokers":{"http":{"method":"GET","requestUri":"/v1/clusters/{clusterArn}/bootstrap-brokers","responseCode":200},"input":{"type":"structure","members":{"ClusterArn":{"location":"uri","locationName":"clusterArn"}},"required":["ClusterArn"]},"output":{"type":"structure","members":{"BootstrapBrokerString":{"locationName":"bootstrapBrokerString"},"BootstrapBrokerStringTls":{"locationName":"bootstrapBrokerStringTls"}}}},"GetCompatibleKafkaVersions":{"http":{"method":"GET","requestUri":"/v1/compatible-kafka-versions","responseCode":200},"input":{"type":"structure","members":{"ClusterArn":{"location":"querystring","locationName":"clusterArn"}}},"output":{"type":"structure","members":{"CompatibleKafkaVersLine truncated
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -17422,7 +17474,7 @@ module.exports = AWS.Polly;
|
||||
/***/ 4220:
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = {"version":"2.0","metadata":{"apiVersion":"2017-10-01","endpointPrefix":"workmail","jsonVersion":"1.1","protocol":"json","serviceFullName":"Amazon WorkMail","serviceId":"WorkMail","signatureVersion":"v4","targetPrefix":"WorkMailService","uid":"workmail-2017-10-01"},"operations":{"AssociateDelegateToResource":{"input":{"type":"structure","required":["OrganizationId","ResourceId","EntityId"],"members":{"OrganizationId":{},"ResourceId":{},"EntityId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"AssociateMemberToGroup":{"input":{"type":"structure","required":["OrganizationId","GroupId","MemberId"],"members":{"OrganizationId":{},"GroupId":{},"MemberId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"CreateAlias":{"input":{"type":"structure","required":["OrganizationId","EntityId","Alias"],"members":{"OrganizationId":{},"EntityId":{},"Alias":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"CreateGroup":{"input":{"type":"structure","required":["OrganizationId","Name"],"members":{"OrganizationId":{},"Name":{}}},"output":{"type":"structure","members":{"GroupId":{}}},"idempotent":true},"CreateResource":{"input":{"type":"structure","required":["OrganizationId","Name","Type"],"members":{"OrganizationId":{},"Name":{},"Type":{}}},"output":{"type":"structure","members":{"ResourceId":{}}},"idempotent":true},"CreateUser":{"input":{"type":"structure","required":["OrganizationId","Name","DisplayName","Password"],"members":{"OrganizationId":{},"Name":{},"DisplayName":{},"Password":{"shape":"Sl"}}},"output":{"type":"structure","members":{"UserId":{}}},"idempotent":true},"DeleteAccessControlRule":{"input":{"type":"structure","required":["OrganizationId","Name"],"members":{"OrganizationId":{},"Name":{}}},"output":{"type":"structure","members":{}}},"DeleteAlias":{"input":{"type":"structure","required":["OrganizationId","EntityId","Alias"],"members":{"OrganizationId":{},"EntityId":{},"Alias":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeleteGroup":{"input":{"type":"structure","required":["OrganizationId","GroupId"],"members":{"OrganizationId":{},"GroupId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeleteMailboxPermissions":{"input":{"type":"structure","required":["OrganizationId","EntityId","GranteeId"],"members":{"OrganizationId":{},"EntityId":{},"GranteeId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeleteResource":{"input":{"type":"structure","required":["OrganizationId","ResourceId"],"members":{"OrganizationId":{},"ResourceId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeleteUser":{"input":{"type":"structure","required":["OrganizationId","UserId"],"members":{"OrganizationId":{},"UserId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeregisterFromWorkMail":{"input":{"type":"structure","required":["OrganizationId","EntityId"],"members":{"OrganizationId":{},"EntityId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DescribeGroup":{"input":{"type":"structure","required":["OrganizationId","GroupId"],"members":{"OrganizationId":{},"GroupId":{}}},"output":{"type":"structure","members":{"GroupId":{},"Name":{},"Email":{},"State":{},"EnabledDate":{"type":"timestamp"},"DisabledDate":{"type":"timestamp"}}},"idempotent":true},"DescribeOrganization":{"input":{"type":"structure","required":["OrganizationId"],"members":{"OrganizationId":{}}},"output":{"type":"structure","members":{"OrganizationId":{},"Alias":{},"State":{},"DirectoryId":{},"DirectoryType":{},"DefaultMailDomain":{},"CompletedDate":{"type":"timestamp"},"ErrorMessage":{},"ARN":{}}},"idempotent":true},"DescribeResource":{"input":{"type":"structure","required":["OrganizationId","ResourceId"],"members":{"OrganizationId":{},"ResourceId":{}}},"output":{"type":"structure","members":{"ResourceId":{},"Email":{},"Name":{},"Type":{},"BookingOptions":{"shape":"S1c"},"State":{},"EnabledDate":{"type":"timestamp"},"DisabledDate":{"type":"timestamp"}}},"idempotent":true},"DescribeUser":{"input":{"type":"structure","required":["OrganizationId","UserId"],"members":{"OrganizationId":{},"UserId":{}}},"output":{"type":"structure","members":{"UserId":{},"Name":{},"Email":{},"DisplayName":{},"State":{},"UserRole":{},"EnabledDate":{"type":"timestamp"},"DisabledDate":{"type":"timestamp"}}},"idempotent":true},"DisassociateDelegateFromResource":{"input":{"type":"structure","required":["OrganizationId","ResourceId","EntityId"],"members":{"OrganizationId":{},"ResourceId":{},"EntityId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DisassociateMemberFromGroup":{"input":{"type":"structure","required":["OrganizationId","GroupId","MemberId"],"members":{"OrganizationId":{},"GroupId":{},"MemberId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"GetAccessControlEffect":{"input":{"type":"structure","required":["OrganizationId","IpAddress","Action","UserId"],"mLine truncated
|
||||
module.exports = {"version":"2.0","metadata":{"apiVersion":"2017-10-01","endpointPrefix":"workmail","jsonVersion":"1.1","protocol":"json","serviceFullName":"Amazon WorkMail","serviceId":"WorkMail","signatureVersion":"v4","targetPrefix":"WorkMailService","uid":"workmail-2017-10-01"},"operations":{"AssociateDelegateToResource":{"input":{"type":"structure","required":["OrganizationId","ResourceId","EntityId"],"members":{"OrganizationId":{},"ResourceId":{},"EntityId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"AssociateMemberToGroup":{"input":{"type":"structure","required":["OrganizationId","GroupId","MemberId"],"members":{"OrganizationId":{},"GroupId":{},"MemberId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"CreateAlias":{"input":{"type":"structure","required":["OrganizationId","EntityId","Alias"],"members":{"OrganizationId":{},"EntityId":{},"Alias":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"CreateGroup":{"input":{"type":"structure","required":["OrganizationId","Name"],"members":{"OrganizationId":{},"Name":{}}},"output":{"type":"structure","members":{"GroupId":{}}},"idempotent":true},"CreateResource":{"input":{"type":"structure","required":["OrganizationId","Name","Type"],"members":{"OrganizationId":{},"Name":{},"Type":{}}},"output":{"type":"structure","members":{"ResourceId":{}}},"idempotent":true},"CreateUser":{"input":{"type":"structure","required":["OrganizationId","Name","DisplayName","Password"],"members":{"OrganizationId":{},"Name":{},"DisplayName":{},"Password":{"shape":"Sl"}}},"output":{"type":"structure","members":{"UserId":{}}},"idempotent":true},"DeleteAccessControlRule":{"input":{"type":"structure","required":["OrganizationId","Name"],"members":{"OrganizationId":{},"Name":{}}},"output":{"type":"structure","members":{}}},"DeleteAlias":{"input":{"type":"structure","required":["OrganizationId","EntityId","Alias"],"members":{"OrganizationId":{},"EntityId":{},"Alias":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeleteGroup":{"input":{"type":"structure","required":["OrganizationId","GroupId"],"members":{"OrganizationId":{},"GroupId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeleteMailboxPermissions":{"input":{"type":"structure","required":["OrganizationId","EntityId","GranteeId"],"members":{"OrganizationId":{},"EntityId":{},"GranteeId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeleteResource":{"input":{"type":"structure","required":["OrganizationId","ResourceId"],"members":{"OrganizationId":{},"ResourceId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeleteRetentionPolicy":{"input":{"type":"structure","required":["OrganizationId","Id"],"members":{"OrganizationId":{},"Id":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeleteUser":{"input":{"type":"structure","required":["OrganizationId","UserId"],"members":{"OrganizationId":{},"UserId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DeregisterFromWorkMail":{"input":{"type":"structure","required":["OrganizationId","EntityId"],"members":{"OrganizationId":{},"EntityId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DescribeGroup":{"input":{"type":"structure","required":["OrganizationId","GroupId"],"members":{"OrganizationId":{},"GroupId":{}}},"output":{"type":"structure","members":{"GroupId":{},"Name":{},"Email":{},"State":{},"EnabledDate":{"type":"timestamp"},"DisabledDate":{"type":"timestamp"}}},"idempotent":true},"DescribeOrganization":{"input":{"type":"structure","required":["OrganizationId"],"members":{"OrganizationId":{}}},"output":{"type":"structure","members":{"OrganizationId":{},"Alias":{},"State":{},"DirectoryId":{},"DirectoryType":{},"DefaultMailDomain":{},"CompletedDate":{"type":"timestamp"},"ErrorMessage":{},"ARN":{}}},"idempotent":true},"DescribeResource":{"input":{"type":"structure","required":["OrganizationId","ResourceId"],"members":{"OrganizationId":{},"ResourceId":{}}},"output":{"type":"structure","members":{"ResourceId":{},"Email":{},"Name":{},"Type":{},"BookingOptions":{"shape":"S1f"},"State":{},"EnabledDate":{"type":"timestamp"},"DisabledDate":{"type":"timestamp"}}},"idempotent":true},"DescribeUser":{"input":{"type":"structure","required":["OrganizationId","UserId"],"members":{"OrganizationId":{},"UserId":{}}},"output":{"type":"structure","members":{"UserId":{},"Name":{},"Email":{},"DisplayName":{},"State":{},"UserRole":{},"EnabledDate":{"type":"timestamp"},"DisabledDate":{"type":"timestamp"}}},"idempotent":true},"DisassociateDelegateFromResource":{"input":{"type":"structure","required":["OrganizationId","ResourceId","EntityId"],"members":{"OrganizationId":{},"ResourceId":{},"EntityId":{}}},"output":{"type":"structure","members":{}},"idempotent":true},"DisassociateMemberFromGroup":{"input":{"type":"structure","required":["OrganizationId","GroupId","MemberId"],"members":{"OrganizationId":{},"GroupId":{},"MeLine truncated
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -24896,7 +24948,7 @@ module.exports = AWS.MediaPackage;
|
||||
/***/ 6531:
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = {"version":"2.0","metadata":{"apiVersion":"2018-09-17","endpointPrefix":"catalog.marketplace","jsonVersion":"1.1","protocol":"rest-json","serviceAbbreviation":"AWS Marketplace Catalog","serviceFullName":"AWS Marketplace Catalog Service","serviceId":"Marketplace Catalog","signatureVersion":"v4","signingName":"aws-marketplace","uid":"marketplace-catalog-2018-09-17"},"operations":{"CancelChangeSet":{"http":{"method":"PATCH","requestUri":"/CancelChangeSet"},"input":{"type":"structure","required":["Catalog","ChangeSetId"],"members":{"Catalog":{"location":"querystring","locationName":"catalog"},"ChangeSetId":{"location":"querystring","locationName":"changeSetId"}}},"output":{"type":"structure","members":{"ChangeSetId":{},"ChangeSetArn":{}}}},"DescribeChangeSet":{"http":{"method":"GET","requestUri":"/DescribeChangeSet"},"input":{"type":"structure","required":["Catalog","ChangeSetId"],"members":{"Catalog":{"location":"querystring","locationName":"catalog"},"ChangeSetId":{"location":"querystring","locationName":"changeSetId"}}},"output":{"type":"structure","members":{"ChangeSetId":{},"ChangeSetArn":{},"ChangeSetName":{},"StartTime":{},"EndTime":{},"Status":{},"FailureDescription":{},"ChangeSet":{"type":"list","member":{"type":"structure","members":{"ChangeType":{},"Entity":{"shape":"Sf"},"ErrorDetailList":{"type":"list","member":{"type":"structure","members":{"ErrorCode":{},"ErrorMessage":{}}}}}}}}}},"DescribeEntity":{"http":{"method":"GET","requestUri":"/DescribeEntity"},"input":{"type":"structure","required":["Catalog","EntityId"],"members":{"Catalog":{"location":"querystring","locationName":"catalog"},"EntityId":{"location":"querystring","locationName":"entityId"}}},"output":{"type":"structure","members":{"EntityType":{},"EntityIdentifier":{},"EntityArn":{},"LastModifiedDate":{},"Details":{}}}},"ListChangeSets":{"http":{"requestUri":"/ListChangeSets"},"input":{"type":"structure","required":["Catalog"],"members":{"Catalog":{},"FilterList":{"shape":"So"},"Sort":{"shape":"Ss"},"MaxResults":{"type":"integer"},"NextToken":{}}},"output":{"type":"structure","members":{"ChangeSetSummaryList":{"type":"list","member":{"type":"structure","members":{"ChangeSetId":{},"ChangeSetArn":{},"ChangeSetName":{},"StartTime":{},"EndTime":{},"Status":{},"EntityIdList":{"type":"list","member":{}}}}},"NextToken":{}}}},"ListEntities":{"http":{"requestUri":"/ListEntities"},"input":{"type":"structure","required":["Catalog","EntityType"],"members":{"Catalog":{},"EntityType":{},"FilterList":{"shape":"So"},"Sort":{"shape":"Ss"},"NextToken":{},"MaxResults":{"type":"integer"}}},"output":{"type":"structure","members":{"EntitySummaryList":{"type":"list","member":{"type":"structure","members":{"Name":{},"EntityType":{},"EntityId":{},"EntityArn":{},"LastModifiedDate":{},"Visibility":{}}}},"NextToken":{}}}},"StartChangeSet":{"http":{"requestUri":"/StartChangeSet"},"input":{"type":"structure","required":["Catalog","ChangeSet"],"members":{"Catalog":{},"ChangeSet":{"type":"list","member":{"type":"structure","required":["ChangeType","Entity","Details"],"members":{"ChangeType":{},"Entity":{"shape":"Sf"},"Details":{}}}},"ChangeSetName":{},"ClientRequestToken":{}}},"output":{"type":"structure","members":{"ChangeSetId":{},"ChangeSetArn":{}}}}},"shapes":{"Sf":{"type":"structure","required":["Type"],"members":{"Type":{},"Identifier":{}}},"So":{"type":"list","member":{"type":"structure","members":{"Name":{},"ValueList":{"type":"list","member":{}}}}},"Ss":{"type":"structure","members":{"SortBy":{},"SortOrder":{}}}}};
|
||||
module.exports = {"version":"2.0","metadata":{"apiVersion":"2018-09-17","endpointPrefix":"catalog.marketplace","jsonVersion":"1.1","protocol":"rest-json","serviceAbbreviation":"AWS Marketplace Catalog","serviceFullName":"AWS Marketplace Catalog Service","serviceId":"Marketplace Catalog","signatureVersion":"v4","signingName":"aws-marketplace","uid":"marketplace-catalog-2018-09-17"},"operations":{"CancelChangeSet":{"http":{"method":"PATCH","requestUri":"/CancelChangeSet"},"input":{"type":"structure","required":["Catalog","ChangeSetId"],"members":{"Catalog":{"location":"querystring","locationName":"catalog"},"ChangeSetId":{"location":"querystring","locationName":"changeSetId"}}},"output":{"type":"structure","members":{"ChangeSetId":{},"ChangeSetArn":{}}}},"DescribeChangeSet":{"http":{"method":"GET","requestUri":"/DescribeChangeSet"},"input":{"type":"structure","required":["Catalog","ChangeSetId"],"members":{"Catalog":{"location":"querystring","locationName":"catalog"},"ChangeSetId":{"location":"querystring","locationName":"changeSetId"}}},"output":{"type":"structure","members":{"ChangeSetId":{},"ChangeSetArn":{},"ChangeSetName":{},"StartTime":{},"EndTime":{},"Status":{},"FailureDescription":{},"ChangeSet":{"type":"list","member":{"type":"structure","members":{"ChangeType":{},"Entity":{"shape":"Sf"},"Details":{},"ErrorDetailList":{"type":"list","member":{"type":"structure","members":{"ErrorCode":{},"ErrorMessage":{}}}}}}}}}},"DescribeEntity":{"http":{"method":"GET","requestUri":"/DescribeEntity"},"input":{"type":"structure","required":["Catalog","EntityId"],"members":{"Catalog":{"location":"querystring","locationName":"catalog"},"EntityId":{"location":"querystring","locationName":"entityId"}}},"output":{"type":"structure","members":{"EntityType":{},"EntityIdentifier":{},"EntityArn":{},"LastModifiedDate":{},"Details":{}}}},"ListChangeSets":{"http":{"requestUri":"/ListChangeSets"},"input":{"type":"structure","required":["Catalog"],"members":{"Catalog":{},"FilterList":{"shape":"So"},"Sort":{"shape":"Ss"},"MaxResults":{"type":"integer"},"NextToken":{}}},"output":{"type":"structure","members":{"ChangeSetSummaryList":{"type":"list","member":{"type":"structure","members":{"ChangeSetId":{},"ChangeSetArn":{},"ChangeSetName":{},"StartTime":{},"EndTime":{},"Status":{},"EntityIdList":{"type":"list","member":{}}}}},"NextToken":{}}}},"ListEntities":{"http":{"requestUri":"/ListEntities"},"input":{"type":"structure","required":["Catalog","EntityType"],"members":{"Catalog":{},"EntityType":{},"FilterList":{"shape":"So"},"Sort":{"shape":"Ss"},"NextToken":{},"MaxResults":{"type":"integer"}}},"output":{"type":"structure","members":{"EntitySummaryList":{"type":"list","member":{"type":"structure","members":{"Name":{},"EntityType":{},"EntityId":{},"EntityArn":{},"LastModifiedDate":{},"Visibility":{}}}},"NextToken":{}}}},"StartChangeSet":{"http":{"requestUri":"/StartChangeSet"},"input":{"type":"structure","required":["Catalog","ChangeSet"],"members":{"Catalog":{},"ChangeSet":{"type":"list","member":{"type":"structure","required":["ChangeType","Entity","Details"],"members":{"ChangeType":{},"Entity":{"shape":"Sf"},"Details":{}}}},"ChangeSetName":{},"ClientRequestToken":{}}},"output":{"type":"structure","members":{"ChangeSetId":{},"ChangeSetArn":{}}}}},"shapes":{"Sf":{"type":"structure","required":["Type"],"members":{"Type":{},"Identifier":{}}},"So":{"type":"list","member":{"type":"structure","members":{"Name":{},"ValueList":{"type":"list","member":{}}}}},"Ss":{"type":"structure","members":{"SortBy":{},"SortOrder":{}}}}};
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -34273,7 +34325,7 @@ module.exports = {"pagination":{}};
|
||||
/***/ 9843:
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = {"version":"2.0","metadata":{"apiVersion":"2015-12-01","endpointPrefix":"elasticloadbalancing","protocol":"query","serviceAbbreviation":"Elastic Load Balancing v2","serviceFullName":"Elastic Load Balancing","serviceId":"Elastic Load Balancing v2","signatureVersion":"v4","uid":"elasticloadbalancingv2-2015-12-01","xmlNamespace":"http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/"},"operations":{"AddListenerCertificates":{"input":{"type":"structure","required":["ListenerArn","Certificates"],"members":{"ListenerArn":{},"Certificates":{"shape":"S3"}}},"output":{"resultWrapper":"AddListenerCertificatesResult","type":"structure","members":{"Certificates":{"shape":"S3"}}}},"AddTags":{"input":{"type":"structure","required":["ResourceArns","Tags"],"members":{"ResourceArns":{"shape":"S9"},"Tags":{"shape":"Sb"}}},"output":{"resultWrapper":"AddTagsResult","type":"structure","members":{}}},"CreateListener":{"input":{"type":"structure","required":["LoadBalancerArn","Protocol","Port","DefaultActions"],"members":{"LoadBalancerArn":{},"Protocol":{},"Port":{"type":"integer"},"SslPolicy":{},"Certificates":{"shape":"S3"},"DefaultActions":{"shape":"Sl"}}},"output":{"resultWrapper":"CreateListenerResult","type":"structure","members":{"Listeners":{"shape":"S1z"}}}},"CreateLoadBalancer":{"input":{"type":"structure","required":["Name"],"members":{"Name":{},"Subnets":{"shape":"S23"},"SubnetMappings":{"shape":"S25"},"SecurityGroups":{"shape":"S29"},"Scheme":{},"Tags":{"shape":"Sb"},"Type":{},"IpAddressType":{}}},"output":{"resultWrapper":"CreateLoadBalancerResult","type":"structure","members":{"LoadBalancers":{"shape":"S2f"}}}},"CreateRule":{"input":{"type":"structure","required":["ListenerArn","Conditions","Priority","Actions"],"members":{"ListenerArn":{},"Conditions":{"shape":"S2v"},"Priority":{"type":"integer"},"Actions":{"shape":"Sl"}}},"output":{"resultWrapper":"CreateRuleResult","type":"structure","members":{"Rules":{"shape":"S3b"}}}},"CreateTargetGroup":{"input":{"type":"structure","required":["Name"],"members":{"Name":{},"Protocol":{},"Port":{"type":"integer"},"VpcId":{},"HealthCheckProtocol":{},"HealthCheckPort":{},"HealthCheckEnabled":{"type":"boolean"},"HealthCheckPath":{},"HealthCheckIntervalSeconds":{"type":"integer"},"HealthCheckTimeoutSeconds":{"type":"integer"},"HealthyThresholdCount":{"type":"integer"},"UnhealthyThresholdCount":{"type":"integer"},"Matcher":{"shape":"S3o"},"TargetType":{}}},"output":{"resultWrapper":"CreateTargetGroupResult","type":"structure","members":{"TargetGroups":{"shape":"S3s"}}}},"DeleteListener":{"input":{"type":"structure","required":["ListenerArn"],"members":{"ListenerArn":{}}},"output":{"resultWrapper":"DeleteListenerResult","type":"structure","members":{}}},"DeleteLoadBalancer":{"input":{"type":"structure","required":["LoadBalancerArn"],"members":{"LoadBalancerArn":{}}},"output":{"resultWrapper":"DeleteLoadBalancerResult","type":"structure","members":{}}},"DeleteRule":{"input":{"type":"structure","required":["RuleArn"],"members":{"RuleArn":{}}},"output":{"resultWrapper":"DeleteRuleResult","type":"structure","members":{}}},"DeleteTargetGroup":{"input":{"type":"structure","required":["TargetGroupArn"],"members":{"TargetGroupArn":{}}},"output":{"resultWrapper":"DeleteTargetGroupResult","type":"structure","members":{}}},"DeregisterTargets":{"input":{"type":"structure","required":["TargetGroupArn","Targets"],"members":{"TargetGroupArn":{},"Targets":{"shape":"S44"}}},"output":{"resultWrapper":"DeregisterTargetsResult","type":"structure","members":{}}},"DescribeAccountLimits":{"input":{"type":"structure","members":{"Marker":{},"PageSize":{"type":"integer"}}},"output":{"resultWrapper":"DescribeAccountLimitsResult","type":"structure","members":{"Limits":{"type":"list","member":{"type":"structure","members":{"Name":{},"Max":{}}}},"NextMarker":{}}}},"DescribeListenerCertificates":{"input":{"type":"structure","required":["ListenerArn"],"members":{"ListenerArn":{},"Marker":{},"PageSize":{"type":"integer"}}},"output":{"resultWrapper":"DescribeListenerCertificatesResult","type":"structure","members":{"Certificates":{"shape":"S3"},"NextMarker":{}}}},"DescribeListeners":{"input":{"type":"structure","members":{"LoadBalancerArn":{},"ListenerArns":{"type":"list","member":{}},"Marker":{},"PageSize":{"type":"integer"}}},"output":{"resultWrapper":"DescribeListenersResult","type":"structure","members":{"Listeners":{"shape":"S1z"},"NextMarker":{}}}},"DescribeLoadBalancerAttributes":{"input":{"type":"structure","required":["LoadBalancerArn"],"members":{"LoadBalancerArn":{}}},"output":{"resultWrapper":"DescribeLoadBalancerAttributesResult","type":"structure","members":{"Attributes":{"shape":"S4n"}}}},"DescribeLoadBalancers":{"input":{"type":"structure","members":{"LoadBalancerArns":{"shape":"S3u"},"Names":{"type":"list","member":{}},"Marker":{},"PageSize":{"type":"integer"}}},"output":{"resultWrapper":"DescribeLoadBalancersResult","type":"structure","members":{"LoadBalancers":{"shape":"S2f"}Line truncated
|
||||
module.exports = {"version":"2.0","metadata":{"apiVersion":"2015-12-01","endpointPrefix":"elasticloadbalancing","protocol":"query","serviceAbbreviation":"Elastic Load Balancing v2","serviceFullName":"Elastic Load Balancing","serviceId":"Elastic Load Balancing v2","signatureVersion":"v4","uid":"elasticloadbalancingv2-2015-12-01","xmlNamespace":"http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/"},"operations":{"AddListenerCertificates":{"input":{"type":"structure","required":["ListenerArn","Certificates"],"members":{"ListenerArn":{},"Certificates":{"shape":"S3"}}},"output":{"resultWrapper":"AddListenerCertificatesResult","type":"structure","members":{"Certificates":{"shape":"S3"}}}},"AddTags":{"input":{"type":"structure","required":["ResourceArns","Tags"],"members":{"ResourceArns":{"shape":"S9"},"Tags":{"shape":"Sb"}}},"output":{"resultWrapper":"AddTagsResult","type":"structure","members":{}}},"CreateListener":{"input":{"type":"structure","required":["LoadBalancerArn","Protocol","Port","DefaultActions"],"members":{"LoadBalancerArn":{},"Protocol":{},"Port":{"type":"integer"},"SslPolicy":{},"Certificates":{"shape":"S3"},"DefaultActions":{"shape":"Sl"},"AlpnPolicy":{"shape":"S1y"}}},"output":{"resultWrapper":"CreateListenerResult","type":"structure","members":{"Listeners":{"shape":"S21"}}}},"CreateLoadBalancer":{"input":{"type":"structure","required":["Name"],"members":{"Name":{},"Subnets":{"shape":"S25"},"SubnetMappings":{"shape":"S27"},"SecurityGroups":{"shape":"S2b"},"Scheme":{},"Tags":{"shape":"Sb"},"Type":{},"IpAddressType":{}}},"output":{"resultWrapper":"CreateLoadBalancerResult","type":"structure","members":{"LoadBalancers":{"shape":"S2h"}}}},"CreateRule":{"input":{"type":"structure","required":["ListenerArn","Conditions","Priority","Actions"],"members":{"ListenerArn":{},"Conditions":{"shape":"S2x"},"Priority":{"type":"integer"},"Actions":{"shape":"Sl"}}},"output":{"resultWrapper":"CreateRuleResult","type":"structure","members":{"Rules":{"shape":"S3d"}}}},"CreateTargetGroup":{"input":{"type":"structure","required":["Name"],"members":{"Name":{},"Protocol":{},"Port":{"type":"integer"},"VpcId":{},"HealthCheckProtocol":{},"HealthCheckPort":{},"HealthCheckEnabled":{"type":"boolean"},"HealthCheckPath":{},"HealthCheckIntervalSeconds":{"type":"integer"},"HealthCheckTimeoutSeconds":{"type":"integer"},"HealthyThresholdCount":{"type":"integer"},"UnhealthyThresholdCount":{"type":"integer"},"Matcher":{"shape":"S3q"},"TargetType":{}}},"output":{"resultWrapper":"CreateTargetGroupResult","type":"structure","members":{"TargetGroups":{"shape":"S3u"}}}},"DeleteListener":{"input":{"type":"structure","required":["ListenerArn"],"members":{"ListenerArn":{}}},"output":{"resultWrapper":"DeleteListenerResult","type":"structure","members":{}}},"DeleteLoadBalancer":{"input":{"type":"structure","required":["LoadBalancerArn"],"members":{"LoadBalancerArn":{}}},"output":{"resultWrapper":"DeleteLoadBalancerResult","type":"structure","members":{}}},"DeleteRule":{"input":{"type":"structure","required":["RuleArn"],"members":{"RuleArn":{}}},"output":{"resultWrapper":"DeleteRuleResult","type":"structure","members":{}}},"DeleteTargetGroup":{"input":{"type":"structure","required":["TargetGroupArn"],"members":{"TargetGroupArn":{}}},"output":{"resultWrapper":"DeleteTargetGroupResult","type":"structure","members":{}}},"DeregisterTargets":{"input":{"type":"structure","required":["TargetGroupArn","Targets"],"members":{"TargetGroupArn":{},"Targets":{"shape":"S46"}}},"output":{"resultWrapper":"DeregisterTargetsResult","type":"structure","members":{}}},"DescribeAccountLimits":{"input":{"type":"structure","members":{"Marker":{},"PageSize":{"type":"integer"}}},"output":{"resultWrapper":"DescribeAccountLimitsResult","type":"structure","members":{"Limits":{"type":"list","member":{"type":"structure","members":{"Name":{},"Max":{}}}},"NextMarker":{}}}},"DescribeListenerCertificates":{"input":{"type":"structure","required":["ListenerArn"],"members":{"ListenerArn":{},"Marker":{},"PageSize":{"type":"integer"}}},"output":{"resultWrapper":"DescribeListenerCertificatesResult","type":"structure","members":{"Certificates":{"shape":"S3"},"NextMarker":{}}}},"DescribeListeners":{"input":{"type":"structure","members":{"LoadBalancerArn":{},"ListenerArns":{"type":"list","member":{}},"Marker":{},"PageSize":{"type":"integer"}}},"output":{"resultWrapper":"DescribeListenersResult","type":"structure","members":{"Listeners":{"shape":"S21"},"NextMarker":{}}}},"DescribeLoadBalancerAttributes":{"input":{"type":"structure","required":["LoadBalancerArn"],"members":{"LoadBalancerArn":{}}},"output":{"resultWrapper":"DescribeLoadBalancerAttributesResult","type":"structure","members":{"Attributes":{"shape":"S4p"}}}},"DescribeLoadBalancers":{"input":{"type":"structure","members":{"LoadBalancerArns":{"shape":"S3w"},"Names":{"type":"list","member":{}},"Marker":{},"PageSize":{"type":"integer"}}},"output":{"resultWrapper":"DescribeLoadBalancersResult","type":"structure","members":{"LLine truncated
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
||||
@@ -132,6 +132,50 @@ async function exportAccountId(maskAccountId, region) {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
function loadCredentials() {
|
||||
// Force the SDK to re-resolve credentials with the default provider chain.
|
||||
//
|
||||
// This action typically sets credentials in the environment via environment variables.
|
||||
// The SDK never refreshes those env-var-based credentials after initial load.
|
||||
// In case there were already env-var creds set in the actions environment when this action
|
||||
// loaded, this action needs to refresh the SDK creds after overwriting those environment variables.
|
||||
//
|
||||
// The credentials object needs to be entirely recreated (instead of simply refreshed),
|
||||
// because the credential object type could change when this action writes env var creds.
|
||||
// For example, the first load could return EC2 instance metadata credentials
|
||||
// in a self-hosted runner, and the second load could return environment credentials
|
||||
// from an assume-role call in this action.
|
||||
aws.config.credentials = null;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
aws.config.getCredentials((err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
resolve(aws.config.credentials);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async function validateCredentials(expectedAccessKeyId) {
|
||||
let credentials;
|
||||
try {
|
||||
credentials = await loadCredentials();
|
||||
|
||||
if (!credentials.accessKeyId) {
|
||||
throw new Error('Access key ID empty after loading credentials');
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(`Credentials could not be loaded, please check your action inputs: ${error.message}`);
|
||||
}
|
||||
|
||||
const actualAccessKeyId = credentials.accessKeyId;
|
||||
|
||||
if (expectedAccessKeyId && expectedAccessKeyId != actualAccessKeyId) {
|
||||
throw new Error('Unexpected failure: Credentials loaded by the SDK do not match the access key ID configured by the action');
|
||||
}
|
||||
}
|
||||
|
||||
function getStsClient(region) {
|
||||
return new aws.STS({
|
||||
region,
|
||||
@@ -172,6 +216,13 @@ async function run() {
|
||||
exportCredentials({accessKeyId, secretAccessKey, sessionToken});
|
||||
}
|
||||
|
||||
// Regardless of whether any source credentials were provided as inputs,
|
||||
// validate that the SDK can actually pick up credentials. This validates
|
||||
// cases where this action is on a self-hosted runner that doesn't have credentials
|
||||
// configured correctly, and cases where the user intended to provide input
|
||||
// credentials but the secrets inputs resolved to empty strings.
|
||||
await validateCredentials(accessKeyId);
|
||||
|
||||
const sourceAccountId = await exportAccountId(maskAccountId, region);
|
||||
|
||||
// Get role credentials if configured to do so
|
||||
@@ -185,6 +236,7 @@ async function run() {
|
||||
roleSessionName
|
||||
});
|
||||
exportCredentials(roleCredentials);
|
||||
await validateCredentials(roleCredentials.accessKeyId);
|
||||
await exportAccountId(maskAccountId, region);
|
||||
}
|
||||
}
|
||||
|
||||
+89
-2
@@ -1,6 +1,6 @@
|
||||
const core = require('@actions/core');
|
||||
const assert = require('assert');
|
||||
|
||||
const aws = require('aws-sdk');
|
||||
const run = require('.');
|
||||
|
||||
jest.mock('@actions/core');
|
||||
@@ -49,6 +49,9 @@ const mockStsAssumeRole = jest.fn();
|
||||
|
||||
jest.mock('aws-sdk', () => {
|
||||
return {
|
||||
config: {
|
||||
getCredentials: jest.fn()
|
||||
},
|
||||
STS: jest.fn(() => ({
|
||||
getCallerIdentity: mockStsCallerIdentity,
|
||||
assumeRole: mockStsAssumeRole,
|
||||
@@ -82,6 +85,27 @@ describe('Configure AWS Credentials', () => {
|
||||
}
|
||||
});
|
||||
|
||||
aws.config.getCredentials.mockReset();
|
||||
aws.config.getCredentials
|
||||
.mockImplementationOnce(callback => {
|
||||
if (!aws.config.credentials) {
|
||||
aws.config.credentials = {
|
||||
accessKeyId: FAKE_ACCESS_KEY_ID,
|
||||
secretAccessKey: FAKE_SECRET_ACCESS_KEY
|
||||
}
|
||||
}
|
||||
callback(null);
|
||||
})
|
||||
.mockImplementationOnce(callback => {
|
||||
if (!aws.config.credentials) {
|
||||
aws.config.credentials = {
|
||||
accessKeyId: FAKE_STS_ACCESS_KEY_ID,
|
||||
secretAccessKey: FAKE_STS_SECRET_ACCESS_KEY
|
||||
}
|
||||
}
|
||||
callback(null);
|
||||
});
|
||||
|
||||
mockStsAssumeRole.mockImplementation(() => {
|
||||
return {
|
||||
promise() {
|
||||
@@ -134,6 +158,59 @@ describe('Configure AWS Credentials', () => {
|
||||
expect(core.setSecret).toHaveBeenCalledWith(FAKE_ACCOUNT_ID);
|
||||
});
|
||||
|
||||
test('action with no accessible credentials fails', async () => {
|
||||
process.env.SHOW_STACK_TRACE = 'false';
|
||||
const mockInputs = {'aws-region': FAKE_REGION};
|
||||
core.getInput = jest
|
||||
.fn()
|
||||
.mockImplementation(mockGetInput(mockInputs));
|
||||
aws.config.getCredentials.mockReset();
|
||||
aws.config.getCredentials.mockImplementation(callback => {
|
||||
callback(new Error('No credentials to load'));
|
||||
});
|
||||
|
||||
await run();
|
||||
|
||||
expect(core.setFailed).toHaveBeenCalledWith("Credentials could not be loaded, please check your action inputs: No credentials to load");
|
||||
});
|
||||
|
||||
test('action with empty credentials fails', async () => {
|
||||
process.env.SHOW_STACK_TRACE = 'false';
|
||||
const mockInputs = {'aws-region': FAKE_REGION};
|
||||
core.getInput = jest
|
||||
.fn()
|
||||
.mockImplementation(mockGetInput(mockInputs));
|
||||
aws.config.getCredentials.mockReset();
|
||||
aws.config.getCredentials.mockImplementation(callback => {
|
||||
aws.config.credentials = {
|
||||
accessKeyId: ''
|
||||
}
|
||||
callback(null);
|
||||
});
|
||||
|
||||
await run();
|
||||
|
||||
expect(core.setFailed).toHaveBeenCalledWith("Credentials could not be loaded, please check your action inputs: Access key ID empty after loading credentials");
|
||||
});
|
||||
|
||||
test('action fails when credentials are not set in the SDK correctly', async () => {
|
||||
process.env.SHOW_STACK_TRACE = 'false';
|
||||
core.getInput = jest
|
||||
.fn()
|
||||
.mockImplementation(mockGetInput(ASSUME_ROLE_INPUTS));
|
||||
aws.config.getCredentials.mockReset();
|
||||
aws.config.getCredentials.mockImplementation(callback => {
|
||||
aws.config.credentials = {
|
||||
accessKeyId: FAKE_ACCESS_KEY_ID
|
||||
}
|
||||
callback(null);
|
||||
});
|
||||
|
||||
await run();
|
||||
|
||||
expect(core.setFailed).toHaveBeenCalledWith("Unexpected failure: Credentials loaded by the SDK do not match the access key ID configured by the action");
|
||||
});
|
||||
|
||||
test('session token is optional', async () => {
|
||||
const mockInputs = {...CREDS_INPUTS, 'aws-region': 'eu-west-1'};
|
||||
core.getInput = jest
|
||||
@@ -154,12 +231,19 @@ describe('Configure AWS Credentials', () => {
|
||||
expect(core.setSecret).toHaveBeenCalledWith(FAKE_ACCOUNT_ID);
|
||||
});
|
||||
|
||||
test('session token is cleared if necessary', async () => {
|
||||
test('existing env var creds are cleared', async () => {
|
||||
const mockInputs = {...CREDS_INPUTS, 'aws-region': 'eu-west-1'};
|
||||
core.getInput = jest
|
||||
.fn()
|
||||
.mockImplementation(mockGetInput(mockInputs));
|
||||
process.env.AWS_ACCESS_KEY_ID = 'foo';
|
||||
process.env.AWS_SECRET_ACCESS_KEY = 'bar';
|
||||
process.env.AWS_SESSION_TOKEN = 'helloworld';
|
||||
aws.config.credentials = {
|
||||
accessKeyId: 'foo',
|
||||
secretAccessKey: 'bar',
|
||||
sessionToken: 'helloworld'
|
||||
};
|
||||
|
||||
await run();
|
||||
expect(mockStsAssumeRole).toHaveBeenCalledTimes(0);
|
||||
@@ -174,6 +258,9 @@ describe('Configure AWS Credentials', () => {
|
||||
expect(core.exportVariable).toHaveBeenCalledWith('AWS_REGION', 'eu-west-1');
|
||||
expect(core.setOutput).toHaveBeenCalledWith('aws-account-id', FAKE_ACCOUNT_ID);
|
||||
expect(core.setSecret).toHaveBeenCalledWith(FAKE_ACCOUNT_ID);
|
||||
expect(aws.config.credentials.accessKeyId).toBe(FAKE_ACCESS_KEY_ID);
|
||||
expect(aws.config.credentials.secretAccessKey).toBe(FAKE_SECRET_ACCESS_KEY);
|
||||
expect(aws.config.credentials.sessionToken).toBeUndefined();
|
||||
});
|
||||
|
||||
test('validates region name', async () => {
|
||||
|
||||
Generated
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aws-actions-configure-aws-credentials",
|
||||
"version": "1.3.5",
|
||||
"version": "1.4.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -1203,9 +1203,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"aws-sdk": {
|
||||
"version": "2.684.0",
|
||||
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.684.0.tgz",
|
||||
"integrity": "sha512-OkSMKIbRTBd3YV5iAklJxZFyLg0jRO2XW6+WhMuDBHMEs8aRbZw4iAD85wFC8tG7X9o0kcjnWfZUDq7MK1dcDg==",
|
||||
"version": "2.686.0",
|
||||
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.686.0.tgz",
|
||||
"integrity": "sha512-QhYhJ5y8tUG5SlmY3CSf9RBaa3EFbta28oarOyiwceHKmY80cMCafRI1YypT6CVDx/q91dbnSNQfWhs0cZPbBQ==",
|
||||
"requires": {
|
||||
"buffer": "4.9.1",
|
||||
"events": "1.1.1",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aws-actions-configure-aws-credentials",
|
||||
"version": "1.3.5",
|
||||
"version": "1.4.0",
|
||||
"description": "Configure AWS Credentials",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -26,7 +26,7 @@
|
||||
"homepage": "https://github.com/aws-actions/configure-aws-credentials#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.4",
|
||||
"aws-sdk": "^2.684.0"
|
||||
"aws-sdk": "^2.686.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
|
||||
Reference in new issue
Block a user