Add documentation for IAM role authentication

Signed-off-by: Kiera Jost <kjost@splunk.com>
This commit is contained in:
Kiera Jost
2021-08-06 14:59:14 -06:00
committed by Sean Tan
parent 2d7bf1c6b0
commit fdece1f716
4 changed files with 18 additions and 6 deletions
@@ -26,7 +26,6 @@ import {
} from './types';
import getRawBody from 'raw-body';
import { AwsS3Integration, ScmIntegrations } from '@backstage/integration';
import { constant } from 'lodash';
const parseURL = (
url: string,
@@ -83,13 +82,13 @@ export class AwsS3UrlReader implements UrlReader {
private readonly s3: S3,
) {}
/**
* If accesKeyId and secretAccessKey are missing, the standard credentials provider chain will be used:
* https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html
*/
private static buildCredentials(
integration?: AwsS3Integration,
): Credentials | CredentialsOptions | undefined {
/*
Credentials is an optional config.
If missing, the default ways of authenticating AWS SDK will be used.
*/
if (!integration) {
return undefined;
}
@@ -97,6 +96,7 @@ export class AwsS3UrlReader implements UrlReader {
const accessKeyId = integration.config.accessKeyId;
const secretAccessKey = integration.config.secretAccessKey;
let explicitCredentials: Credentials | undefined;
if (accessKeyId && secretAccessKey) {
explicitCredentials = new Credentials({
accessKeyId,
+1
View File
@@ -38,6 +38,7 @@ export type AwsS3IntegrationConfig = {
host: string;
accessKeyId?: string;
secretAccessKey?: string;
roleArn?: string;
};
// Warning: (ae-missing-release-tag) "AzureIntegration" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)