Skip to content

Commit a78d52d

Browse files
committed
improvement(credentials): hold unsaved keyless subjects so trust policies applied later still match
1 parent 07330ae commit a78d52d

33 files changed

Lines changed: 34250 additions & 99 deletions

File tree

‎apps/docs/content/docs/cli/credentials.mdx‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ The printed audience is the default. To have Sim sign tokens for your own audien
9797

9898
Step 2: add those values to keylessConfig and pass it to `sim credentials create <providerId> --credentials @file`.
9999

100-
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
100+
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. Sim holds the subject for you for 30 days until a credential saves it, so a trust configuration that takes longer to apply still works: renew the proof with `sim credentials keyless-subject <providerId> --subject <subject>`. The subject stays the same, and each renewal restarts the 30 days. Sim holds your 20 newest unsaved subjects per provider in a workspace; issuing more drops the oldest.
101+
102+
If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, renew the proof and retry. If it reports WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
101103

102104
**Examples**
103105

@@ -351,7 +353,7 @@ API request and response schemas: [deleteCredential](/api-reference/credentials/
351353
OAuth login or personal API key required.
352354

353355
```bash
354-
sim credentials keyless-subject <providerId>
356+
sim credentials keyless-subject <providerId> [options]
355357
```
356358

357359
**Arguments**
@@ -364,6 +366,16 @@ sim credentials keyless-subject <providerId>
364366

365367
</CommandTable>
366368

369+
**Options**
370+
371+
<CommandTable>
372+
373+
| Option | Required | Description |
374+
| --- | --- | --- |
375+
| `--subject <subject>` | No | Renew the proof for a subject Sim issued to you earlier, instead of issuing a new one. |
376+
377+
</CommandTable>
378+
367379
Keyless (workload identity) credentials take two steps.
368380

369381
Step 1: run `sim credentials keyless-subject <providerId> --output json` and configure your cloud to trust the printed issuer, audience, and subject. Its requiredConfigFields lists the values your provider's keylessConfig still needs.
@@ -372,7 +384,9 @@ The printed audience is the default. To have Sim sign tokens for your own audien
372384

373385
Step 2: add those values to keylessConfig and pass it to `sim credentials create <providerId> --credentials @file`.
374386

375-
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
387+
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. Sim holds the subject for you for 30 days until a credential saves it, so a trust configuration that takes longer to apply still works: renew the proof with `sim credentials keyless-subject <providerId> --subject <subject>`. The subject stays the same, and each renewal restarts the 30 days. Sim holds your 20 newest unsaved subjects per provider in a workspace; issuing more drops the oldest.
388+
389+
If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, renew the proof and retry. If it reports WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
376390

377391
**Examples**
378392

‎apps/docs/content/docs/cli/reference.mdx‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,9 @@ The printed audience is the default. To have Sim sign tokens for your own audien
784784

785785
Step 2: add those values to keylessConfig and pass it to `sim credentials create <providerId> --credentials @file`.
786786

787-
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
787+
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. Sim holds the subject for you for 30 days until a credential saves it, so a trust configuration that takes longer to apply still works: renew the proof with `sim credentials keyless-subject <providerId> --subject <subject>`. The subject stays the same, and each renewal restarts the 30 days. Sim holds your 20 newest unsaved subjects per provider in a workspace; issuing more drops the oldest.
788+
789+
If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, renew the proof and retry. If it reports WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
788790

789791
**Examples**
790792

@@ -801,7 +803,7 @@ API request and response schemas: [createServiceAccountCredential](/api-referenc
801803
Issue the subject and proof for a new keyless (workload identity) credential (OAuth login or personal API key required)
802804

803805
```bash
804-
sim credentials keyless-subject <providerId>
806+
sim credentials keyless-subject <providerId> [options]
805807
```
806808

807809
**Arguments**
@@ -814,6 +816,16 @@ sim credentials keyless-subject <providerId>
814816

815817
</CommandTable>
816818

819+
**Options**
820+
821+
<CommandTable>
822+
823+
| Option | Required | Description |
824+
| --- | --- | --- |
825+
| `--subject <subject>` | No | Renew the proof for a subject Sim issued to you earlier, instead of issuing a new one. |
826+
827+
</CommandTable>
828+
817829
Keyless (workload identity) credentials take two steps.
818830

819831
Step 1: run `sim credentials keyless-subject <providerId> --output json` and configure your cloud to trust the printed issuer, audience, and subject. Its requiredConfigFields lists the values your provider's keylessConfig still needs.
@@ -822,7 +834,9 @@ The printed audience is the default. To have Sim sign tokens for your own audien
822834

823835
Step 2: add those values to keylessConfig and pass it to `sim credentials create <providerId> --credentials @file`.
824836

825-
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
837+
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. Sim holds the subject for you for 30 days until a credential saves it, so a trust configuration that takes longer to apply still works: renew the proof with `sim credentials keyless-subject <providerId> --subject <subject>`. The subject stays the same, and each renewal restarts the 30 days. Sim holds your 20 newest unsaved subjects per provider in a workspace; issuing more drops the oldest.
838+
839+
If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, renew the proof and retry. If it reports WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
826840

827841
**Examples**
828842

‎apps/docs/content/docs/integrations/aws-credentials.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ aws iam add-client-id-to-open-id-connect-provider \
6161
A provider holds up to 100 audiences. Once no role relies on `sts.amazonaws.com` any more, you can remove it from the provider. Reconnecting the credential keeps its audience; clearing the field returns it to the default.
6262

6363
<Callout type="info">
64-
The subject is unique to the credential. Reconnecting a keyless credential keeps its subject by default, so the role's trust policy keeps working; choose **Issue a new subject** only if you also update the trust policy.
64+
The subject is unique to the credential once it is saved. Reconnecting a keyless credential keeps its subject by default, so the role's trust policy keeps working; choose **Issue a new subject** only if you also update the trust policy.
6565
</Callout>
6666

6767
### From the API or CLI [#keyless-api-cli]
6868

69-
Run `sim credentials keyless-subject aws-service-account`, trust the printed subject as above, then add `roleArn` (optionally `stsRegion`, `sessionDurationSeconds`, and `audience`) to its `keylessConfig` and pass it to `sim credentials create aws-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it.
69+
Run `sim credentials keyless-subject aws-service-account`, trust the printed subject as above, then add `roleArn` (optionally `stsRegion`, `sessionDurationSeconds`, and `audience`) to its `keylessConfig` and pass it to `sim credentials create aws-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it. Sim holds an unsaved subject for you for 30 days, so a trust configuration that takes longer to apply still works: reopening the connect dialog offers the same subject, and `--subject <subject>` renews its proof from the CLI.
7070

7171
## Use access keys
7272

‎apps/docs/content/docs/integrations/databricks-credentials.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Databricks accepts any non-empty audience; Sim takes up to 255 letters, digits,
5050

5151
### From the API or CLI [#keyless-api-cli]
5252

53-
Run `sim credentials keyless-subject databricks-service-account`, trust the printed subject as above, then add `host` and `clientId` (and optionally `audience`) to its `keylessConfig` and pass it to `sim credentials create databricks-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it.
53+
Run `sim credentials keyless-subject databricks-service-account`, trust the printed subject as above, then add `host` and `clientId` (and optionally `audience`) to its `keylessConfig` and pass it to `sim credentials create databricks-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it. Sim holds an unsaved subject for you for 30 days, so a trust configuration that takes longer to apply still works: reopening the connect dialog offers the same subject, and `--subject <subject>` renews its proof from the CLI.
5454

5555
## Self-hosted deployments
5656

‎apps/docs/content/docs/integrations/google-service-account.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ Self-hosted deployments need `WORKLOAD_IDENTITY_SIGNING_KEY` set and an `https`
247247

248248
### From the API or CLI [#keyless-api-cli]
249249

250-
Run `sim credentials keyless-subject google-service-account`, trust the printed subject as above, then add `projectNumber`, `poolId`, `providerId`, and `serviceAccountEmail` (and optionally `audience`) to its `keylessConfig` and pass it to `sim credentials create google-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it. For domain-wide delegation, also add `"delegation": {"user": "alice@yourcompany.com", "services": ["gmail", "google-drive"]}`, listing any of `gmail`, `google-drive`, `google-docs`, `google-sheets`, and `google-calendar`.
250+
Run `sim credentials keyless-subject google-service-account`, trust the printed subject as above, then add `projectNumber`, `poolId`, `providerId`, and `serviceAccountEmail` (and optionally `audience`) to its `keylessConfig` and pass it to `sim credentials create google-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it. Sim holds an unsaved subject for you for 30 days, so a trust configuration that takes longer to apply still works: reopening the connect dialog offers the same subject, and `--subject <subject>` renews its proof from the CLI. For domain-wide delegation, also add `"delegation": {"user": "alice@yourcompany.com", "services": ["gmail", "google-drive"]}`, listing any of `gmail`, `google-drive`, `google-docs`, `google-sheets`, and `google-calendar`.
251251

252252
### Keyless domain-wide delegation [#keyless-domain-wide-delegation]
253253

‎apps/docs/content/docs/integrations/microsoft-app-credentials.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ An app can have up to 20 federated credentials. Each Sim credential has its own
7575

7676
### From the API or CLI [#keyless-api-cli]
7777

78-
Run `sim credentials keyless-subject microsoft-app-service-account`, trust the printed subject as above, then add `tenantId` and `clientId` (optionally `environmentUrl`, `cloud` as `usgov`, `usgov_dod`, or `china`, and `audience` for a [custom audience](#custom-audience)) to its `keylessConfig` and pass it to `sim credentials create microsoft-app-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it.
78+
Run `sim credentials keyless-subject microsoft-app-service-account`, trust the printed subject as above, then add `tenantId` and `clientId` (optionally `environmentUrl`, `cloud` as `usgov`, `usgov_dod`, or `china`, and `audience` for a [custom audience](#custom-audience)) to its `keylessConfig` and pass it to `sim credentials create microsoft-app-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it. Sim holds an unsaved subject for you for 30 days, so a trust configuration that takes longer to apply still works: reopening the connect dialog offers the same subject, and `--subject <subject>` renews its proof from the CLI.
7979

8080
## Use a client secret or certificate
8181

‎apps/docs/content/docs/integrations/snowflake-service-account.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Snowflake requires each issuer and subject pair to be unique in an account, and
5858

5959
### From the API or CLI [#keyless-api-cli]
6060

61-
Run `sim credentials keyless-subject snowflake-service-account`, trust the printed subject as above, then add `host` (and `audience`, if you listed one in `OIDC_AUDIENCE_LIST`) to its `keylessConfig` and pass it to `sim credentials create snowflake-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it.
61+
Run `sim credentials keyless-subject snowflake-service-account`, trust the printed subject as above, then add `host` (and `audience`, if you listed one in `OIDC_AUDIENCE_LIST`) to its `keylessConfig` and pass it to `sim credentials create snowflake-service-account`. See [the CLI credentials reference](/cli/credentials) for the full two-step example; the proof expires after 24 hours and works only for the user who requested it. Sim holds an unsaved subject for you for 30 days, so a trust configuration that takes longer to apply still works: reopening the connect dialog offers the same subject, and `--subject <subject>` renews its proof from the CLI.
6262

6363
### Self-hosted deployments
6464

0 commit comments

Comments
 (0)