ravensight-playtest 0.2.5 → 0.2.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/README.md +1 -1
- package/package.json +1 -1
- package/src/auth/session.js +4 -0
- package/src/commands/check.js +9 -2
package/README.md
CHANGED
|
@@ -395,7 +395,7 @@ CI can treat 2 as a success with a warning.
|
|
|
395
395
|
|
|
396
396
|
| Variable | Effect |
|
|
397
397
|
|---|---|
|
|
398
|
-
| `RAVENSIGHT_TOKEN` | Use this token instead of the keychain. The CI path. |
|
|
398
|
+
| `RAVENSIGHT_TOKEN` | Use this token instead of the keychain. The CI path. It must be a `gt_cli_` token, the kind `login` stores. A `gt_mcp_` token is an MCP personal access token and a `gt_live_` token is a game's ingest key; `check` refuses both and says which one it saw. |
|
|
399
399
|
| `RAVENSIGHT_API_URL` | The API base URL. Defaults to `https://api.ravensight.io`. |
|
|
400
400
|
| `RAVENSIGHT_DASHBOARD_URL` | Where the dashboard is, if it is not derivable from the API URL. |
|
|
401
401
|
| `RAVENSIGHT_GAME_ID` | The game, when there is no linked repo. |
|
package/package.json
CHANGED
package/src/auth/session.js
CHANGED
|
@@ -68,6 +68,10 @@ export function looksLikeIngestKey(token) {
|
|
|
68
68
|
return typeof token === 'string' && token.startsWith('gt_live_');
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
export function looksLikeMcpToken(token) {
|
|
72
|
+
return typeof token === 'string' && token.startsWith('gt_mcp_');
|
|
73
|
+
}
|
|
74
|
+
|
|
71
75
|
/**
|
|
72
76
|
* What to do when the server refuses the credential.
|
|
73
77
|
*
|
package/src/commands/check.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createClient } from '../api/client.js';
|
|
2
2
|
import { ApiError } from '../api/errors.js';
|
|
3
3
|
import { resolveApiUrl, paths } from '../paths.js';
|
|
4
|
-
import { resolveToken, looksLikeIngestKey } from '../auth/session.js';
|
|
4
|
+
import { resolveToken, looksLikeIngestKey, looksLikeMcpToken } from '../auth/session.js';
|
|
5
5
|
import { backendName } from '../auth/keychain.js';
|
|
6
6
|
import { loadConfig } from '../config.js';
|
|
7
7
|
import { packs } from '../packs/index.js';
|
|
@@ -183,12 +183,19 @@ export async function runChecks(flags = {}, deps = {}) {
|
|
|
183
183
|
'that is an ingest key, not a CLI token',
|
|
184
184
|
'run login, or set RAVENSIGHT_TOKEN to a gt_cli_ token'
|
|
185
185
|
));
|
|
186
|
+
} else if (looksLikeMcpToken(token)) {
|
|
187
|
+
rows.push(row(
|
|
188
|
+
'token valid',
|
|
189
|
+
'fail',
|
|
190
|
+
'This is an MCP personal access token (gt_mcp_). The CLI needs its own token (gt_cli_): run `ravensight-playtest login`, or set RAVENSIGHT_TOKEN to a gt_cli_ token in CI.',
|
|
191
|
+
'ravensight-playtest login'
|
|
192
|
+
));
|
|
186
193
|
} else if (!token) {
|
|
187
194
|
rows.push(row('token valid', 'fail', `not logged in to ${host}`, 'ravensight-playtest login'));
|
|
188
195
|
}
|
|
189
196
|
|
|
190
197
|
let whoami = null;
|
|
191
|
-
if (token && !looksLikeIngestKey(token)) {
|
|
198
|
+
if (token && !looksLikeIngestKey(token) && !looksLikeMcpToken(token)) {
|
|
192
199
|
const authed = deps.authedApi || createClient({ apiUrl, token });
|
|
193
200
|
try {
|
|
194
201
|
whoami = await authed.cli.whoami();
|