@cloud-idaas/akless-aws-adapter 0.1.0-beta.3 → 0.1.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-beta.4
4
+
5
+ - Support optional STS session duration in seconds. Omit it to keep the PAM default.
6
+
3
7
  ## 0.1.0-beta.3
4
8
 
5
9
  - Include this adapter repository name and build version in PAM STS User-Agent headers.
package/README.md CHANGED
@@ -9,11 +9,13 @@ Use IDaaS PAM temporary credentials with AWS SDK for JavaScript v3.
9
9
  Supports Node.js 20, 22, and 24, JavaScript CommonJS/ESM, and TypeScript 4.7 or later. This is a Node.js SDK, not a browser SDK. Check your registry for available beta versions; use a provided package archive when evaluating an unreleased version.
10
10
 
11
11
  ```sh
12
- npm install @cloud-idaas/core-sdk @cloud-idaas/akless-aws-adapter
12
+ npm install @cloud-idaas/core-sdk@0.1.0-beta.4 @cloud-idaas/akless-aws-adapter@0.1.0-beta.4
13
13
  ```
14
14
 
15
15
  ## Usage
16
16
 
17
+ The Factory accepts an optional integer `durationSeconds` from 900 to 43200. Omit it to use the PAM default. The target role can impose a lower maximum. For the default, call `createAwsCredentialsProvider(roleId)`.
18
+
17
19
  Configure Core using CLOUD_IDAAS_CONFIG_PATH or ~/.cloud_idaas/client-config.json. Provide developerApiEndpoint and an identity authorized for PAM access. Replace example identifiers with your settings. Save the following ESM example as `example.mjs` and run it with Node.js. CommonJS uses the same named exports through `require`; asynchronous calls belong inside an async function.
18
20
 
19
21
  ```javascript
@@ -22,7 +24,7 @@ import { createAwsCredentialsProvider } from '@cloud-idaas/akless-aws-adapter';
22
24
 
23
25
  await IDaaSCredentialProviderFactory.init();
24
26
  try {
25
- const credentials = createAwsCredentialsProvider('role-external-id');
27
+ const credentials = createAwsCredentialsProvider('role-external-id', { durationSeconds: 1800 });
26
28
  try {
27
29
  await credentials();
28
30
  // Pass credentials to new S3Client({ region: '...', credentials }).
package/README_zh.md CHANGED
@@ -9,11 +9,13 @@
9
9
  支持 Node.js 20、22、24,JavaScript CommonJS/ESM 以及 TypeScript 4.7 及以上版本。本 SDK 用于 Node.js,不用于浏览器。请以 npm registry 中的实际可用版本为准;评估尚未发布的版本时,使用提供的安装包归档。
10
10
 
11
11
  ```sh
12
- npm install @cloud-idaas/core-sdk @cloud-idaas/akless-aws-adapter
12
+ npm install @cloud-idaas/core-sdk@0.1.0-beta.4 @cloud-idaas/akless-aws-adapter@0.1.0-beta.4
13
13
  ```
14
14
 
15
15
  ## 使用
16
16
 
17
+ Factory 的 `durationSeconds` 接受 900–43200 的整数秒数。省略时由 PAM 决定有效期,实际可请求的上限取决于目标角色。 使用默认值时调用 `createAwsCredentialsProvider(roleId)`。
18
+
17
19
  通过 CLOUD_IDAAS_CONFIG_PATH 或 ~/.cloud_idaas/client-config.json 配置 Core,提供 developerApiEndpoint 及已获 PAM 访问授权的身份,并替换示例标识。 将以下 ESM 示例保存为 `example.mjs`,通过 Node.js 运行。CommonJS 使用相同的具名导出和 `require`,异步调用放在 async 函数中。
18
20
 
19
21
  ```javascript
@@ -22,7 +24,7 @@ import { createAwsCredentialsProvider } from '@cloud-idaas/akless-aws-adapter';
22
24
 
