@nurix/nustack 0.19.4 → 0.19.6
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/lib/auth_grant.js +5 -5
- package/package.json +3 -3
package/dist/lib/auth_grant.js
CHANGED
|
@@ -9,7 +9,7 @@ const BOOTSTRAP_TIMEOUT_MS = 25_000;
|
|
|
9
9
|
const ACCESS_TOKEN_SKEW_MS = 30_000;
|
|
10
10
|
const LOOPBACK_TIMEOUT_MS = 10 * 60_000;
|
|
11
11
|
const MACHINE_SCOPE = "offline_access";
|
|
12
|
-
export const CLI_CODE_PAGE_PATH = "/
|
|
12
|
+
export const CLI_CODE_PAGE_PATH = "/cli-code";
|
|
13
13
|
export const DEVICE_HEADER = "X-NuStack-Device";
|
|
14
14
|
export function deadCredentialCopy(reason) {
|
|
15
15
|
if (reason === "older-schema")
|
|
@@ -52,7 +52,7 @@ export async function fetchAuthConfig(nustackBaseUrl) {
|
|
|
52
52
|
return { authBaseUrl: assertSafeNuStackUrl(payload.auth_base_url), clientId: payload.client_id, resources };
|
|
53
53
|
}
|
|
54
54
|
export async function discover(authBaseUrl) {
|
|
55
|
-
const response = await fetch(`${authBaseUrl}
|
|
55
|
+
const response = await fetch(`${authBaseUrl}/.well-known/openid-configuration`, {
|
|
56
56
|
headers: { Accept: "application/json", "User-Agent": userAgent() },
|
|
57
57
|
signal: AbortSignal.timeout(BOOTSTRAP_TIMEOUT_MS),
|
|
58
58
|
});
|
|
@@ -64,7 +64,7 @@ export async function discover(authBaseUrl) {
|
|
|
64
64
|
issuer: payload.issuer,
|
|
65
65
|
authorizationEndpoint: payload.authorization_endpoint,
|
|
66
66
|
tokenEndpoint: payload.token_endpoint,
|
|
67
|
-
revocationEndpoint: payload.revocation_endpoint ?? `${authBaseUrl}/
|
|
67
|
+
revocationEndpoint: payload.revocation_endpoint ?? `${authBaseUrl}/oauth2/revoke`,
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
export function mintPkce() {
|
|
@@ -261,7 +261,7 @@ export async function revokeGrant(input) {
|
|
|
261
261
|
try {
|
|
262
262
|
const endpoint = await discover(input.authBaseUrl)
|
|
263
263
|
.then((d) => d.revocationEndpoint)
|
|
264
|
-
.catch(() => `${input.authBaseUrl}/
|
|
264
|
+
.catch(() => `${input.authBaseUrl}/oauth2/revoke`);
|
|
265
265
|
const response = await fetch(endpoint, {
|
|
266
266
|
method: "POST",
|
|
267
267
|
headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json", "User-Agent": userAgent() },
|
|
@@ -333,7 +333,7 @@ async function clientIdFor(grant, nustackBaseUrl) {
|
|
|
333
333
|
}
|
|
334
334
|
async function refreshAndPersist(grant, audience, nustackBaseUrl) {
|
|
335
335
|
const clientId = await clientIdFor(grant, nustackBaseUrl);
|
|
336
|
-
const refreshed = await refreshGrant(`${grant.authBaseUrl}/
|
|
336
|
+
const refreshed = await refreshGrant(`${grant.authBaseUrl}/oauth2/token`, grant.refreshToken, audience, clientId);
|
|
337
337
|
if (refreshed.kind !== "minted")
|
|
338
338
|
return refreshed;
|
|
339
339
|
const claims = decodeJwtPayload(refreshed.accessToken);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nurix/nustack",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.6",
|
|
4
4
|
"description": "The nustack CLI — bootstrap NuStack services into a repo via the NuStack discovery plane.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@types/node": "^22.19.20",
|
|
36
36
|
"typescript": "^5.7.2",
|
|
37
37
|
"vitest": "^4.1.11",
|
|
38
|
-
"@nurix/nustack.
|
|
39
|
-
"@nurix/nustack.
|
|
38
|
+
"@nurix/nustack.studio": "0.0.0",
|
|
39
|
+
"@nurix/nustack.ui": "0.0.0"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|