@@ -22,7 +22,7 @@ import {
|
||||
ListObjectsV2Command,
|
||||
PutObjectCommand,
|
||||
S3Client,
|
||||
UploadPartCommand
|
||||
UploadPartCommand,
|
||||
} from '@aws-sdk/client-s3';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { Entity, DEFAULT_NAMESPACE } from '@backstage/catalog-model';
|
||||
@@ -474,7 +474,8 @@ describe('AwsS3Publish', () => {
|
||||
s3Mock.on(GetObjectCommand).callsFake(_ => {
|
||||
return {
|
||||
Body: new ErrorReadable('No stream!'),
|
||||
}});
|
||||
};
|
||||
});
|
||||
|
||||
const publisher = createPublisherFromConfig();
|
||||
|
||||
@@ -612,7 +613,8 @@ describe('AwsS3Publish', () => {
|
||||
s3Mock.on(GetObjectCommand).callsFake(_ => {
|
||||
return {
|
||||
Body: new ErrorReadable('No stream!'),
|
||||
}});
|
||||
};
|
||||
});
|
||||
|
||||
const response = await request(app).get(
|
||||
`/${entityTripletPath}/not-found.html`,
|
||||
|
||||
@@ -131,7 +131,10 @@ export class AwsS3Publish implements PublisherBase {
|
||||
const credentialsConfig = config.getOptionalConfig(
|
||||
'techdocs.publisher.awsS3.credentials',
|
||||
);
|
||||
const credentials = AwsS3Publish.buildCredentials(credentialsConfig, region);
|
||||
const credentials = AwsS3Publish.buildCredentials(
|
||||
credentialsConfig,
|
||||
region,
|
||||
);
|
||||
|
||||
// AWS endpoint is an optional config. If missing, the default endpoint is built from
|
||||
// the configured region.
|
||||
@@ -180,7 +183,10 @@ export class AwsS3Publish implements PublisherBase {
|
||||
};
|
||||
}
|
||||
|
||||
private static buildCredentials(config?: Config, region?: string): CredentialProvider {
|
||||
private static buildCredentials(
|
||||
config?: Config,
|
||||
region?: string,
|
||||
): CredentialProvider {
|
||||
if (!config) {
|
||||
return fromNodeProviderChain();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user