@ora-ai/cli 0.23.0 → 0.24.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.
Files changed (184) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +44 -13
  3. package/dist/agent-skills/skills-command.d.ts.map +1 -1
  4. package/dist/agent-skills/skills-command.js +2 -2
  5. package/dist/agent-skills/skills-command.js.map +1 -1
  6. package/dist/auth-commands.d.ts +25 -9
  7. package/dist/auth-commands.d.ts.map +1 -1
  8. package/dist/auth-commands.js +59 -49
  9. package/dist/auth-commands.js.map +1 -1
  10. package/dist/core/auth.d.ts +2 -2
  11. package/dist/core/auth.d.ts.map +1 -1
  12. package/dist/core/auth.js +5 -4
  13. package/dist/core/auth.js.map +1 -1
  14. package/dist/core/config.d.ts +10 -5
  15. package/dist/core/config.d.ts.map +1 -1
  16. package/dist/core/config.js +10 -7
  17. package/dist/core/config.js.map +1 -1
  18. package/dist/core/credentials/api-key-credential.d.ts +29 -0
  19. package/dist/core/credentials/api-key-credential.d.ts.map +1 -0
  20. package/dist/core/credentials/api-key-credential.js +58 -0
  21. package/dist/core/credentials/api-key-credential.js.map +1 -0
  22. package/dist/core/credentials/ci-oidc-credential.d.ts +44 -0
  23. package/dist/core/credentials/ci-oidc-credential.d.ts.map +1 -0
  24. package/dist/core/credentials/ci-oidc-credential.js +82 -0
  25. package/dist/core/credentials/ci-oidc-credential.js.map +1 -0
  26. package/dist/core/credentials/credential-chain.d.ts +25 -0
  27. package/dist/core/credentials/credential-chain.d.ts.map +1 -0
  28. package/dist/core/credentials/credential-chain.js +39 -0
  29. package/dist/core/credentials/credential-chain.js.map +1 -0
  30. package/dist/core/credentials/credential.d.ts +73 -0
  31. package/dist/core/credentials/credential.d.ts.map +1 -0
  32. package/dist/core/credentials/credential.js +9 -0
  33. package/dist/core/credentials/credential.js.map +1 -0
  34. package/dist/core/credentials/device-session-credential.d.ts +27 -0
  35. package/dist/core/credentials/device-session-credential.d.ts.map +1 -0
  36. package/dist/core/credentials/device-session-credential.js +78 -0
  37. package/dist/core/credentials/device-session-credential.js.map +1 -0
  38. package/dist/core/credentials/identity-lines.d.ts +14 -0
  39. package/dist/core/credentials/identity-lines.d.ts.map +1 -0
  40. package/dist/core/credentials/identity-lines.js +45 -0
  41. package/dist/core/credentials/identity-lines.js.map +1 -0
  42. package/dist/core/credentials/refusal-words.d.ts +15 -0
  43. package/dist/core/credentials/refusal-words.d.ts.map +1 -0
  44. package/dist/core/credentials/refusal-words.js +56 -0
  45. package/dist/core/credentials/refusal-words.js.map +1 -0
  46. package/dist/core/credentials/sign-in-areas.d.ts +18 -0
  47. package/dist/core/credentials/sign-in-areas.d.ts.map +1 -0
  48. package/dist/core/credentials/sign-in-areas.js +22 -0
  49. package/dist/core/credentials/sign-in-areas.js.map +1 -0
  50. package/dist/core/http.d.ts +10 -4
  51. package/dist/core/http.d.ts.map +1 -1
  52. package/dist/core/http.js +7 -5
  53. package/dist/core/http.js.map +1 -1
  54. package/dist/core/identity.d.ts +11 -0
  55. package/dist/core/identity.d.ts.map +1 -0
  56. package/dist/core/identity.js +21 -0
  57. package/dist/core/identity.js.map +1 -0
  58. package/dist/core/login.d.ts +5 -3
  59. package/dist/core/login.d.ts.map +1 -1
  60. package/dist/core/login.js +5 -3
  61. package/dist/core/login.js.map +1 -1
  62. package/dist/core/oauth/metadata.d.ts +24 -0
  63. package/dist/core/oauth/metadata.d.ts.map +1 -0
  64. package/dist/core/oauth/metadata.js +99 -0
  65. package/dist/core/oauth/metadata.js.map +1 -0
  66. package/dist/core/oauth/oauth-client.d.ts +70 -0
  67. package/dist/core/oauth/oauth-client.d.ts.map +1 -0
  68. package/dist/core/oauth/oauth-client.js +136 -0
  69. package/dist/core/oauth/oauth-client.js.map +1 -0
  70. package/dist/core/oauth/oauth-error.d.ts +18 -0
  71. package/dist/core/oauth/oauth-error.d.ts.map +1 -0
  72. package/dist/core/oauth/oauth-error.js +31 -0
  73. package/dist/core/oauth/oauth-error.js.map +1 -0
  74. package/dist/core/oauth/sign-in-error.d.ts +15 -0
  75. package/dist/core/oauth/sign-in-error.d.ts.map +1 -0
  76. package/dist/core/oauth/sign-in-error.js +21 -0
  77. package/dist/core/oauth/sign-in-error.js.map +1 -0
  78. package/dist/core/oauth/sign-in-target.d.ts +31 -0
  79. package/dist/core/oauth/sign-in-target.d.ts.map +1 -0
  80. package/dist/core/oauth/sign-in-target.js +44 -0
  81. package/dist/core/oauth/sign-in-target.js.map +1 -0
  82. package/dist/core/output.d.ts +14 -3
  83. package/dist/core/output.d.ts.map +1 -1
  84. package/dist/core/output.js +35 -31
  85. package/dist/core/output.js.map +1 -1
  86. package/dist/core/retry-after.d.ts +8 -0
  87. package/dist/core/retry-after.d.ts.map +1 -0
  88. package/dist/core/retry-after.js +18 -0
  89. package/dist/core/retry-after.js.map +1 -0
  90. package/dist/core/run-operation.d.ts +23 -9
  91. package/dist/core/run-operation.d.ts.map +1 -1
  92. package/dist/core/run-operation.js +25 -14
  93. package/dist/core/run-operation.js.map +1 -1
  94. package/dist/core/session/device-session-auth.d.ts +29 -0
  95. package/dist/core/session/device-session-auth.d.ts.map +1 -0
  96. package/dist/core/session/device-session-auth.js +92 -0
  97. package/dist/core/session/device-session-auth.js.map +1 -0
  98. package/dist/core/session/file-lock.d.ts +33 -0
  99. package/dist/core/session/file-lock.d.ts.map +1 -0
  100. package/dist/core/session/file-lock.js +145 -0
  101. package/dist/core/session/file-lock.js.map +1 -0
  102. package/dist/core/session/session-refusals.d.ts +22 -0
  103. package/dist/core/session/session-refusals.d.ts.map +1 -0
  104. package/dist/core/session/session-refusals.js +23 -0
  105. package/dist/core/session/session-refusals.js.map +1 -0
  106. package/dist/core/session/session-store.d.ts +53 -0
  107. package/dist/core/session/session-store.d.ts.map +1 -0
  108. package/dist/core/session/session-store.js +71 -0
  109. package/dist/core/session/session-store.js.map +1 -0
  110. package/dist/core/sign-in.d.ts +2 -2
  111. package/dist/core/sign-in.js +2 -2
  112. package/dist/core/token-expiry.d.ts +9 -0
  113. package/dist/core/token-expiry.d.ts.map +1 -0
  114. package/dist/core/token-expiry.js +11 -0
  115. package/dist/core/token-expiry.js.map +1 -0
  116. package/dist/core/url.d.ts +5 -0
  117. package/dist/core/url.d.ts.map +1 -0
  118. package/dist/core/url.js +17 -0
  119. package/dist/core/url.js.map +1 -0
  120. package/dist/generated/operations.d.ts +1 -1
  121. package/dist/generated/operations.js +2 -2
  122. package/dist/generated/types.d.ts +289 -0
  123. package/dist/generated/types.d.ts.map +1 -1
  124. package/dist/generated/types.js +1 -1
  125. package/dist/interactive/menu.d.ts.map +1 -1
  126. package/dist/interactive/menu.js +4 -2
  127. package/dist/interactive/menu.js.map +1 -1
  128. package/dist/interactive/session.d.ts.map +1 -1
  129. package/dist/interactive/session.js +13 -6
  130. package/dist/interactive/session.js.map +1 -1
  131. package/dist/login/browser-opener.d.ts +20 -0
  132. package/dist/login/browser-opener.d.ts.map +1 -0
  133. package/dist/login/browser-opener.js +43 -0
  134. package/dist/login/browser-opener.js.map +1 -0
  135. package/dist/login/device-flow.d.ts +60 -0
  136. package/dist/login/device-flow.d.ts.map +1 -0
  137. package/dist/login/device-flow.js +98 -0
  138. package/dist/login/device-flow.js.map +1 -0
  139. package/dist/login/device-login.d.ts +27 -0
  140. package/dist/login/device-login.d.ts.map +1 -0
  141. package/dist/login/device-login.js +148 -0
  142. package/dist/login/device-login.js.map +1 -0
  143. package/dist/login/device-presenter.d.ts +24 -0
  144. package/dist/login/device-presenter.d.ts.map +1 -0
  145. package/dist/login/device-presenter.js +69 -0
  146. package/dist/login/device-presenter.js.map +1 -0
  147. package/dist/login/login-command.d.ts +14 -0
  148. package/dist/login/login-command.d.ts.map +1 -0
  149. package/dist/login/login-command.js +73 -0
  150. package/dist/login/login-command.js.map +1 -0
  151. package/dist/login/login-deps.d.ts +17 -0
  152. package/dist/login/login-deps.d.ts.map +1 -0
  153. package/dist/login/login-deps.js +18 -0
  154. package/dist/login/login-deps.js.map +1 -0
  155. package/dist/login/piped-input.d.ts +23 -0
  156. package/dist/login/piped-input.d.ts.map +1 -0
  157. package/dist/login/piped-input.js +36 -0
  158. package/dist/login/piped-input.js.map +1 -0
  159. package/dist/login/requested-scopes.d.ts +22 -0
  160. package/dist/login/requested-scopes.d.ts.map +1 -0
  161. package/dist/login/requested-scopes.js +43 -0
  162. package/dist/login/requested-scopes.js.map +1 -0
  163. package/dist/program.d.ts +16 -5
  164. package/dist/program.d.ts.map +1 -1
  165. package/dist/program.js +15 -7
  166. package/dist/program.js.map +1 -1
  167. package/dist/study-ci/ci-command.d.ts.map +1 -1
  168. package/dist/study-ci/ci-command.js +2 -2
  169. package/dist/study-ci/ci-command.js.map +1 -1
  170. package/dist/study-ci/ci-rehearse-command.d.ts.map +1 -1
  171. package/dist/study-ci/ci-rehearse-command.js +2 -2
  172. package/dist/study-ci/ci-rehearse-command.js.map +1 -1
  173. package/dist/tunnel/connection-end.d.ts +30 -0
  174. package/dist/tunnel/connection-end.d.ts.map +1 -0
  175. package/dist/tunnel/connection-end.js +29 -0
  176. package/dist/tunnel/connection-end.js.map +1 -0
  177. package/dist/tunnel-command.d.ts.map +1 -1
  178. package/dist/tunnel-command.js +24 -8
  179. package/dist/tunnel-command.js.map +1 -1
  180. package/package.json +3 -2
  181. package/dist/core/credential-sources.d.ts +0 -45
  182. package/dist/core/credential-sources.d.ts.map +0 -1
  183. package/dist/core/credential-sources.js +0 -65
  184. package/dist/core/credential-sources.js.map +0 -1
