@oatscenter/trellis 0.100.0-rc.11 → 0.100.0-rc.13

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.
Files changed (37) hide show
  1. package/auth/browser/oauth.js +1 -1
  2. package/auth/oauth_core.d.ts +2 -0
  3. package/auth/oauth_core.js +6 -1
  4. package/auth/protocol_wasm/client/trellis_protocol_wasm_bg.wasm +0 -0
  5. package/auth/protocol_wasm/provider/trellis_protocol_wasm_bg.wasm +0 -0
  6. package/internal_sdk/generated/apis/auth/mod.d.ts +73 -1
  7. package/internal_sdk/generated/apis/auth/mod.js +89 -5
  8. package/internal_sdk/generated/apis/core/mod.js +4 -4
  9. package/internal_sdk/generated/apis/events/mod.js +4 -4
  10. package/internal_sdk/generated/apis/health/mod.js +4 -4
  11. package/internal_sdk/generated/apis/jobs/mod.js +4 -4
  12. package/internal_sdk/generated/apis/state/mod.js +4 -4
  13. package/internal_sdk/generated/apps/cli/mod.d.ts +30 -0
  14. package/internal_sdk/generated/apps/cli/mod.js +36 -0
  15. package/internal_sdk/generated/apps/console/mod.d.ts +30 -0
  16. package/internal_sdk/generated/apps/console/mod.js +36 -0
  17. package/internal_sdk/generated/package.json +2 -2
  18. package/internal_sdk/generated/participants/eventsRuntime/mod.d.ts +6 -0
  19. package/internal_sdk/generated/participants/eventsRuntime/mod.js +10 -4
  20. package/internal_sdk/generated/participants/healthRuntime/mod.js +4 -4
  21. package/internal_sdk/generated/participants/jobsRuntime/mod.d.ts +6 -0
  22. package/internal_sdk/generated/participants/jobsRuntime/mod.js +10 -4
  23. package/internal_sdk/generated/participants/platform/mod.d.ts +7 -1
  24. package/internal_sdk/generated/participants/platform/mod.js +12 -6
  25. package/internal_sdk/generated/types/_internal/p0.d.ts +115 -0
  26. package/internal_sdk/generated/types/_internal/p0.js +59 -1
  27. package/internal_sdk/generated/types/index.d.ts +22 -0
  28. package/internal_sdk/generated/types/index.js +11 -0
  29. package/live/client_open.js +4 -1
  30. package/native/custody.d.ts +2 -0
  31. package/native/custody.js +7 -0
  32. package/native/discovery.d.ts +2 -0
  33. package/native/discovery.js +5 -1
  34. package/native/oauth.js +44 -22
  35. package/package.json +2 -2
  36. package/service/runtime/service.js +5 -1
  37. package/session.d.ts +1 -0
