feat(bry-medical): add BRy Medical Signature/KMS endpoints - #14
Merged
Conversation
…gning endpoints
Adds POST /bry-kms/chaves/{uuidChave}/autorizacoes and POST
/bry-medical/fw/v1/pdf/kms/lote/assinaturas to simulate BRy's
Medical Signature/KMS flow (pré-autorização + HUB Signer medical
PDF signing), so golgimed's BRy Medical adapter can be exercised
locally against a real Mimic instance instead of only httptest
doubles.
Follows the existing provider convention (one package under
internal/providers/, DB-backed Store, requireBearer + fault-hook
middleware). Pré-autorização tokens are tracked in a new SQLite
table with real wall-clock expiry — no fake-clock machinery, tests
use short TTLs. Contract derived from golgimed's bry_medical.go /
bry_medical_test.go and BRy's KMS/HUB Signer OpenAPI specs.
Existing SCAD, IntegraICP, SNCR, and Zenvia providers are untouched.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
POST /bry-kms/chaves/{uuidChave}/autorizacoes(pré-autorização) andPOST /bry-medical/fw/v1/pdf/kms/lote/assinaturas(HUB Signer medical PDF signing) to simulate BRy's Medical Signature/KMS flow.internal/providers/brymedical/package, DB-backed pré-autorização token store (new migration0005_bry_medical.sql) with real wall-clock TTL expiry, registered alongside the existing providers inproviders.go.bry_medical.go/bry_medical_test.goadapter code and BRy's KMS/HUB Signer OpenAPI specs, cross-checked for discrepancies (all confirmed harmless since golgimed's adapter never parses BRy error bodies).go test -race ./...passes (124/124, no regressions).Verified end-to-end against a locally built image: golgimed's real BRy adapter (
PreAuthorize→SignWithPreAuthToken) run against a running Mimic container built from this branch, alongside the existing SCAD/VIDaaS/SNCR Mimic integration tests.Test plan
go build ./...,go vet ./...,gofmt -l .cleango test -race ./...— 124/124 pass, no regressions to SCAD/IntegraICP/SNCR/Zenviatests/brymedical/*_test.go— pré-autorização success/missing-credential/bearer, signing success (TIMESTAMP/COMPLETE), unsupported profile, unknown/expired token, malformed request, missing kms_type header, fault-injected provider failuredocker build -f docker/Dockerfile) verified locallybryadapter against a running container of this branch — pré-autorização + medical signing both succeed