Sync public tree to bc3642c

This commit is contained in:
Michel Paulissen 2026-07-04 15:30:37 +02:00
parent 2c2dfdf8e2
commit 81942fa2ad
4 changed files with 58 additions and 8 deletions

View file

@ -76,6 +76,21 @@ expect(
"hosted signup provider and password policy criteria",
/approved external identity-provider requirement[\s\S]*disasmer_native_password_signup_allowed: false/
);
expect(
criteria,
"hosted provider normalization criteria",
/Google sign-in may be treated as OIDC; GitHub sign-in is OAuth2 social login[\s\S]*normalizes Google as `google_oidc` and GitHub as `github_oauth2` from an Authentik-issued OIDC session[\s\S]*does not consume provider-specific tokens directly/
);
expect(
criteria,
"hosted CLI cannot create accounts directly",
/The CLI cannot create a hosted account directly[\s\S]*parser coverage rejects `disasmer signup`, `disasmer account create`, and `disasmer login --create-account`/
);
expect(
criteria,
"hosted safe claim failure criteria",
/If identity is ambiguous, missing required claims, unverified where required, or blocked by policy[\s\S]*exactly one approved external identity provider[\s\S]*stable subject[\s\S]*verified email/
);
expect(
criteria,
"hosted signup sanitized failure criteria",

View file

@ -2,17 +2,31 @@
const assert = require("assert");
const cp = require("child_process");
const fs = require("fs");
const os = require("os");
const path = require("path");
const repo = path.resolve(__dirname, "..");
const project = path.join(repo, "examples/launch-build-demo");
const isolatedCwd = fs.mkdtempSync(path.join(os.tmpdir(), "disasmer-cli-output-"));
function disasmer(args, env = {}) {
function disasmer(args, env = {}, cwd = repo) {
return cp.execFileSync(
"cargo",
["run", "-q", "-p", "disasmer-cli", "--bin", "disasmer", "--", ...args],
[
"run",
"-q",
"--manifest-path",
path.join(repo, "Cargo.toml"),
"-p",
"disasmer-cli",
"--bin",
"disasmer",
"--",
...args,
],
{
cwd: repo,
cwd,
encoding: "utf8",
env: {
...process.env,
@ -22,8 +36,8 @@ function disasmer(args, env = {}) {
);
}
function json(args, env) {
return JSON.parse(disasmer(args, env));
function json(args, env, cwd) {
return JSON.parse(disasmer(args, env, cwd));
}
function assertHuman(name, output, requiredPatterns) {
@ -88,7 +102,7 @@ assert(doctorJson.node_readiness_summary.next_actions.length >= 2);
const authJson = json(["auth", "status", "--json"], {
DISASMER_TOKEN: "token",
DISASMER_TOKEN_EXPIRES_AT: "2026-07-04T00:00:00Z",
});
}, isolatedCwd);
assert.strictEqual(authJson.session.kind, "human");
assert.strictEqual(authJson.session.token_expiry_posture, "expires_at");
assert.strictEqual(authJson.session.expires_at, "2026-07-04T00:00:00Z");