@@ -320,7 +320,7 @@ export class BrowserOAuthClient {
320
320
  // Neither unsigned NATS errors nor transient HTTP failures delete the durable grant/key.
321
321
  if (!response.ok)
322
322
  return err(new AuthError({
323
- reason: response.status >= 500
323
+ reason: response.status >= 500 || response.status === 429
324
324
  ? "OAuthUnavailable"
325
325
  : "OAuthRecoveryRequired",
326
326
  }));
@@ -24,6 +24,8 @@ export type TokenResponse = Readonly<{
24
24
  /** The latest server nonce, for the next request to the same endpoint. */
25
25
  nonce?: string;
26
26
  }>;
27
+ /** One bounded `DPoP-Nonce` value, or undefined. @internal */
28
+ export declare function usableNonce(value: string | null): string | undefined;
27
29
  /**
28
30
  * POST a DPoP-bound form, answering a `use_dpop_nonce` challenge. Each attempt
29
31
  * signs a fresh proof; a challenge precedes any artifact consumption, so the
@@ -60,7 +60,8 @@ export async function createDpopProof(key, endpoint, runtimeId, sessionPublicKey
60
60
  const signature = new Uint8Array(await key.sign(new Uint8Array(toArrayBuffer(utf8(input)))));
61
61
  return `${input}.${base64urlEncode(signature)}`;
62
62
  }
63
- function usableNonce(value) {
63
+ /** One bounded `DPoP-Nonce` value, or undefined. @internal */
64
+ export function usableNonce(value) {
64
65
  return value && value.length <= 1024 && !value.includes(",")
65
66
  ? value
66
67
  : undefined;
@@ -82,6 +83,10 @@ export async function postWithDpop(options) {
82
83
  redirect: "error",
83
84
  signal: options.signal,
84
85
  });
86
+ // A rate limiter, often a proxy, refuses before reading the request and
87
+ // need not send a JSON body.
88
+ if (response.status === 429)
89
+ return { status: 429, ok: false, data: undefined };
85
90
  const data = await boundedJson(response);
86
91
  const challenge = usableNonce(response.headers.get("DPoP-Nonce"));
87
92
  const asksForNonce = response.status === 400 &&
@@ -129,6 +129,8 @@ export type OAuthClientsListInput = Types0.AuthPageRequest;
129
129
  export type OAuthClientsListOutput = Types0.AuthOAuthClientsListResponse;
130
130
  export type OAuthClientsPutInput = Types0.AuthOAuthClientPutRequest;
131
131
  export type OAuthClientsPutOutput = Types0.AuthOAuthClientGetResponse;
132
+ export type OAuthClientsSignUpUpdateInput = Types0.AuthOAuthClientSignUpUpdateRequest;
133
+ export type OAuthClientsSignUpUpdateOutput = Types0.AuthOAuthClientGetResponse;
132
134
  export type OIDCProvidersDeleteInput = Types0.AuthOIDCProviderMutationRequest;
133
135
  export type OIDCProvidersDeleteOutput = Types0.AuthMutationResult;
134
136
  export type OIDCProvidersDisableInput = Types0.AuthOIDCProviderMutationRequest;
@@ -177,6 +179,12 @@ export type RolesListInput = Types0.AuthPageRequest;
177
179
  export type RolesListOutput = Types0.AuthRolesListResponse;
178
180
  export type RolesPutInput = Types0.AuthRolePutRequest;
179
181
  export type RolesPutOutput = Types0.AuthRolePutResponse;
182
+ export type ServiceClaimsCreateInput = Types0.AuthServiceClaimCreateRequest;
183
+ export type ServiceClaimsCreateOutput = Types0.AuthServiceClaimResponse;
184
+ export type ServiceClaimsListInput = Types0.AuthPageRequest;
185
+ export type ServiceClaimsListOutput = Types0.AuthServiceClaimsListResponse;
186
+ export type ServiceClaimsRemoveInput = Types0.AuthServiceClaimRemoveRequest;
187
+ export type ServiceClaimsRemoveOutput = Types0.AuthServiceClaimResponse;
180
188
  export type ServiceInstancesDisableInput = Types0.AuthInstanceMutationRequest;
181
189
  export type ServiceInstancesDisableOutput = Types0.AuthInstanceMutationResponse;
182
190
  export type ServiceInstancesEnableInput = Types0.AuthInstanceMutationRequest;
@@ -205,6 +213,10 @@ export type SessionsMeInput = Types0.AuthEmpty;
205
213
  export type SessionsMeOutput = Types0.AuthSessionsMeResponse;
206
214
  export type SessionsRevokeInput = Types0.AuthLoginRevokeRequest;
207
215
  export type SessionsRevokeOutput = Types0.AuthMutationResult;
216
+ export type SignInSettingsGetInput = Types0.AuthEmpty;
217
+ export type SignInSettingsGetOutput = Types0.AuthSignInSettingsGetResponse;
218
+ export type SignInSettingsUpdateInput = Types0.AuthSignInSettingsUpdateRequest;
219
+ export type SignInSettingsUpdateOutput = Types0.AuthSignInSettingsGetResponse;
208
220
  export type UserIdentitiesListInput = Types0.AuthPageRequest;
209
221
  export type UserIdentitiesListOutput = Types0.AuthUserIdentitiesListResponse;
210
222
  export type UserIdentitiesUnlinkInput = Types0.AuthUserIdentityUnlinkRequest;
@@ -676,6 +688,16 @@ declare const __api: {
676
688
  readonly download: false;
677
689
  readonly pagination: undefined;
678
690
  };
691
+ readonly "rpc:OAuthClients.SignUp.Update": {
692
+ readonly kind: "rpc";
693
+ readonly descriptorName: "rpc:OAuthClients.SignUp.Update";
694
+ readonly subject: "rpc.v1.auth.OAuthClients.SignUp.Update";
695
+ readonly input: typeof Types0.AuthOAuthClientSignUpUpdateRequestCodec;
696
+ readonly output: typeof Types0.AuthOAuthClientGetResponseCodec;
697
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
698
+ readonly download: false;
699
+ readonly pagination: undefined;
700
+ };
679
701
  readonly "rpc:OIDCProviders.Delete": {
680
702
  readonly kind: "rpc";
681
703
  readonly descriptorName: "rpc:OIDCProviders.Delete";
@@ -916,6 +938,36 @@ declare const __api: {
916
938
  readonly download: false;
917
939
  readonly pagination: undefined;
918
940
  };
941
+ readonly "rpc:ServiceClaims.Create": {
942
+ readonly kind: "rpc";
943
+ readonly descriptorName: "rpc:ServiceClaims.Create";
944
+ readonly subject: "rpc.v1.auth.ServiceClaims.Create";
945
+ readonly input: typeof Types0.AuthServiceClaimCreateRequestCodec;
946
+ readonly output: typeof Types0.AuthServiceClaimResponseCodec;
947
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
948
+ readonly download: false;
949
+ readonly pagination: undefined;
950
+ };
951
+ readonly "rpc:ServiceClaims.List": {
952
+ readonly kind: "rpc";
953
+ readonly descriptorName: "rpc:ServiceClaims.List";
954
+ readonly subject: "rpc.v1.auth.ServiceClaims.List";
955
+ readonly input: typeof Types0.AuthPageRequestCodec;
956
+ readonly output: typeof Types0.AuthServiceClaimsListResponseCodec;
957
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
958
+ readonly download: false;
959
+ readonly pagination: "cursor";
960
+ };
961
+ readonly "rpc:ServiceClaims.Remove": {
962
+ readonly kind: "rpc";
963
+ readonly descriptorName: "rpc:ServiceClaims.Remove";
964
+ readonly subject: "rpc.v1.auth.ServiceClaims.Remove";
965
+ readonly input: typeof Types0.AuthServiceClaimRemoveRequestCodec;
966
+ readonly output: typeof Types0.AuthServiceClaimResponseCodec;
967
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
968
+ readonly download: false;
969
+ readonly pagination: undefined;
970
+ };
919
971
  readonly "rpc:ServiceInstances.Disable": {
920
972
  readonly kind: "rpc";
921
973
  readonly descriptorName: "rpc:ServiceInstances.Disable";
@@ -1056,6 +1108,26 @@ declare const __api: {
1056
1108
  readonly download: false;
1057
1109
  readonly pagination: undefined;
1058
1110
  };
1111
+ readonly "rpc:SignInSettings.Get": {
1112
+ readonly kind: "rpc";
1113
+ readonly descriptorName: "rpc:SignInSettings.Get";
1114
+ readonly subject: "rpc.v1.auth.SignInSettings.Get";
1115
+ readonly input: typeof Types0.AuthEmptyCodec;
1116
+ readonly output: typeof Types0.AuthSignInSettingsGetResponseCodec;
1117
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
1118
+ readonly download: false;
1119
+ readonly pagination: undefined;
1120
+ };
1121
+ readonly "rpc:SignInSettings.Update": {
1122
+ readonly kind: "rpc";
1123
+ readonly descriptorName: "rpc:SignInSettings.Update";
1124
+ readonly subject: "rpc.v1.auth.SignInSettings.Update";
1125
+ readonly input: typeof Types0.AuthSignInSettingsUpdateRequestCodec;
1126
+ readonly output: typeof Types0.AuthSignInSettingsGetResponseCodec;
1127
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
1128
+ readonly download: false;
1129
+ readonly pagination: undefined;
1130
+ };
1059
1131
  readonly "rpc:UserIdentities.List": {
1060
1132
  readonly kind: "rpc";
1061
1133
  readonly descriptorName: "rpc:UserIdentities.List";
@@ -1212,5 +1284,5 @@ declare const __api: {
1212
1284
  readonly packageEvidence: unknown;
1213
1285
  };
1214
1286
  export declare const API: typeof __api;
1215
- export declare const API_DIGEST: "WzpxmqMpZNHJ_15SLODVcu-eczYCXVqXwbDU_6HXDi4";
1287
+ export declare const API_DIGEST: "uM8Y6i7t1gm03ht85KqBru_NvY0eKJsS3Lm49xmLQEs";
1216
1288
  export {};