sync: add DebugConfig() + StreamAuditEvents() (DAK-7477, DAK-7534) - #146
Merged
Conversation
Two parity additions vs server v0.11.102: 1. DebugConfig() → GET /debug/config (DAK-7477, server v0.11.100): Returns map[string]string of active DAKERA_* env vars (non-secret) plus _version and optionally _build_sha. 2. StreamAuditEvents() → GET /v1/audit/stream (OBS-1): Go was the only SDK missing this endpoint. Opens a long-lived SSE connection and returns <-chan *AuditEvent. Uses bufio.Scanner for SSE line parsing. Supports agentID and eventType filters. Tests: TestDebugConfig*, TestStreamAuditEvents* in client_admin_test.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…o has the typed *AuditEvent version (DAK-7540)
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
Parity audit DAK-7534: two additions vs server v0.11.102.
1.
DebugConfig()— GET /debug/config (DAK-7477)New method returning
map[string]stringof activeDAKERA_*env vars (non-secret) from the running server, plus_versionand optionally_build_sha. Requires Admin scope. Used by bench harnesses to verify feature-flag config before scoring.2.
StreamAuditEvents()— GET /v1/audit/stream (OBS-1)Go was the only SDK missing the audit stream endpoint (py/js/rs all have it). New method opens a long-lived SSE connection and returns
<-chan *AuditEvent. Usesbufio.Scannerfor SSE line parsing. Goroutine closes the channel on context cancellation, connection drop, or stream end. Addedbufioto client imports.Files changed:
client.go: Addbufioimport,DebugConfig(),StreamAuditEvents()methods (inline error parsing for non-retry SSE path)client_admin_test.go: Addfmt/timeimports,TestDebugConfig*andTestStreamAuditEvents*testsTest plan
go test ./...+go vet ./...(Go not installed on prod box)TestDebugConfigReturnsEnvMap,TestDebugConfigRequiresAdminScope,TestStreamAuditEventsYieldsEvents,TestStreamAuditEventsRequiresAuthCloses part of DAK-7534.
🤖 Generated with Claude Code