commit 32fd95dc3ffc0b445fc51e4e4b0e546715b3ee14 Author: Paul Carleton Date: Wed Oct 29 13:40:36 2025 +0000 mvp conformance runner diff --git a/package.json b/package.json new file mode 100644 index 0000000..ef26390 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "name": "conformance", + "version": "1.0.0", + "type": "module", + "scripts": { + "start": "node src/runner.js" + } +} diff --git a/src/runner.js b/src/runner.js new file mode 100644 index 0000000..e2fa061 --- /dev/null +++ b/src/runner.js @@ -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)); diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..b4b764f --- /dev/null +++ b/src/types.ts @@ -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; + metadata?: Record; + errorMessage?: string; + logs?: string[]; +}