@oatscenter/trellis 0.100.0-rc.10 → 0.100.0-rc.12

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 (33) 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/internal_sdk/generated/apis/auth/mod.d.ts +37 -1
  5. package/internal_sdk/generated/apis/auth/mod.js +47 -5
  6. package/internal_sdk/generated/apis/core/mod.js +4 -4
  7. package/internal_sdk/generated/apis/events/mod.js +4 -4
  8. package/internal_sdk/generated/apis/health/mod.js +4 -4
  9. package/internal_sdk/generated/apis/jobs/mod.js +4 -4
  10. package/internal_sdk/generated/apis/state/mod.js +4 -4
  11. package/internal_sdk/generated/apps/cli/mod.d.ts +15 -0
  12. package/internal_sdk/generated/apps/cli/mod.js +18 -0
  13. package/internal_sdk/generated/apps/console/mod.d.ts +15 -0
  14. package/internal_sdk/generated/apps/console/mod.js +18 -0
  15. package/internal_sdk/generated/package.json +2 -2
  16. package/internal_sdk/generated/participants/eventsRuntime/mod.d.ts +3 -0
  17. package/internal_sdk/generated/participants/eventsRuntime/mod.js +7 -4
  18. package/internal_sdk/generated/participants/healthRuntime/mod.js +4 -4
  19. package/internal_sdk/generated/participants/jobsRuntime/mod.d.ts +3 -0
  20. package/internal_sdk/generated/participants/jobsRuntime/mod.js +7 -4
  21. package/internal_sdk/generated/participants/platform/mod.d.ts +4 -1
  22. package/internal_sdk/generated/participants/platform/mod.js +9 -6
  23. package/internal_sdk/generated/types/_internal/p0.d.ts +52 -0
  24. package/internal_sdk/generated/types/_internal/p0.js +25 -0
  25. package/internal_sdk/generated/types/index.d.ts +10 -0
  26. package/internal_sdk/generated/types/index.js +5 -0
  27. package/live/client_open.js +4 -1
  28. package/native/custody.d.ts +2 -0
  29. package/native/custody.js +7 -0
  30. package/native/discovery.d.ts +2 -0
  31. package/native/discovery.js +5 -1
  32. package/native/oauth.js +44 -22
  33. package/package.json +2 -2
@@ -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;
@@ -205,6 +207,10 @@ export type SessionsMeInput = Types0.AuthEmpty;
205
207
  export type SessionsMeOutput = Types0.AuthSessionsMeResponse;
206
208
  export type SessionsRevokeInput = Types0.AuthLoginRevokeRequest;
207
209
  export type SessionsRevokeOutput = Types0.AuthMutationResult;
210
+ export type SignInSettingsGetInput = Types0.AuthEmpty;
211
+ export type SignInSettingsGetOutput = Types0.AuthSignInSettingsGetResponse;
212
+ export type SignInSettingsUpdateInput = Types0.AuthSignInSettingsUpdateRequest;
213
+ export type SignInSettingsUpdateOutput = Types0.AuthSignInSettingsGetResponse;
208
214
  export type UserIdentitiesListInput = Types0.AuthPageRequest;
209
215
  export type UserIdentitiesListOutput = Types0.AuthUserIdentitiesListResponse;
210
216
  export type UserIdentitiesUnlinkInput = Types0.AuthUserIdentityUnlinkRequest;
@@ -676,6 +682,16 @@ declare const __api: {
676
682
  readonly download: false;
677
683
  readonly pagination: undefined;
678
684
  };
685
+ readonly "rpc:OAuthClients.SignUp.Update": {
686
+ readonly kind: "rpc";
687
+ readonly descriptorName: "rpc:OAuthClients.SignUp.Update";
688
+ readonly subject: "rpc.v1.auth.OAuthClients.SignUp.Update";
689
+ readonly input: typeof Types0.AuthOAuthClientSignUpUpdateRequestCodec;
690
+ readonly output: typeof Types0.AuthOAuthClientGetResponseCodec;
691
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
692
+ readonly download: false;
693
+ readonly pagination: undefined;
694
+ };
679
695
  readonly "rpc:OIDCProviders.Delete": {
680
696
  readonly kind: "rpc";
681
697
  readonly descriptorName: "rpc:OIDCProviders.Delete";
@@ -1056,6 +1072,26 @@ declare const __api: {
1056
1072
  readonly download: false;
1057
1073
  readonly pagination: undefined;
1058
1074
  };
1075
+ readonly "rpc:SignInSettings.Get": {
1076
+ readonly kind: "rpc";
1077
+ readonly descriptorName: "rpc:SignInSettings.Get";
1078
+ readonly subject: "rpc.v1.auth.SignInSettings.Get";
1079
+ readonly input: typeof Types0.AuthEmptyCodec;
1080
+ readonly output: typeof Types0.AuthSignInSettingsGetResponseCodec;
1081
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
1082
+ readonly download: false;
1083
+ readonly pagination: undefined;
1084
+ };
1085
+ readonly "rpc:SignInSettings.Update": {
1086
+ readonly kind: "rpc";
1087
+ readonly descriptorName: "rpc:SignInSettings.Update";
1088
+ readonly subject: "rpc.v1.auth.SignInSettings.Update";
1089
+ readonly input: typeof Types0.AuthSignInSettingsUpdateRequestCodec;
1090
+ readonly output: typeof Types0.AuthSignInSettingsGetResponseCodec;
1091
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
1092
+ readonly download: false;
1093
+ readonly pagination: undefined;
1094
+ };
1059
1095
  readonly "rpc:UserIdentities.List": {
1060
1096
  readonly kind: "rpc";
1061
1097
  readonly descriptorName: "rpc:UserIdentities.List";
@@ -1212,5 +1248,5 @@ declare const __api: {
1212
1248
  readonly packageEvidence: unknown;
1213
1249
  };
1214
1250
  export declare const API: typeof __api;
1215
- export declare const API_DIGEST: "WzpxmqMpZNHJ_15SLODVcu-eczYCXVqXwbDU_6HXDi4";
1251
+ export declare const API_DIGEST: "WIFkjJqL0kGo4gCb0d8BC3r4pY2Pehw7usNB3fP73bs";
1216
1252
  export {};