-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hcdc-access-service): integrate S3 configuration and update prin…
…t templates to use new logo source
- Loading branch information
Showing
25 changed files
with
133 additions
and
119 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { makeConfigLoader } from '@diut/nestjs-infra' | ||
import { Expose } from 'class-transformer' | ||
import { IsString, MinLength } from 'class-validator' | ||
|
||
export class S3Config { | ||
@Expose() | ||
@MinLength(1) | ||
@IsString() | ||
S3_ACCESS_KEY: string | ||
|
||
@Expose() | ||
@MinLength(1) | ||
@IsString() | ||
S3_SECRET_KEY: string | ||
|
||
@Expose() | ||
@MinLength(1) | ||
@IsString() | ||
S3_REGION: string | ||
|
||
@Expose() | ||
@MinLength(1) | ||
@IsString() | ||
S3_SAMPLE_IMAGES_BUCKET: string | ||
|
||
@Expose() | ||
@MinLength(1) | ||
@IsString() | ||
S3_APP_BUCKET: string | ||
} | ||
|
||
export const loadS3Config = makeConfigLoader(S3Config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { AwsS3ClientModule, getAwsS3ServiceToken } from '@diut/nestjs-infra' | ||
import { ModuleMetadata } from '@nestjs/common' | ||
import { S3Config, loadS3Config } from 'src/config' | ||
import { STORAGE_BUCKET_TOKEN, STORAGE_SERVICE_TOKEN } from 'src/domain' | ||
import { StorageBucketProvider } from './bucket' | ||
|
||
const S3_INSTANCE_ID = 'S3' | ||
|
||
export const s3Metadata: ModuleMetadata = { | ||
imports: [ | ||
AwsS3ClientModule.registerAsync({ | ||
instanceId: S3_INSTANCE_ID, | ||
inject: [loadS3Config.KEY], | ||
useFactory: async (s3Config: S3Config) => ({ | ||
bucketName: s3Config.S3_SAMPLE_IMAGES_BUCKET, | ||
region: s3Config.S3_REGION, | ||
credentials: { | ||
accessKeyId: s3Config.S3_ACCESS_KEY, | ||
secretAccessKey: s3Config.S3_SECRET_KEY, | ||
}, | ||
}), | ||
}), | ||
], | ||
providers: [ | ||
{ | ||
provide: STORAGE_SERVICE_TOKEN, | ||
useExisting: getAwsS3ServiceToken(S3_INSTANCE_ID), | ||
}, | ||
{ | ||
provide: STORAGE_BUCKET_TOKEN, | ||
useClass: StorageBucketProvider, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ hcdc-lab: | |
labo3: | ||
labo4: | ||
labo5: | ||
labo2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.