Merge branch 'backstage:master' into master
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
# @backstage/backend-common
|
||||
|
||||
## 0.15.1-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 399286d7dd: Workaround support for `swc` instead of `sucrase`
|
||||
- bf5e9030eb: Updated dependency `msw` to `^0.45.0`.
|
||||
- Updated dependencies
|
||||
- @backstage/config-loader@1.1.4-next.0
|
||||
- @backstage/integration@1.3.1-next.0
|
||||
|
||||
## 0.15.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import { AbortController as AbortController_2 } from 'node-abort-controller';
|
||||
import { AbortSignal as AbortSignal_2 } from 'node-abort-controller';
|
||||
import aws from 'aws-sdk';
|
||||
import { AwsS3Integration } from '@backstage/integration';
|
||||
import { AzureIntegration } from '@backstage/integration';
|
||||
import { BitbucketCloudIntegration } from '@backstage/integration';
|
||||
@@ -34,7 +35,6 @@ import { Readable } from 'stream';
|
||||
import { ReadCommitResult } from 'isomorphic-git';
|
||||
import { RequestHandler } from 'express';
|
||||
import { Router } from 'express';
|
||||
import { S3 } from 'aws-sdk';
|
||||
import { Server } from 'http';
|
||||
import * as winston from 'winston';
|
||||
import { Writable } from 'stream';
|
||||
@@ -44,7 +44,7 @@ export class AwsS3UrlReader implements UrlReader {
|
||||
constructor(
|
||||
integration: AwsS3Integration,
|
||||
deps: {
|
||||
s3: S3;
|
||||
s3: aws.S3;
|
||||
treeResponseFactory: ReadTreeResponseFactory;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/backend-common",
|
||||
"description": "Common functionality library for Backstage backends",
|
||||
"version": "0.15.0",
|
||||
"version": "0.15.1-next.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"private": false,
|
||||
@@ -36,9 +36,9 @@
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "^0.1.9",
|
||||
"@backstage/config": "^1.0.1",
|
||||
"@backstage/config-loader": "^1.1.3",
|
||||
"@backstage/config-loader": "^1.1.4-next.0",
|
||||
"@backstage/errors": "^1.1.0",
|
||||
"@backstage/integration": "^1.3.0",
|
||||
"@backstage/integration": "^1.3.1-next.0",
|
||||
"@backstage/types": "^1.0.0",
|
||||
"@google-cloud/storage": "^6.0.0",
|
||||
"@keyv/redis": "^2.2.3",
|
||||
@@ -61,7 +61,7 @@
|
||||
"express-promise-router": "^4.1.0",
|
||||
"fs-extra": "10.1.0",
|
||||
"git-url-parse": "^12.0.0",
|
||||
"helmet": "^5.0.2",
|
||||
"helmet": "^6.0.0",
|
||||
"isomorphic-git": "^1.8.0",
|
||||
"jose": "^4.6.0",
|
||||
"keyv": "^4.0.3",
|
||||
@@ -94,8 +94,8 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/backend-test-utils": "^0.1.27",
|
||||
"@backstage/cli": "^0.18.1",
|
||||
"@backstage/backend-test-utils": "^0.1.28-next.0",
|
||||
"@backstage/cli": "^0.18.2-next.0",
|
||||
"@types/archiver": "^5.1.0",
|
||||
"@types/base64-stream": "^1.0.2",
|
||||
"@types/compression": "^1.7.0",
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import aws, { Credentials, S3 } from 'aws-sdk';
|
||||
// note: We do the import like this so that we don't get issues destructuring
|
||||
// and it not being mocked by the aws-sdk-mock package which is unfortunate.
|
||||
import aws from 'aws-sdk';
|
||||
import { CredentialsOptions } from 'aws-sdk/lib/credentials';
|
||||
import {
|
||||
ReaderFactory,
|
||||
@@ -126,7 +128,7 @@ export class AwsS3UrlReader implements UrlReader {
|
||||
return integrations.awsS3.list().map(integration => {
|
||||
const credentials = AwsS3UrlReader.buildCredentials(integration);
|
||||
|
||||
const s3 = new S3({
|
||||
const s3 = new aws.S3({
|
||||
apiVersion: '2006-03-01',
|
||||
credentials,
|
||||
endpoint: integration.config.endpoint,
|
||||
@@ -145,7 +147,7 @@ export class AwsS3UrlReader implements UrlReader {
|
||||
constructor(
|
||||
private readonly integration: AwsS3Integration,
|
||||
private readonly deps: {
|
||||
s3: S3;
|
||||
s3: aws.S3;
|
||||
treeResponseFactory: ReadTreeResponseFactory;
|
||||
},
|
||||
) {}
|
||||
@@ -156,17 +158,17 @@ export class AwsS3UrlReader implements UrlReader {
|
||||
*/
|
||||
private static buildCredentials(
|
||||
integration?: AwsS3Integration,
|
||||
): Credentials | CredentialsOptions | undefined {
|
||||
): aws.Credentials | CredentialsOptions | undefined {
|
||||
if (!integration) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const accessKeyId = integration.config.accessKeyId;
|
||||
const secretAccessKey = integration.config.secretAccessKey;
|
||||
let explicitCredentials: Credentials | undefined;
|
||||
let explicitCredentials: aws.Credentials | undefined;
|
||||
|
||||
if (accessKeyId && secretAccessKey) {
|
||||
explicitCredentials = new Credentials({
|
||||
explicitCredentials = new aws.Credentials({
|
||||
accessKeyId,
|
||||
secretAccessKey,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user