mvp conformance runner
This commit is contained in:
commit
32fd95dc3f
3 changed files with 74 additions and 0 deletions
8
package.json
Normal file
8
package.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "conformance",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "node src/runner.js"
|
||||
}
|
||||
}
|
||||
47
src/runner.js
Normal file
47
src/runner.js
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
const checks = [
|
||||
{
|
||||
id: "check-001",
|
||||
name: "Basic Auth Check",
|
||||
description: "Validates basic authentication flow",
|
||||
status: "SUCCESS",
|
||||
timestamp: new Date().toISOString(),
|
||||
specReferences: [
|
||||
{
|
||||
id: "rfc6750",
|
||||
url: "https://tools.ietf.org/html/rfc6750"
|
||||
}
|
||||
],
|
||||
details: {
|
||||
authType: "Bearer",
|
||||
responseTime: 45
|
||||
},
|
||||
logs: [
|
||||
"Auth endpoint reached",
|
||||
"Token validated successfully"
|
||||
]
|
||||
},
|
||||
{
|
||||
id: "check-002",
|
||||
name: "Token Expiry Check",
|
||||
description: "Validates token expiration handling",
|
||||
status: "FAILURE",
|
||||
timestamp: new Date().toISOString(),
|
||||
errorMessage: "Token expiry not properly enforced",
|
||||
logs: [
|
||||
"Token validation started",
|
||||
"Expiry check failed"
|
||||
]
|
||||
},
|
||||
{
|
||||
id: "check-003",
|
||||
name: "CORS Header Check",
|
||||
description: "Validates CORS headers in response",
|
||||
status: "WARNING",
|
||||
timestamp: new Date().toISOString(),
|
||||
details: {
|
||||
missingHeaders: ["Access-Control-Allow-Credentials"]
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
console.log(JSON.stringify(checks, null, 2));
|
||||
19
src/types.ts
Normal file
19
src/types.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
export type CheckStatus = 'SUCCESS' | 'FAILURE' | 'WARNING' | 'SKIPPED' | 'INFO';
|
||||
|
||||
export interface SpecReference {
|
||||
id: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface ConformanceCheck {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
status: CheckStatus;
|
||||
timestamp: string;
|
||||
specReferences?: SpecReference[];
|
||||
details?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
errorMessage?: string;
|
||||
logs?: string[];
|
||||
}
|
||||
Loading…
Reference in a new issue