enabling minio support for S3 connector

This commit is contained in:
Martin McKeaveney 2021-12-31 16:15:49 +00:00
parent bc6c50482c
commit e87a348fb8
1 changed files with 10 additions and 11 deletions

View File

@ -8,6 +8,8 @@ module S3Module {
region: string
accessKeyId: string
secretAccessKey: string
s3ForcePathStyle: boolean
endpoint?: string
}
const SCHEMA: Integration = {
@ -18,7 +20,7 @@ module S3Module {
datasource: {
region: {
type: "string",
required: true,
required: false,
default: "us-east-1",
},
accessKeyId: {
@ -33,13 +35,10 @@ module S3Module {
type: "string",
required: false,
},
s3ForcePathStyle: {
type: "boolean",
required: false,
},
signatureVersion: {
type: "string",
required: false,
default: "v4"
},
},
query: {
@ -58,16 +57,16 @@ module S3Module {
class S3Integration implements IntegrationBase {
private readonly config: S3Config
private client: any
private connectionPromise: Promise<any>
constructor(config: S3Config) {
this.config = config
this.connectionPromise = this.connect()
this.client = new AWS.S3()
if (this.config.endpoint) {
this.config.s3ForcePathStyle = true
} else {
delete this.config.endpoint
}
async connect() {
AWS.config.update(this.config)
this.client = new AWS.S3(this.config)
}
async read(query: { bucket: string }) {