Skip to content

Commit

Permalink
πŸ“ Update README with Tencent STS usage
Browse files Browse the repository at this point in the history
- Added code snippets for using Tencent STS
- Updated README and README_ZH files
  • Loading branch information
guotingchao committed May 10, 2024
1 parent f80fd14 commit c37a9e7
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-ducks-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cardbrother/nestjs-tencent-cloud-sdk": patch
---

update readme
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,34 @@ cosClient.upload({
});
```

#### **Usage Tencent STS**

```ts
const sts_client = await tencentCloudService.useClient(
TencentCloudClientType.STS,
);
expect(sts_client).toBeDefined();
expect(sts_client).toBeInstanceOf(StsProvider);
const tempSignature = await sts_client.createTemporary({
Name: 'Test',
Policy: encodeURI(
JSON.stringify({
version: '2.0',
statement: [
{
effect: 'allow',
action: ['name/cos:PutObject'],
resource: ['*'],
},
],
}),
),
DurationSeconds: 1800,
});



#### πŸ“ [CHANGELOG](CHANGELOG.md)

#### License [MIT](https://github.com/guotingchao/nest-tencent-cloud-sdk/blob/main/LICENSE)
```
28 changes: 28 additions & 0 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,34 @@ cosClient.upload({
});
```

#### **使用 Tencent STS**

```ts
const sts_client = await tencentCloudService.useClient(
TencentCloudClientType.STS,
);
expect(sts_client).toBeDefined();
expect(sts_client).toBeInstanceOf(StsProvider);
const tempSignature = await sts_client.createTemporary({
Name: 'Test',
Policy: encodeURI(
JSON.stringify({
version: '2.0',
statement: [
{
effect: 'allow',
action: ['name/cos:PutObject'],
resource: ['*'],
},
],
}),
),
DurationSeconds: 1800,
});



#### πŸ“ [CHANGELOG](CHANGELOG.md)

#### License [MIT](https://github.com/guotingchao/nest-tencent-cloud-sdk/blob/main/LICENSE)
```

0 comments on commit c37a9e7

Please sign in to comment.