You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the internal/config package and the jotsmith config show command. Every later subcommand depends on a loaded, validated config, so this slice nails down the file format, path-resolution precedence, env-var contract, and error surface.
internal/config defines a Config struct matching the PRD §5.3 schema: version, subscription_id, storage_account, key_vault, key_name, issuer, jwks_path, discovery_path
Load(path) reads, JSON-unmarshals, and validates required fields; returns distinct typed errors for missing file, invalid JSON, and missing/invalid required field
Validation error messages name the offending field
version is required and validated (only 1 is accepted in this slice)
issuer validation: parses as URL, has scheme + host, no trailing slash; default-corrected if a trailing slash is present and a debug log is emitted
jotsmith config show prints the loaded config JSON pretty-printed to stdout
jotsmith config show --path prints the resolved config file path to stdout
Config-load errors exit with code 2 and render to stderr
--no-color is respected on stderr error rendering
Unit tests cover: XDG fallback when env unset, env override of XDG, flag override of env, missing file, invalid JSON, missing required field, trailing-slash issuer correction
Activity
MaxAnderson95 commentedon Jun 1, 2026
Implemented and merged in #14.
Originally created in OpenCode session ID: ses_17c986ef9ffeHc0S3r1wQcmLDT