@@ -0,0 +1,45 @@
1
+ /**
2
+ * How `ora whoami` words an identity, per credential kind. Pure data, carried by the credentials (like their refusal
3
+ * words), so the command prints what the credential says and never asks which kind it is.
4
+ *
5
+ * - An api key prints exactly what it always has — the organization, subject and scopes its traded token claims,
6
+ * and the API that answered. Byte for byte: these lines are a published output scripts read. A token traded by a
7
+ * keyless CI job (the key's own token) adds one `via:` line naming the job.
8
+ * - A browser sign-in also names the organization and the person, and says how they signed in.
9
+ */
10
+ import { sanitizeTerminalText } from "../../render/sanitize.js";
11
+ const organization = (claims) => String(claims.org ?? claims.organizationId ?? "?");
12
+ const subject = (claims) => String(claims.sub ?? "?");
13
+ /** Which CI job signed in, when the token was minted for one (keyless CI sign-in). Display only. */
14
+ function federationLine(federation) {
15
+ if (!federation || typeof federation !== "object")
16
+ return [];
17
+ const { issuer, repository, ref } = federation;
18
+ if (typeof repository !== "string")
19
+ return [];
20
+ return [`via: ${[issuer, repository, ref].filter((part) => typeof part === "string").join(" ")} (keyless CI sign-in)`];
21
+ }
22
+ export const API_KEY_IDENTITY_LINES = (claims, apiUrl) => [
23
+ `org: ${organization(claims)}`,
24
+ `subject: ${subject(claims)}`,
25
+ ...(Array.isArray(claims.scopes) ? [`scopes: ${claims.scopes.join(", ")}`] : []),
26
+ ...federationLine(claims.federation),
27
+ `api: ${apiUrl}`,
28
+ ];
29
+ /**
30
+ * A name or address the API sent, made safe to print: an organization's name is whatever its owner typed, and it is
31
+ * shown in every member's terminal.
32
+ */
33
+ const printed = (value) => sanitizeTerminalText(String(value));
34
+ /** A sign-in's lines; `via` is the credential's own source ("device sign-in"). */
35
+ export function signInIdentityLines(via) {
36
+ return (claims, apiUrl) => [
37
+ `org: ${printed(organization(claims))}${typeof claims.organizationName === "string" ? ` (${printed(claims.organizationName)})` : ""}`,
38
+ `subject: ${printed(subject(claims))}`,
39
+ ...(typeof claims.email === "string" ? [`email: ${printed(claims.email)}`] : []),
40
+ ...(Array.isArray(claims.scopes) ? [`scopes: ${printed(claims.scopes.join(", "))}`] : []),
41
+ `api: ${apiUrl}`,
42
+ `via: ${via}`,
43
+ ];
44
+ }
45
+ //# sourceMappingURL=identity-lines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-lines.js","sourceRoot":"","sources":["../../../src/core/credentials/identity-lines.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAKhE,MAAM,YAAY,GAAG,CAAC,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AC,CAAC;AAEhF,kFAAkF;AAClF,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;QACzB,YAAY,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACzI,YAAY,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE;QACtC,GAAG,CAAC,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAClF,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1F,YAAY,MAAM,EAAE;QACpB,YAAY,GAAG,EAAE;KAClB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * What each credential kind tells the person when the API refuses it. Pure data, carried by the credentials. The
3
+ * advice that follows a refusal is chosen by the refusal's CODE, through first-match tables — never by reading its
4
+ * message, which is the server's (or the sign-in's) own sentence and is printed, not parsed.
5
+ */
6
+ import type { RefusalWords } from "./credential.js";
7
+ /** A row of a first-match table: the first row whose `matches` holds for a refusal's code decides. */
8
+ export interface CodeRule<T> {
9
+ readonly matches: (code: string) => boolean;
10
+ readonly value: T;
11
+ }
12
+ export declare function firstMatch<T>(rules: readonly CodeRule<T>[], code: string, otherwise: T): T;
13
+ export declare const API_KEY_WORDS: RefusalWords;
14
+ export declare const DEVICE_SESSION_WORDS: RefusalWords;
15
+ //# sourceMappingURL=refusal-words.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refusal-words.d.ts","sourceRoot":"","sources":["../../../src/core/credentials/refusal-words.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,sGAAsG;AACtG,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAE1F;AAuBD,eAAO,MAAM,aAAa,EAAE,YAM3B,CAAC;AAcF,eAAO,MAAM,oBAAoB,EAAE,YAalC,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * What each credential kind tells the person when the API refuses it. Pure data, carried by the credentials. The
3
+ * advice that follows a refusal is chosen by the refusal's CODE, through first-match tables — never by reading its
4
+ * message, which is the server's (or the sign-in's) own sentence and is printed, not parsed.
5
+ */
6
+ import { SIGN_IN_AGAIN, isSessionRefusal } from "../session/session-refusals.js";
7
+ import { scopeOfAreaWithoutSignIn } from "./sign-in-areas.js";
8
+ export function firstMatch(rules, code, otherwise) {
9
+ return rules.find((rule) => rule.matches(code))?.value ?? otherwise;
10
+ }
11
+ /** Shown in place of the scopes when a refusal named none and the command declares none. */
12
+ const NO_SCOPE_NAMED = "unknown";
13
+ /** The scopes a refusal is about, as one line. */
14
+ const listed = (missing) => (missing.length > 0 ? missing.join(", ") : NO_SCOPE_NAMED);
15
+ /** What to do about a key's failed sign-in when no rule of its own matches the code. */
16
+ const LOG_IN_WITH_A_VALID_KEY = "Run `ora login` with a valid api key.";
17
+ /**
18
+ * What to do about a key's failed sign-in, by its code. A keyless CI job signs in as a key too, and has no key to log
19
+ * in with, so telling it to `ora login` would send its owner the wrong way.
20
+ */
21
+ const KEY_SIGN_IN_HINTS = [
22
+ { matches: (code) => code === "CI_IDENTITY_UNAVAILABLE", value: "Give the job `permissions: id-token: write`, then run it again." },
23
+ {
24
+ matches: (code) => code.startsWith("CI_"),
25
+ value: "Check that the api key trusts this repository, ref and environment (Settings, API keys, CI sign-in), and that ORA_API_KEY_ID is that key's ID.",
26
+ },
27
+ ];
28
+ export const API_KEY_WORDS = {
29
+ missingScope: (missing) => [
30
+ `This api key is missing the required scope: ${listed(missing)}`,
31
+ "Mint a key with that scope (ora dashboard → Settings → API keys), then `ora login` again.",
32
+ ],
33
+ signedOut: (code, message) => [`Authentication failed (${code}): ${message}`, firstMatch(KEY_SIGN_IN_HINTS, code, LOG_IN_WITH_A_VALID_KEY)],
34
+ };
35
+ /** A sign-in the API (or a tunnel) no longer accepts: it says so, with the code, and how to sign in again. */
36
+ const NO_LONGER_WORKS = (code, message) => [`Your sign-in no longer works (${code}): ${message}`, SIGN_IN_AGAIN];
37
+ /** How a browser sign-in's refusal reads, by its code. */
38
+ const SIGN_IN_REFUSALS = [
39
+ // The sign-in's own refusals are worded where they are thrown (session/session-refusals.ts), what to do included:
40
+ // sign in again, sign in to this API, or retry a command whose sign-in changed while it waited.
41
+ { matches: isSessionRefusal, value: (_code, message) => [message] },
42
+ ];
43
+ export const DEVICE_SESSION_WORDS = {
44
+ // A sign-in holds the permissions the person allowed on the approval page — all the CLI asked for, or fewer.
45
+ // Signing in again is how one more is allowed; a key that already holds it is the other way.
46
+ // A command of an area that takes no sign-in yet (Autopilot) needs a permission `ora login` never asks for:
47
+ // signing in again could not offer it, so the only advice that works is a key.
48
+ missingScope: (missing) => missing.length > 0 && missing.every(scopeOfAreaWithoutSignIn)
49
+ ? [`This command does not take a browser sign-in yet (it needs ${listed(missing)}).`, "Use an api key for it: ora login --api-key"]
50
+ : [
51
+ `Your sign-in doesn't include the permission this needs: ${listed(missing)}`,
52
+ "Run `ora login` again and allow that permission, or use an api key that holds it (ora login --api-key).",
53
+ ],
54
+ signedOut: (code, message) => firstMatch(SIGN_IN_REFUSALS, code, NO_LONGER_WORKS)(code, message),
55
+ };
56
+ //# sourceMappingURL=refusal-words.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refusal-words.js","sourceRoot":"","sources":["../../../src/core/credentials/refusal-words.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAQ9D,MAAM,UAAU,UAAU,CAAI,KAA6B,EAAE,IAAY,EAAE,SAAY;IACrF,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,IAAI,SAAS,CAAC;AACtE,CAAC;AAED,4FAA4F;AAC5F,MAAM,cAAc,GAAG,SAAS,CAAC;AAEjC,kDAAkD;AAClD,MAAM,MAAM,GAAG,CAAC,OAA0B,EAAU,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;AAElH,wFAAwF;AACxF,MAAM,uBAAuB,GAAG,uCAAuC,CAAC;AAExE;;;GAGG;AACH,MAAM,iBAAiB,GAAgC;IACrD,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,yBAAyB,EAAE,KAAK,EAAE,iEAAiE,EAAE;IACnI;QACE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACzC,KAAK,EA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O,CAAC;CACjG,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Areas of the API that do not take a browser sign-in yet. The API refuses one there (403 `SIGN_IN_NOT_SUPPORTED`)
3
+ * and names an api key as the way in.
4
+ *
5
+ * ONE list, read twice, so the two can never disagree:
6
+ * - `ora login` does not ask for these areas' permissions, so the approval page never offers what would not work
7
+ * (login/requested-scopes.ts);
8
+ * - a command there, run with a sign-in, is told to use an api key, and never to "sign in again and allow the
9
+ * permission", which that sign-in could never be offered (refusal-words.ts).
10
+ *
11
+ * An area is the first segment of an operation id (`autopilot.teams.list`) and of its scopes (`autopilot:read`).
12
+ */
13
+ export declare const AREAS_WITHOUT_SIGN_IN: readonly ["autopilot"];
14
+ /** Does an operation take a browser sign-in? One with no id (a bare scope source) does. */
15
+ export declare function operationTakesSignIn(operationId: string | undefined): boolean;
16
+ /** Is this scope one of an area that does not take a browser sign-in? */
17
+ export declare function scopeOfAreaWithoutSignIn(scope: string): boolean;
18
+ //# sourceMappingURL=sign-in-areas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-areas.d.ts","sourceRoot":"","sources":["../../../src/core/credentials/sign-in-areas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,wBAAyB,CAAC;AAE5D,2FAA2F;AAC3F,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE7E;AAED,yEAAyE;AACzE,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE/D"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Areas of the API that do not take a browser sign-in yet. The API refuses one there (403 `SIGN_IN_NOT_SUPPORTED`)
3
+ * and names an api key as the way in.
4
+ *
5
+ * ONE list, read twice, so the two can never disagree:
6
+ * - `ora login` does not ask for these areas' permissions, so the approval page never offers what would not work
7
+ * (login/requested-scopes.ts);
8
+ * - a command there, run with a sign-in, is told to use an api key, and never to "sign in again and allow the
9
+ * permission", which that sign-in could never be offered (refusal-words.ts).
10
+ *
11
+ * An area is the first segment of an operation id (`autopilot.teams.list`) and of its scopes (`autopilot:read`).
12
+ */
13
+ export const AREAS_WITHOUT_SIGN_IN = ["autopilot"];
14
+ /** Does an operation take a browser sign-in? One with no id (a bare scope source) does. */
15
+ export function operationTakesSignIn(operationId) {
16
+ return !AREAS_WITHOUT_SIGN_IN.some((area) => operationId?.startsWith(`${area}.`));
17
+ }
18
+ /** Is this scope one of an area that does not take a browser sign-in? */
19
+ export function scopeOfAreaWithoutSignIn(scope) {
20
+ return AREAS_WITHOUT_SIGN_IN.some((area) => scope === area || scope.startsWith(`${area}:`));
21
+ }
22
+ //# sourceMappingURL=sign-in-areas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-areas.js","sourceRoot":"","sources":["../../../src/core/credentials/sign-in-areas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,WAAW,CAAU,CAAC;AAE5D,2FAA2F;AAC3F,MAAM,UAAU,oBAAoB,CAAC,WAA+B;IAClE,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;AAC9F,CAAC"}
@@ -2,9 +2,10 @@
2
2
  * The one HTTP door for every generated command.
