| Total Complexity | 1 |
| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { S3 } from 'aws-sdk'; |
||
| 4 | |||
| 5 | @Injectable() |
||
| 6 | export class S3Factory { |
||
| 7 | constructor( |
||
| 8 | private readonly configService: ConfigService |
||
| 9 | ) {} |
||
| 10 | |||
| 11 | create(): S3 { |
||
| 12 | const accessKeyId = this.configService.get<string>('S3_API_KEY'); |
||
| 13 | const secretAccessKey = this.configService.get<string>('S3_API_SECRET'); |
||
| 14 | |||
| 15 | return new S3({ |
||
| 16 | accessKeyId, |
||
| 17 | secretAccessKey, |
||
| 18 | region: 'fr-par', |
||
| 19 | signatureVersion: 's3v4', |
||
| 20 | endpoint: 'https://s3.fr-par.scw.cloud' |
||
| 21 | }); |
||
| 24 |