23
25
  await IDaaSCredentialProviderFactory.init();
24
26
  try {
25
- const credentials = createAwsCredentialsProvider('role-external-id');
27
+ const credentials = createAwsCredentialsProvider('role-external-id', { durationSeconds: 1800 });
26
28
  try {
27
29
  await credentials();
28
30
  // Pass credentials to new S3Client({ region: '...', credentials }).
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
4
  // Generated from package.json by scripts/build-version.cjs. Do not edit.
5
- exports.SDK_VERSION = '0.1.0-beta.3';
5
+ exports.SDK_VERSION = '0.1.0-beta.4';
6
6
  //# sourceMappingURL=sdk-version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-version.js","sourceRoot":"","sources":["../src/sdk-version.ts"],"names":[],"mappings":";;;AAAA,yEAAyE;AAC5D,QAAA,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Generated from package.json by scripts/build-version.cjs. Do not edit.\nexport const SDK_VERSION: string = '0.1.0-beta.3';\n"]}
1
+ {"version":3,"file":"sdk-version.js","sourceRoot":"","sources":["../src/sdk-version.ts"],"names":[],"mappings":";;;AAAA,yEAAyE;AAC5D,QAAA,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Generated from package.json by scripts/build-version.cjs. Do not edit.\nexport const SDK_VERSION: string = '0.1.0-beta.4';\n"]}
@@ -4,8 +4,10 @@ const { createAwsCredentialsProvider } = require('@cloud-idaas/akless-aws-adapte
4
4
  async function main() {
5
5
  await IDaaSCredentialProviderFactory.init();
6
6
  try {
7
+ // For the PAM default, call createAwsCredentialsProvider(roleId).
7
8
  const credentials = createAwsCredentialsProvider(
8
9
  process.env.IDAAS_ROLE_EXTERNAL_ID || 'role-id',
10
+ { durationSeconds: 1800 },
9
11
  );
10
12
  try {
11
13
  await credentials();
@@ -4,8 +4,10 @@ import { createAwsCredentialsProvider } from '@cloud-idaas/akless-aws-adapter';
4
4
  async function main() {
5
5
  await IDaaSCredentialProviderFactory.init();
6
6
  try {
7
+ // For the PAM default, call createAwsCredentialsProvider(roleId).
7
8
  const credentials = createAwsCredentialsProvider(
8
9
  process.env.IDAAS_ROLE_EXTERNAL_ID || 'role-id',
10
+ { durationSeconds: 1800 },
9
11
  );
10
12
  try {
11
13
  await credentials();
@@ -4,8 +4,10 @@ import { createAwsCredentialsProvider } from '@cloud-idaas/akless-aws-adapter';
4
4
  async function main() {
5
5
  await IDaaSCredentialProviderFactory.init();
6
6
  try {
7
+ // For the PAM default, call createAwsCredentialsProvider(roleId).
7
8
  const credentials = createAwsCredentialsProvider(
8
9
  process.env.IDAAS_ROLE_EXTERNAL_ID || 'role-id',
10
+ { durationSeconds: 1800 },
9
11
  );
10
12
  try {
11
13
  await credentials();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-idaas/akless-aws-adapter",
3
- "version": "0.1.0-beta.3",
3
+ "version": "0.1.0-beta.4",
4
4
  "description": "IDaaS akless-aws-adapter for TypeScript and JavaScript (Node.js)",
5
5
  "license": "Apache-2.0",
6
6
  "type": "commonjs",
@@ -60,8 +60,8 @@
60
60
  "@aws-sdk/client-sts": "3.1152.0"
61
61
  },
62
62
  "dependencies": {
63
- "@cloud-idaas/core-sdk": "0.1.0-beta.3",
64
- "@cloud-idaas/pam-client-sdk": "0.1.0-beta.3"
63
+ "@cloud-idaas/core-sdk": "0.1.0-beta.4",
64
+ "@cloud-idaas/pam-client-sdk": "0.1.0-beta.4"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public",