@gtrevorrow/oci-token-exchange 1.0.0 → 1.1.0
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/LICENSE.txt +1 -1
- package/README.md +49 -27
- package/dist/index.d.ts +1 -1
- package/dist/index.js +36482 -4
- package/dist/index.js.map +1 -0
- package/dist/licenses.txt +411 -0
- package/dist/main.d.ts +3 -3
- package/dist/main.js +140 -98
- package/dist/platforms/cli.d.ts +2 -2
- package/dist/platforms/cli.js +7 -6
- package/dist/platforms/github.d.ts +1 -1
- package/dist/platforms/types.d.ts +4 -0
- package/dist/platforms/types.js +11 -0
- package/dist/sourcemap-register.js +1 -0
- package/dist/types.d.ts +17 -1
- package/package.json +7 -18
package/LICENSE.txt
CHANGED
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
# OCI Token Exchange
|
|
26
26
|
|
|
27
|
-
A tool to exchange OIDC tokens for [OCI session tokens](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/clitoken.htm), supporting multiple CI platforms:
|
|
27
|
+
A tool to exchange OIDC tokens for [OCI session tokens](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/clitoken.htm), supporting multiple CI/CD platforms:
|
|
28
28
|
- GitHub Actions
|
|
29
29
|
- GitLab CI
|
|
30
30
|
- Bitbucket Pipelines
|
|
@@ -32,17 +32,29 @@ A tool to exchange OIDC tokens for [OCI session tokens](https://docs.oracle.com/
|
|
|
32
32
|
## Installation
|
|
33
33
|
|
|
34
34
|
### As GitHub Action
|
|
35
|
+
|
|
36
|
+
To use this tool as a step in your GitHub Actions workflow, reference it using a specific Git tag or branch. The following options are available, managed automatically by the release workflow:
|
|
37
|
+
|
|
38
|
+
* **`@vX` (e.g., `@v1`) - Recommended:** Points to the latest stable release within a specific major version (e.g., the latest `v1.x.y`). This tag is automatically updated upon new releases, allowing you to receive compatible updates and bug fixes without breaking changes.
|
|
39
|
+
* **`@vX.Y.Z` (e.g., `@v1.1.0`) - Specific Version:** Pins the action to an exact release version created by semantic-release. Use this if you need absolute stability and want to control updates manually.
|
|
40
|
+
* **`@latest` - Latest Release:** Points to the most recent release. This tag is automatically updated upon new releases by the release workflow.
|
|
41
|
+
* **`@main` - Bleeding Edge (Not Recommended):** Runs the action directly from the latest commit on the `main` branch. This is unstable and should generally be avoided in production workflows.
|
|
42
|
+
|
|
35
43
|
```yaml
|
|
44
|
+
# Recommended: Use the major version tag for automatic compatible updates
|
|
36
45
|
- uses: gtrevorrow/oci-token-exchange-action@v1
|
|
46
|
+
|
|
47
|
+
# Alternative: Pin to a specific version (e.g., v1.1.0)
|
|
48
|
+
# - uses: gtrevorrow/oci-token-exchange-action@v1.1.0
|
|
49
|
+
|
|
50
|
+
# Alternative: Use the latest release
|
|
51
|
+
# - uses: gtrevorrow/oci-token-exchange-action@latest
|
|
37
52
|
```
|
|
38
53
|
|
|
39
54
|
### As CLI Tool
|
|
40
55
|
```bash
|
|
41
56
|
npm install -g @gtrevorrow/oci-token-exchange
|
|
42
57
|
|
|
43
|
-
# Install the latest version globally
|
|
44
|
-
npm install -g @gtrevorrow/oci-token-exchange
|
|
45
|
-
|
|
46
58
|
# Install a specific version globally (e.g., 1.2.3)
|
|
47
59
|
npm install -g @gtrevorrow/oci-token-exchange@1.2.3
|
|
48
60
|
|
|
@@ -56,10 +68,17 @@ npm install -g @gtrevorrow/oci-token-exchange@beta
|
|
|
56
68
|
```yaml
|
|
57
69
|
- uses: gtrevorrow/oci-token-exchange-action@v1
|
|
58
70
|
with:
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
# ci_platform: 'github' # Optional: Defaults to 'github'. Other values: 'gitlab', 'bitbucket', 'local' (though 'github' is typical for Actions)
|
|
72
|
+
oidc_client_identifier: ${{ secrets.OIDC_CLIENT_IDENTIFIER }}
|
|
73
|
+
domain_base_url: ${{ vars.DOMAIN_BASE_URL }}
|
|
61
74
|
oci_tenancy: ${{ secrets.OCI_TENANCY }}
|
|
62
75
|
oci_region: ${{ secrets.OCI_REGION }}
|
|
76
|
+
# Optional: Custom base folder for OCI config (.oci) directory
|
|
77
|
+
# oci_home: ${{ secrets.OCI_HOME }}
|
|
78
|
+
# Optional: Name of the OCI CLI profile to create. Defaults to 'DEFAULT'.
|
|
79
|
+
# oci_profile: 'DEFAULT'
|
|
80
|
+
# Optional: Number of retry attempts. Defaults to '0'.
|
|
81
|
+
# retry_count: '0'
|
|
63
82
|
```
|
|
64
83
|
|
|
65
84
|
### GitLab CI
|
|
@@ -96,8 +115,8 @@ deploy:
|
|
|
96
115
|
- |
|
|
97
116
|
cd dist &&
|
|
98
117
|
PLATFORM=gitlab \
|
|
99
|
-
|
|
100
|
-
|
|
118
|
+
OIDC_CLIENT_IDENTIFIER=${OIDC_CLIENT_IDENTIFIER} \
|
|
119
|
+
DOMAIN_BASE_URL=${DOMAIN_BASE_URL} \ # Changed from DOMAIN_URL
|
|
101
120
|
OCI_TENANCY=${OCI_TENANCY} \
|
|
102
121
|
OCI_REGION=${OCI_REGION} \
|
|
103
122
|
RETRY_COUNT=3 \
|
|
@@ -142,8 +161,8 @@ deploy_npm:
|
|
|
142
161
|
# Run the installed CLI
|
|
143
162
|
- |
|
|
144
163
|
PLATFORM=gitlab \
|
|
145
|
-
|
|
146
|
-
|
|
164
|
+
OIDC_CLIENT_IDENTIFIER=${OIDC_CLIENT_IDENTIFIER} \
|
|
165
|
+
DOMAIN_BASE_URL=${DOMAIN_BASE_URL} \ # Changed from DOMAIN_URL
|
|
147
166
|
OCI_TENANCY=${OCI_TENANCY} \
|
|
148
167
|
OCI_REGION=${OCI_REGION} \
|
|
149
168
|
RETRY_COUNT=3 \
|
|
@@ -192,8 +211,8 @@ pipelines:
|
|
|
192
211
|
- >
|
|
193
212
|
cd dist &&
|
|
194
213
|
export PLATFORM=bitbucket &&
|
|
195
|
-
export
|
|
196
|
-
export
|
|
214
|
+
export OIDC_CLIENT_IDENTIFIER=${OIDC_CLIENT_IDENTIFIER} &&
|
|
215
|
+
export DOMAIN_BASE_URL=${DOMAIN_BASE_URL} && # Changed from DOMAIN_URL
|
|
197
216
|
export OCI_TENANCY=${OCI_TENANCY} &&
|
|
198
217
|
export OCI_REGION=${OCI_REGION} &&
|
|
199
218
|
export RETRY_COUNT=3
|
|
@@ -235,8 +254,8 @@ pipelines:
|
|
|
235
254
|
# Run the installed CLI for token exchange
|
|
236
255
|
- >
|
|
237
256
|
export PLATFORM=bitbucket &&
|
|
238
|
-
export
|
|
239
|
-
export
|
|
257
|
+
export OIDC_CLIENT_IDENTIFIER=${OIDC_CLIENT_IDENTIFIER} &&
|
|
258
|
+
export DOMAIN_BASE_URL=${DOMAIN_BASE_URL} && # Changed from DOMAIN_URL
|
|
240
259
|
export OCI_TENANCY=${OCI_TENANCY} &&
|
|
241
260
|
export OCI_REGION=${OCI_REGION} &&
|
|
242
261
|
export RETRY_COUNT=3
|
|
@@ -260,9 +279,11 @@ npm install -g @gtrevorrow/oci-token-exchange
|
|
|
260
279
|
|
|
261
280
|
# Run with required environment variables
|
|
262
281
|
export LOCAL_OIDC_TOKEN="your.jwt.token"
|
|
282
|
+
# Optional: set custom OCI config home
|
|
283
|
+
export OCI_HOME="/custom/home"
|
|
263
284
|
PLATFORM=local \
|
|
264
|
-
|
|
265
|
-
|
|
285
|
+
OIDC_CLIENT_IDENTIFIER=your-client-identifier \
|
|
286
|
+
DOMAIN_BASE_URL=https://your-domain.identity.oraclecloud.com \ # Changed from DOMAIN_URL
|
|
266
287
|
OCI_TENANCY=your-tenancy-ocid \
|
|
267
288
|
OCI_REGION=your-region \
|
|
268
289
|
oci-token-exchange
|
|
@@ -287,16 +308,18 @@ The action supports flexible environment variable naming to make it easier to us
|
|
|
287
308
|
|
|
288
309
|
| Variable | Alternate Names | Description | Required |
|
|
289
310
|
|----------|----------------|-------------|----------|
|
|
290
|
-
| `OIDC_CLIENT_IDENTIFIER` | `INPUT_OIDC_CLIENT_IDENTIFIER` |
|
|
291
|
-
| `DOMAIN_BASE_URL` | `INPUT_DOMAIN_BASE_URL` | Base URL of OCI Identity Domain | Yes |
|
|
292
|
-
| `OCI_TENANCY` | `INPUT_OCI_TENANCY` | OCI tenancy OCID | Yes |
|
|
293
|
-
| `OCI_REGION` | `INPUT_OCI_REGION` | OCI region identifier | Yes |
|
|
294
|
-
| `PLATFORM` | `
|
|
295
|
-
| `RETRY_COUNT` | `INPUT_RETRY_COUNT` | Number of retry attempts | No (default: `0`) |
|
|
296
|
-
| `LOCAL_OIDC_TOKEN` | - | OIDC token when using PLATFORM=local | Yes, when platform=local |
|
|
297
|
-
| `CI_JOB_JWT_V2` | - | GitLab CI JWT token | Yes, when platform=gitlab |
|
|
298
|
-
| `BITBUCKET_STEP_OIDC_TOKEN` | - | Bitbucket OIDC token | Yes, when platform=bitbucket |
|
|
299
|
-
| `DEBUG` | - | Enable debug output | No (default: `false`) |
|
|
311
|
+
| `OIDC_CLIENT_IDENTIFIER` | `INPUT_OIDC_CLIENT_IDENTIFIER` | The `client_id:client_secret` string for your confidential OAuth client application. This string is the content used for HTTP Basic Authentication (prior to Base64 encoding), as typically used with the OAuth 2.0 client credentials grant type. The action/tool handles the Base64 encoding. This client application must be registered in the OCI IAM domain and listed in the `oauthClients` attribute of your Identity Propagation Trust policy. This identifies the application making the token exchange request. The client credential derived from this identifier is used to validate the client performing the token exchange. It's important to understand that this is not analogous to a static, long-lived API key; you cannot authenticate and authorize calls to OCI APIs using these client credentials directly. Instead, it serves as an additional layer of protection (in addition to the impersonation rules defined in the trust policy) to ensure that only authorized clients can perform a token exchange. This is especially relevant in contexts like GitHub Actions, where all repositories share a single OCI OIDC provider that signs the tokens it issues with the same private key (i.e., the signing key is not unique per repository or workflow). GitHub Action input: `oidc_client_identifier`. CLI env var: `OIDC_CLIENT_IDENTIFIER`. | Yes |
|
|
312
|
+
| `DOMAIN_BASE_URL` | `INPUT_DOMAIN_BASE_URL` | Base URL of OCI Identity Domain. GitHub Action input: `domain_base_url`. CLI env var: `DOMAIN_BASE_URL`. | Yes |
|
|
313
|
+
| `OCI_TENANCY` | `INPUT_OCI_TENANCY` | OCI tenancy OCID. GitHub Action input: `oci_tenancy`. CLI env var: `OCI_TENANCY`. | Yes |
|
|
314
|
+
| `OCI_REGION` | `INPUT_OCI_REGION` | OCI region identifier. GitHub Action input: `oci_region`. CLI env var: `OCI_REGION`. | Yes |
|
|
315
|
+
| `PLATFORM` | `INPUT_CI_PLATFORM` | CI platform. GitHub Action input: `ci_platform` (default: `github`). CLI env var: `PLATFORM` (`github`, `gitlab`, `bitbucket`, or `local`). | No (default: `github`) |
|
|
316
|
+
| `RETRY_COUNT` | `INPUT_RETRY_COUNT` | Number of retry attempts. GitHub Action input: `retry_count`. CLI env var: `RETRY_COUNT`. | No (default: `0`) |
|
|
317
|
+
| `LOCAL_OIDC_TOKEN` | - | OIDC token when using `PLATFORM=local` (CLI only). | Yes, when platform=local |
|
|
318
|
+
| `CI_JOB_JWT_V2` | - | GitLab CI JWT token (used when `PLATFORM=gitlab` for CLI). | Yes, when platform=gitlab |
|
|
319
|
+
| `BITBUCKET_STEP_OIDC_TOKEN` | - | Bitbucket OIDC token (used when `PLATFORM=bitbucket` for CLI). | Yes, when platform=bitbucket |
|
|
320
|
+
| `DEBUG` | - | Enable debug output (CLI env var). | No (default: `false`) |
|
|
321
|
+
| `OCI_HOME` | `INPUT_OCI_HOME` | Base folder for OCI config (.oci) directory. GitHub Action input: `oci_home`. CLI env var: `OCI_HOME`. | No |
|
|
322
|
+
| `OCI_PROFILE` | `INPUT_OCI_PROFILE` | Name of the OCI CLI profile to create. GitHub Action input: `oci_profile`. CLI env var: `OCI_PROFILE`. Defaults to `DEFAULT`. | No |
|
|
300
323
|
|
|
301
324
|
### Environment Variable Handling
|
|
302
325
|
|
|
@@ -326,4 +349,3 @@ This action is licensed under the [Universal Permissive License v1.0 (UPL-1.0)](
|
|
|
326
349
|
## Contributing
|
|
327
350
|
|
|
328
351
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
329
|
-
````
|
package/dist/index.d.ts
CHANGED