Skip to content

Commit

Permalink
fix(sys): fix oss sts config;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Apr 16, 2022
1 parent e8639b0 commit 3a15d32
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/system-server/http/oss.http
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Content-Type: application/json
}


### Get a bucket

GET {{base_url}}/sys-api/apps/{{appid}}/oss/buckets/test-for-create-bucket
Content-Type: application/json
Authorization: Bearer {{token}}


### Delete a bucket

Expand Down
4 changes: 2 additions & 2 deletions packages/system-server/src/api/oss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export class MinioAgent {
*/
public getApplicationSTSClient(app: ApplicationStruct) {
return new STSClient({
endpoint: Config.MINIO_CONFIG.endpoint.external,
endpoint: Config.MINIO_CONFIG.endpoint.internal,
credentials: {
accessKeyId: app.appid,
secretAccessKey: app.config.server_secret_salt,
secretAccessKey: app.config.oss_access_secret,
},
region: 'us-east-1'
})
Expand Down
7 changes: 6 additions & 1 deletion packages/system-server/src/router/oss/get-buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ export async function handleGetOneBucket(req: Request, res: Response) {
const data = {
name,
mode: bucket.mode,
sts: sts
credentials: {
accessKeyId: sts.Credentials?.AccessKeyId,
secretAccessKey: sts.Credentials?.SecretAccessKey,
sessionToken: sts.Credentials?.SessionToken,
expiration: sts.Credentials?.Expiration
}
}

return res.send({
Expand Down

0 comments on commit 3a15d32

Please sign in to comment.