3
3
  *
4
4
  * Auth policy mirrors the platform's createServiceClient: on a 401 the token
5
- * is force-re-exchanged and the request retried EXACTLY once. 5xx is never
6
- * retried — a POST /runs may have been admitted and billed; at-most-once is
7
- * the CLI's promise for mutations.
5
+ * is force-renewed (an api key re-exchanged, a browser sign-in refreshed) and
6
+ * the request retried EXACTLY once. 5xx is never retried — a POST /runs may
7
+ * have been admitted and billed; at-most-once is the CLI's promise for
8
+ * mutations.
8
9
  *
9
10
  * Non-ok responses map to ApiError carrying the platform envelope
10
11
  * {error, code, details?} so output.ts can tell the 402/403 stories — read
@@ -31,7 +32,12 @@ export interface CallOptions {
31
32
  /** The narrow auth port — both members required so a fake-retry can't hide. */
32
33
  export interface TokenSource {
33
34
  getToken(): Promise<string>;
34
- forceRefresh(): Promise<string>;
35
+ /**
36
+ * A new bearer after the API refused one. `rejectedToken` is the bearer it refused: a source that can tell it was
37
+ * already replaced (a sign-in another `ora` process refreshed meanwhile) answers with the newer one instead of
38
+ * renewing twice. A source with nothing to compare (an api key's exchange) ignores it.
39
+ */
40
+ forceRefresh(rejectedToken?: string): Promise<string>;
35
41
  }
36
42
  export interface HttpClientDeps {
37
43
  apiUrl: string;
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/core/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,qBAAa,QAAS,SAAQ,KAAK;IAG/B,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1C,0GAA0G;IAC1G,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO;gBALvB,OAAO,EAAE,MAAM,EACN,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;IAC1C,0GAA0G;IACjG,IAAI,CAAC,EAAE,OAAO,YAAA;CAK1B;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC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the platform's createServiceClient: on a 401 the token
5
- * is force-re-exchanged and the request retried EXACTLY once. 5xx is never
6
- * retried — a POST /runs may have been admitted and billed; at-most-once is
7
- * the CLI's promise for mutations.
5
+ * is force-renewed (an api key re-exchanged, a browser sign-in refreshed) and
6
+ * the request retried EXACTLY once. 5xx is never retried — a POST /runs may
7
+ * have been admitted and billed; at-most-once is the CLI's promise for
8
+ * mutations.
8
9
  *
9
10
  * Non-ok responses map to ApiError carrying the platform envelope
10
11
  * {error, code, details?} so output.ts can tell the 402/403 stories — read
@@ -73,9 +74,10 @@ export class HttpClient {
73
74
  ...(opts.body !== undefined ? { body: JSON.stringify(opts.body) } : {}),
74
75
  ...(opts.signal ? { signal: opts.signal } : {}),
75
76
  });
76
- let res = await attempt(await this.auth.getToken());
77
+ const token = await this.auth.getToken();
78
+ let res = await attempt(token);
77
79
  if (res.status === 401) {
78
- res = await attempt(await this.auth.forceRefresh());
80
+ res = await attempt(await this.auth.forceRefresh(token));
79
81
  }
80
82
  if (!res.ok)
81
83
  throw await toApiError(res);
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/core/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,OAAO,QAAS,SAAQ,KAAK;IAGtB;IACA;IACA;IAEA;IANX,YACE,OAAe,EACN,MAAc,EACd,IAAY,EACZ,OAAiC;IAC1C,0GAA0G;IACjG,IAAc;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QANN,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAA0B;QAEjC,SAAI,GAAJ,IAAI,CAAU;QAGvB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAsBD,MAAM,OAAO,UAAU;IACJ,MAAM,CAAS;IACf,IAAI,CAAc;IAClB,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CAAC,GAAa;IACrC,MAAM,GAAG,GAAY,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxD,yEAAyE;IACzE,2DAA2D;IAC3D,2EAA2E;IAC3E,wEAAwE;IACxE,yEAAyE;IACzE,sEAAsE;IACtE,0EAA0E;IAC1E,wDAAwD;IACxD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACrE,OAAO,IAAI,QAAQ,CACjB,OAAO,IAAI,QAAQ,GAAG,CAAC,MAAM,EAAE,EAC/B,GAAG,CAAC,MAAM,EACV,IAAI,IAAI,YAAY,EACpB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACnD,GAAG,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { HttpClient } from "./http.js";
2
+ /**
3
+ * Who a browser sign-in is: `GET /auth/identity` answers for the credential that asked — the person, their
4
+ * organization and the permissions they approved — and hands out no token. Never decoded from the access token the
5
+ * CLI holds: that token is the sign-in server's, and only the API says what it lets its bearer do.
6
+ *
7
+ * (An api key's identity is read differently — the claims of the token it is traded for — because that is what every
8
+ * Ora answers, old or new: credentials/api-key-credential.ts.)
9
+ */
10
+ export declare function readIdentity(client: Pick<HttpClient, "call">): Promise<Record<string, unknown>>;
11
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/core/identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAIrG"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Who a browser sign-in is: `GET /auth/identity` answers for the credential that asked — the person, their
3
+ * organization and the permissions they approved — and hands out no token. Never decoded from the access token the
4
+ * CLI holds: that token is the sign-in server's, and only the API says what it lets its bearer do.
5
+ *
6
+ * (An api key's identity is read differently — the claims of the token it is traded for — because that is what every
7
+ * Ora answers, old or new: credentials/api-key-credential.ts.)
8
+ */
9
+ export async function readIdentity(client) {
10
+ const result = await client.call({ method: "GET", path: "/auth/identity" });
11
+ if (!isIdentity(result))
12
+ throw new Error("The API returned an invalid identity response.");
13
+ return result;
14
+ }
15
+ function isIdentity(value) {
16
+ if (typeof value !== "object" || value === null || Array.isArray(value))
17
+ return false;
18
+ const identity = value;
19
+ return typeof identity.sub === "string" && typeof identity.organizationId === "string";
20
+ }
21
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/core/identity.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAgC;IACjE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC5E,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAC3F,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACtF,MAAM,QAAQ,GAAG,KAAgC,CAAC;IAClD,OAAO,OAAO,QAAQ,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,QAAQ,CAAC,cAAc,KAAK,QAAQ,CAAC;AACzF,CAAC"}
@@ -1,7 +1,9 @@
1
1
  /**
2
- * Interactive api-key entry. The key is masked while typed and NEVER echoed —
3
- * the one hard rule of the login UX. Non-TTY stdin (pipes) degrades to a plain
4
- * single-line read so `echo $KEY | ora login` works in scripts.
2
+ * Interactive api-key entry (`ora login --api-key` with no value). The key is
3
+ * masked while typed and NEVER echoed — the one hard rule of the login UX.
4
+ * Non-TTY stdin (pipes) degrades to a plain read to the end of stdin so
5
+ * `echo $KEY | ora login --api-key` works in scripts. (A key piped into a
6
+ * bare `ora login` is read by login/piped-input.ts, which prints no prompt.)
5
7
  *
6
8
  * Raw mode delivers a PASTE as one data event carrying the whole string
7
9
  * (possibly with a trailing newline) — never one event per keypress. The
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/core/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,wBAAsB,YAAY,CAChC,KAAK,GAAE,MAAM,CAAC,UAA0B,EACxC,MAAM,GAAE,MAAM,CAAC,WAA4B,GAC1C,OAAO,CAAC,MAAM,CAAC,CA0DjB"}
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/core/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,wBAAsB,YAAY,CAChC,KAAK,GAAE,MAAM,CAAC,UAA0B,EACxC,MAAM,GAAE,MAAM,CAAC,WAA4B,GAC1C,OAAO,CAAC,MAAM,CAAC,CA0DjB"}
@@ -1,7 +1,9 @@
1
1
  /**
2
- * Interactive api-key entry. The key is masked while typed and NEVER echoed —
3
- * the one hard rule of the login UX. Non-TTY stdin (pipes) degrades to a plain
4
- * single-line read so `echo $KEY | ora login` works in scripts.
2
+ * Interactive api-key entry (`ora login --api-key` with no value). The key is
3
+ * masked while typed and NEVER echoed — the one hard rule of the login UX.
4
+ * Non-TTY stdin (pipes) degrades to a plain read to the end of stdin so
5
+ * `echo $KEY | ora login --api-key` works in scripts. (A key piped into a
6
+ * bare `ora login` is read by login/piped-input.ts, which prints no prompt.)
5
7
  *
6
8
  * Raw mode delivers a PASTE as one data event carrying the whole string
7
9
  * (possibly with a trailing newline) — never one event per keypress. The
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/core/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,GAAG,QAAQ,CAAC;AACxB,MAAM,GAAG,GAAG,QAAQ,CAAC;AAErB,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,QAA2B,OAAO,CAAC,KAAK,EACxC,SAA6B,OAAO,CAAC,MAAM;IAE3C,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAEhD,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,IAAI,GAAG,GAAG,EAAE,CAAC;YACb,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAC1B,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;gBACjC,GAAG,IAAI,KAAK,CAAC;YACf,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO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AAC;gBACZ,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpB,CAAC;QACH,CAAC,CAAC;QAEF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Authorization-server metadata (RFC 8414), read from the issuer instead of guessed: the CLI never builds an OAuth
3
+ * endpoint path itself. oidc-provider serves both well-known documents at the issuer root while its endpoints live
4
+ * under `/oauth2`; whichever document answers first wins.
5
+ *
6
+ * RFC 8414 §3.3: the `issuer` a document names MUST equal the issuer it was fetched from, or the document is refused
7
+ * — a mix-up defence, so a token request can never be steered to a server other than the one the person signs in to.
8
+ *
9
+ * When no document can be used, the failure says which of three things happened, because each has its own fix:
10
+ * - nothing is published there (an Ora that predates browser sign-in) → use an api key, which works as before;
11
+ * - a document is published, for ANOTHER issuer → the api url or auth url is not the one that server serves;
12
+ * - the server could not be asked (unreachable, its own error, told to wait) → try again.
13
+ */
14
+ export interface AuthorizationServerMetadata {
15
+ issuer: string;
16
+ tokenEndpoint: string;
17
+ /** Absent when the server does not offer device sign-in (RFC 8628). */
18
+ deviceAuthorizationEndpoint?: string;
19
+ revocationEndpoint?: string;
20
+ }
21
+ /** The metadata a document carries, or null when it is not a usable document for `issuer`. */
22
+ export declare function parseMetadata(body: unknown, issuer: string): AuthorizationServerMetadata | null;
23
+ export declare function discoverMetadata(issuer: string, fetchFn: typeof fetch): Promise<AuthorizationServerMetadata>;
24
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/core/oauth/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AASD,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,2BAA2B,GAAG,IAAI,CAW/F;AA2ED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,GAAG,OAAO,CAAC,2BAA2B,CAAC,CASlH"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Authorization-server metadata (RFC 8414), read from the issuer instead of guessed: the CLI never builds an OAuth
3
+ * endpoint path itself. oidc-provider serves both well-known documents at the issuer root while its endpoints live
4
+ * under `/oauth2`; whichever document answers first wins.
5
+ *
6
+ * RFC 8414 §3.3: the `issuer` a document names MUST equal the issuer it was fetched from, or the document is refused
7
+ * — a mix-up defence, so a token request can never be steered to a server other than the one the person signs in to.
8
+ *
9
+ * When no document can be used, the failure says which of three things happened, because each has its own fix:
10
+ * - nothing is published there (an Ora that predates browser sign-in) → use an api key, which works as before;
11
+ * - a document is published, for ANOTHER issuer → the api url or auth url is not the one that server serves;
12
+ * - the server could not be asked (unreachable, its own error, told to wait) → try again.
13
+ */
14
+ import { isHttpUrl, parseUrl } from "../url.js";
15
+ import { SignInError, signInNotOffered } from "./sign-in-error.js";
16
+ const WELL_KNOWN_PATHS = ["/.well-known/oauth-authorization-server", "/.well-known/openid-configuration"];
17
+ /** How long one document may take. A server that does not answer in time could not be asked ("trouble"). */
18
+ const DISCOVERY_TIMEOUT_MS = 10_000;
19
+ const sameIssuer = (a, b) => a.replace(/\/+$/, "") === b.replace(/\/+$/, "");
20
+ /** The metadata a document carries, or null when it is not a usable document for `issuer`. */
21
+ export function parseMetadata(body, issuer) {
22
+ if (typeof body !== "object" || body === null)
23
+ return null;
24
+ const doc = body;
25
+ if (typeof doc.issuer !== "string" || !sameIssuer(doc.issuer, issuer))
26
+ return null;
27
+ if (!isHttpUrl(doc.token_endpoint))
28
+ return null;
29
+ return {
30
+ issuer: doc.issuer,
31
+ tokenEndpoint: doc.token_endpoint,
32
+ ...(isHttpUrl(doc.device_authorization_endpoint) ? { deviceAuthorizationEndpoint: doc.device_authorization_endpoint } : {}),
33
+ ...(isHttpUrl(doc.revocation_endpoint) ? { revocationEndpoint: doc.revocation_endpoint } : {}),
34
+ };
35
+ }
36
+ /** A 5xx or a 429 is the server's own trouble, not the absence of a document: asking again may well find one. */
37
+ const isTrouble = (status) => status >= 500 || status === 429;
38
+ const isForeign = (miss) => miss.kind === "foreign";
39
+ /** The issuer a body names, when it is a document for some issuer OTHER than the one asked. */
40
+ function foreignIssuer(body, issuer) {
41
+ if (typeof body !== "object" || body === null)
42
+ return null;
43
+ const named = body.issuer;
44
+ return typeof named === "string" && named.length > 0 && !sameIssuer(named, issuer) ? named : null;
45
+ }
46
+ /**
47
+ * A server-sent issuer made safe to print: the URL as the parser serializes it (control characters, spaces and line
48
+ * breaks percent-encoded or dropped — never the raw text a server chose), or a plain phrase when it is no http(s) URL.
49
+ */
50
+ function printable(issuer) {
51
+ const url = parseUrl(issuer);
52
+ if (!url || (url.protocol !== "https:" && url.protocol !== "http:"))
53
+ return "another issuer";
54
+ return url.href.replace(/\/+$/, "").slice(0, 200);
55
+ }
56
+ async function askFor(url, issuer, fetchFn) {
57
+ let res;
58
+ try {
59
+ res = await fetchFn(url, { headers: { accept: "application/json" }, signal: AbortSignal.timeout(DISCOVERY_TIMEOUT_MS) });
60
+ }
61
+ catch {
62
+ return { kind: "trouble" };
63
+ }
64
+ if (!res.ok) {
65
+ // An error response is never read as a document, whatever its body. Its connection is released now, so a
66
+ // "not found" page left unread never holds the process open after the failure is printed.
67
+ await res.body?.cancel().catch(() => undefined);
68
+ return isTrouble(res.status) ? { kind: "trouble" } : { kind: "absent" };
69
+ }
70
+ const body = await res.json().catch(() => null);
71
+ const metadata = parseMetadata(body, issuer);
72
+ if (metadata)
73
+ return { kind: "found", metadata };
74
+ const other = foreignIssuer(body, issuer);
75
+ return other === null ? { kind: "absent" } : { kind: "foreign", issuer: other };
76
+ }
77
+ /** Why no document could be used — the most telling reason first. */
78
+ function discoveryFailure(base, misses) {
79
+ const foreign = misses.find(isForeign);
80
+ if (foreign) {
81
+ return new SignInError(`The sign-in server at ${base} answers for ${printable(foreign.issuer)}, not for ${base}, so it was not used. Check --api-url, or pass --auth-url.`, "AUTH_SERVER_MISMATCH");
82
+ }
83
+ if (misses.some((miss) => miss.kind === "trouble")) {
84
+ return new SignInError(`Could not reach Ora's sign-in server at ${base}. Check --api-url (or set --auth-url), or sign in with an api key: ora login --api-key`, "AUTH_SERVER_UNAVAILABLE");
85
+ }
86
+ return signInNotOffered(base);
87
+ }
88
+ export async function discoverMetadata(issuer, fetchFn) {
89
+ const base = issuer.replace(/\/+$/, "");
90
+ const misses = [];
91
+ for (const path of WELL_KNOWN_PATHS) {
92
+ const answer = await askFor(`${base}${path}`, issuer, fetchFn);
93
+ if (answer.kind === "found")
94
+ return answer.metadata;
95
+ misses.push(answer);
96
+ }
97
+ throw discoveryFailure(base, misses);
98
+ }
99
+ //# sourceMappingURL=metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/core/oauth/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAUnE,MAAM,gBAAgB,GAAG,CAAC,yCAAyC,EAAE,mCAAmC,CAAU,CAAC;AAEnH,4GAA4G;AAC5G,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,CAAS,EAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EA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AC,CAAC;IACxC,MAAM,MAAM,GAAW,EAAE,CAAC;IAC1B,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/D,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO;YAAE,OAAO,MAAM,CAAC,QAAQ,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;IACD,MAAM,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The CLI as an OAuth public client of Ora's authorization server: device authorization (RFC 8628), the token
3
+ * endpoint (device-code polling and refresh, RFC 6749 §6) and revocation (RFC 7009). Form-encoded, `client_id` in
4
+ * the body (a public client has no secret), and `resource` (RFC 8707) on every token request so each access token is
5
+ * bound to the public API's audience.
6
+ *
7
+ * No loop, no sleep, no presentation here: one call is one HTTP exchange. The polling cadence and the renewal of an
8
+ * expired code live in login/device-flow.ts.
9
+ */
10
+ export declare const DEVICE_CODE_GRANT = "urn:ietf:params:oauth:grant-type:device_code";
11
+ /**
12
+ * How long one exchange with the sign-in server may take. It must stay well under the refresh lock's stale window
13
+ * (session/file-lock.ts, DEFAULT_STALE_MS; oauth-client.test.ts holds the two apart): a refresh that hung longer would
14
+ * have its lock broken by a second `ora` process, which would then send the same refresh token — a replay, which
15
+ * ends the whole sign-in.
16
+ */
17
+ export declare const OAUTH_REQUEST_TIMEOUT_MS = 15000;
18
+ export interface OAuthEndpoints {
19
+ tokenEndpoint: string;
20
+ deviceAuthorizationEndpoint?: string;
21
+ revocationEndpoint?: string;
22
+ }
23
+ export interface DeviceAuthorization {
24
+ deviceCode: string;
25
+ userCode: string;
26
+ verificationUri: string;
27
+ verificationUriComplete?: string;
28
+ /** Epoch ms. */
29
+ expiresAt: number;
30
+ intervalMs: number;
31
+ }
32
+ export interface TokenSet {
33
+ accessToken: string;
34
+ /** Epoch ms. */
35
+ expiresAt: number;
36
+ refreshToken?: string;
37
+ scope?: string;
38
+ }
39
+ export type DevicePoll = {
40
+ kind: "pending";
41
+ } | {
42
+ kind: "slow_down";
43
+ } | {
44
+ kind: "tokens";
45
+ tokens: TokenSet;
46
+ };
47
+ export interface OAuthClientDeps {
48
+ endpoints: OAuthEndpoints;
49
+ clientId: string;
50
+ fetchFn: typeof fetch;
51
+ now: () => number;
52
+ }
53
+ export declare class OAuthClient {
54
+ private readonly deps;
55
+ constructor(deps: OAuthClientDeps);
56
+ /** POST device_authorization_endpoint: a device code for this client, these scopes, this audience. */
57
+ startDeviceAuthorization(req: {
58
+ scope: string;
59
+ resource: string;
60
+ }): Promise<DeviceAuthorization>;
61
+ /** One poll of the token endpoint. Pending and slow_down are answers, not errors; every other OAuth error throws. */
62
+ pollDeviceToken(authorization: DeviceAuthorization, resource: string): Promise<DevicePoll>;
63
+ /** Refresh: the server rotates the refresh token, so the caller MUST store the one this returns. */
64
+ refresh(refreshToken: string, resource: string): Promise<TokenSet>;
65
+ /** Best-effort revocation (RFC 7009 answers 200 even for an unknown token). False when the server has no endpoint. */
66
+ revoke(token: string, hint: "refresh_token" | "access_token"): Promise<boolean>;
67
+ private tokenSet;
68
+ private post;
69
+ }
70
+ //# sourceMappingURL=oauth-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.d.ts","sourceRoot":"","sources":["../../../src/core/oauth/oauth-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,eAAO,MAAM,iBAAiB,iDAAiD,CAAC;AAMhF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;C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