Add an optional external Id field
Signed-off-by: Iain Billett <iain@roadie.io>
This commit is contained in:
@@ -154,11 +154,15 @@ export class AwsS3UrlReader implements UrlReader {
|
||||
|
||||
const roleArn = integration.config.roleArn;
|
||||
if (roleArn) {
|
||||
const externalIdParam = integration.config.externalId
|
||||
? { ExternalId: integration.config.externalId }
|
||||
: {};
|
||||
return new aws.ChainableTemporaryCredentials({
|
||||
masterCredentials: explicitCredentials,
|
||||
params: {
|
||||
RoleSessionName: 'backstage-aws-s3-url-reader',
|
||||
RoleArn: roleArn,
|
||||
...externalIdParam,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Vendored
+6
@@ -200,6 +200,12 @@ export interface Config {
|
||||
* @visibility backend
|
||||
*/
|
||||
roleArn?: string;
|
||||
|
||||
/**
|
||||
* External ID to use when assuming role
|
||||
* @visibility backend
|
||||
*/
|
||||
externalId?: string;
|
||||
}>;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -59,6 +59,11 @@ export type AwsS3IntegrationConfig = {
|
||||
* (Optional) ARN of role to be assumed
|
||||
*/
|
||||
roleArn?: string;
|
||||
|
||||
/**
|
||||
* (optional) External ID to use when assuming role
|
||||
*/
|
||||
externalId?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -98,6 +103,7 @@ export function readAwsS3IntegrationConfig(
|
||||
const accessKeyId = config.getOptionalString('accessKeyId');
|
||||
const secretAccessKey = config.getOptionalString('secretAccessKey');
|
||||
const roleArn = config.getOptionalString('roleArn');
|
||||
const externalId = config.getOptionalString('externalId');
|
||||
|
||||
return {
|
||||
host,
|
||||
@@ -106,6 +112,7 @@ export function readAwsS3IntegrationConfig(
|
||||
accessKeyId,
|
||||
secretAccessKey,
|
||||
roleArn,
|
||||
externalId,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user