ninepm 0.58.0 → 0.59.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/dist/index.d.ts +1 -1
- package/dist/index.js +15 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ export interface CreatedServiceToken {
|
|
|
116
116
|
clientSecret: string;
|
|
117
117
|
}
|
|
118
118
|
export type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
119
|
-
export declare const CLI_VERSION = "0.
|
|
119
|
+
export declare const CLI_VERSION = "0.59.0";
|
|
120
120
|
type CredentialBackend = "macos-keychain" | "windows-dpapi" | "linux-secret-service" | "file-plaintext" | "none";
|
|
121
121
|
export interface StoredCredentialEntry {
|
|
122
122
|
token: string;
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { managedHostnamesIn, siblingCallWarning, siblingsOf } from "./sibling-ho
|
|
|
15
15
|
import { MAX_STATIC_ASSET_FILE_BYTES, MAX_WORKER_ENTRY_COMPRESSED_BYTES, MAX_WORKER_SCRIPT_COMPRESSED_BYTES, WORKER_ENTRY_COMPRESSED_WARN_BYTES, assetFileTooLargeMessage, formatMebibytes, formatMegabytes, oversizedAssets, workerBundleNearLimitMessage, workerBundleTooLargeMessage, workerEntryNearLimitMessage, workerEntryTooLargeMessage, } from "./deploy-limits.js";
|
|
16
16
|
import { buildFileManifest, readManifestFile } from "./manifest.js";
|
|
17
17
|
import { API_KEY_HELP, API_URL_HELP, CLI_CLIENT_ID, DEFAULT_API_URL, reportCliError } from "./cli-config.js";
|
|
18
|
-
export const CLI_VERSION = "0.
|
|
18
|
+
export const CLI_VERSION = "0.59.0";
|
|
19
19
|
const PUBLIC_DASHBOARD_URL = "https://9pm.ai/dashboard";
|
|
20
20
|
const TOKEN_SERVICE = "9pm";
|
|
21
21
|
const TOKEN_ACCOUNT = "default";
|
|
@@ -903,15 +903,21 @@ function revocationFailureReason(error) {
|
|
|
903
903
|
}
|
|
904
904
|
return error instanceof Error ? error.message : String(error);
|
|
905
905
|
}
|
|
906
|
-
// The
|
|
907
|
-
//
|
|
908
|
-
//
|
|
909
|
-
// credential arrived at all and malformed_api_key means the header was not a
|
|
910
|
-
// bearer token, both of which a proxy that strips or rewrites Authorization
|
|
911
|
-
//
|
|
912
|
-
//
|
|
906
|
+
// The refusals that prove something about the stored credential: requireAuth emits
|
|
907
|
+
// both AFTER looking the presented token up (src/server/routes/guards.ts), so each
|
|
908
|
+
// is the control plane judging this credential. Their siblings do not — missing_api_key
|
|
909
|
+
// means no credential arrived at all and malformed_api_key means the header was not a
|
|
910
|
+
// bearer token, both of which a proxy that strips or rewrites Authorization produces
|
|
911
|
+
// for a perfectly live key. Anything else answering 401/403 is an intermediary rather
|
|
912
|
+
// than the control plane judging this credential.
|
|
913
|
+
//
|
|
914
|
+
// A set rather than a comparison because the list is now open: a key refused for
|
|
915
|
+
// inactivity (#854) is as dead to its holder as a revoked one, and a refusal this
|
|
916
|
+
// function does not recognise turns a clean `9pm logout` into a reported failure
|
|
917
|
+
// blaming an intermediary that was never involved.
|
|
918
|
+
const CREDENTIAL_REFUSAL_CODES = new Set(["invalid_api_key", "expired_api_key"]);
|
|
913
919
|
async function isAuthRefusal(response) {
|
|
914
|
-
return (await responseErrorCode(response))
|
|
920
|
+
return CREDENTIAL_REFUSAL_CODES.has(await responseErrorCode(response));
|
|
915
921
|
}
|
|
916
922
|
// The `code` from the control plane's {error:{code}} envelope, or "" when the
|
|
917
923
|
// body is not that shape (proxy error page, empty body).
|