#340 Part 3: Complete Audit Flow integration and create Audit Interface#413
Merged
mushrafmim merged 4 commits intomainfrom Jan 13, 2026
Merged
#340 Part 3: Complete Audit Flow integration and create Audit Interface#413mushrafmim merged 4 commits intomainfrom
mushrafmim merged 4 commits intomainfrom
Conversation
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
This PR centralizes audit logging for
POLICY_CHECKandCONSENT_CHECKevents in Orchestration Engine, implementsPROVIDER_FETCHevents, and establishes a cleanAuditorinterface inshared/audit/for easy migration when audit-service moves to its own repository.Key Changes:
Auditorinterface inshared/audit/interface.gofor clean abstractionORCHESTRATION_REQUEST_RECEIVED,POLICY_CHECK,CONSENT_CHECK,PROVIDER_FETCH) are logged from Orchestration Engine for consistent traceID correlationenums.yamlconfig, keepingDefaultEnumsgenericExample Audit Flow
A single OE request now generates a complete sequence of audit events linked by one
traceID:ORCHESTRATION_REQUEST_RECEIVED(traceID:abc-123)SUCCESSPOLICY_CHECK(traceID:abc-123)SUCCESSif API call succeeds,FAILUREif API call fails or unauthorized/expiredpolicy-decision-pointCONSENT_CHECK(traceID:abc-123)SUCCESSif API call succeeds,FAILUREif API call failsconsent-enginePROVIDER_FETCH(traceID:abc-123, target:provider-1,provider-2, etc.)SUCCESSorFAILUREbased on provider responseExample: For a request with 2 providers:
traceID: abc-123All events can be retrieved using:
GET /api/audit-logs?traceId=abc-123Changes
Shared Audit Package (
shared/audit/)Auditorinterface ininterface.gofor clean abstractionLogEvent()andIsEnabled()methodsAuditClientalias maintained for backward compatibilitymiddleware.goto useAuditorinterface instead of concreteAuditClientinit.goto useAuditorinterfaceClientstruct implementsAuditorinterface (already had required methods)Event Types
The following event types are now fully implemented:
ORCHESTRATION_REQUEST_RECEIVEDSUCCESSPOLICY_CHECKSUCCESS,FAILUREpolicy-decision-pointCONSENT_CHECKSUCCESS,FAILUREconsent-enginePROVIDER_FETCHSUCCESS,FAILUREConfiguration
Environment Variables
Orchestration Engine supports audit configuration:
CHOREO_AUDIT_CONNECTION_SERVICEURL: Audit service base URL (e.g.,http://localhost:3001)ENABLE_AUDIT: Explicitly enable/disable audit loggingtrue,1,yes(case-insensitive) to enableCHOREO_AUDIT_CONNECTION_SERVICEURLis setUpgrade Path
enums.yaml:POLICY_CHECK(one record per API call, logged by Orchestration Engine)CONSENT_CHECK(one record per API call, logged by Orchestration Engine)PROVIDER_FETCH(one record per API call, logged by Orchestration Engine)CHOREO_AUDIT_CONNECTION_SERVICEURLenvironment variable in Orchestration EngineGET /api/audit-logs?traceId=<trace-id>Related PRs
Related Issues
Closes #340