feat: CIMD support check for authorization-server metadata (supersedes #235) (#365)

* feat: check for CIMD of authorization server metadata

* feat(runner): support per-check spec-version gating via ConformanceCheck.source

* fix(auth): CIMD is SHOULD — emit WARNING; gate via check.source; reuse SpecReferences

* test(runner): matchesSpecVersion gates introducedIn:'2025-11-25' correctly

---------

Co-authored-by: Takashi Norimatsu <takashi.norimatsu.ws@hitachi.com>
This commit is contained in:
Paul Carleton 2026-06-24 16:53:00 +01:00 • committed by GitHub
commit 32523cc21a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,10 @@
import { promises as fs } from 'fs';
import path from 'path';
import { ConformanceCheck } from '../types';
import { getClientScenarioForAuthorizationServer } from '../scenarios';
import { ConformanceCheck, SpecVersion } from '../types';
import {
getClientScenarioForAuthorizationServer,
matchesSpecVersion
} from '../scenarios';
import { createResultDir, formatPrettyChecks } from './utils';
import { AuthorizationServerOptions } from '../schemas';
@ -9,7 +12,8 @@ export async function runAuthorizationServerConformanceTest(
options: AuthorizationServerOptions,
scenarioName: string,
details: Record<string, unknown>,
outputDir?: string
outputDir?: string,
specVersion?: SpecVersion
): Promise<{
checks: ConformanceCheck[];
resultDir?: string;
@ -34,18 +38,23 @@ export async function runAuthorizationServerConformanceTest(
);
const checks = await scenario.run(options, details);
const filtered = specVersion
? checks.filter(
(c) => !c.source || matchesSpecVersion(c.source, specVersion)
)
: checks;
if (resultDir) {
await fs.writeFile(
path.join(resultDir, 'checks.json'),
JSON.stringify(checks, null, 2)
JSON.stringify(filtered, null, 2)
);
console.log(`Results saved to ${resultDir}`);
}
return {
checks,
checks: filtered,
resultDir,
scenarioDescription: scenario.description
};