mirror of
https://github.com/luxfi/broker.git
synced 2026-09-24 00:25:18 +00:00
Replace the ErrNotImplemented stub on Config.LoadFromKMS with a real implementation against a narrow KMSGetter interface. Adapter has zero direct dependency on luxfi/kms; the canonical luxfi/kms.GetWith satisfies KMSGetter via a 1-line wrapper at brokerd startup. Signature: (ctx, KMSGetter, env) error. env is "sandbox" or "prod". KMS path scheme (per integration brief §2): shared/northcapital/<env>/clientID (required) shared/northcapital/<env>/developerAPIKey (required) shared/northcapital/<env>/webhookAuthKey (required) shared/northcapital/<env>/webhookDecryptionKey (optional) Error sentinels: ErrKMSKeyMissing — required key absent / empty value ErrKMSDecryption — transport / decryption failure Tests: 13 cases, all pass under -race. Conformance: - sandbox + prod happy paths populate every field - exact KMS path shape (shared/northcapital/<env>/<field>) - missing required key → ErrKMSKeyMissing (each of 3 required) - empty value treated as missing - decryption error → ErrKMSDecryption - transport error → ErrKMSDecryption - transport error on optional key still fatal - missing optional key tolerated; preserves caller-supplied value - nil KMSGetter rejected - empty / unknown env rejected Source-of-design: Public-Spec Source-ref: legal/partnerships/northcapital/ NorthCapital_Lux_Integration_Brief.md §2; github.com/luxfi/kms public Go surface (kms.Get / kms.GetWith) Clean-Team-Member: dev-agent (P0 NCPS LoadFromKMS completion) Signed-off-by: dev <[email protected]>