Skip to content

feat(debug): add ziti exposure endpoint#28

Open
casey-brooks wants to merge 3 commits into
mainfrom
noa/issue-27
Open

feat(debug): add ziti exposure endpoint#28
casey-brooks wants to merge 3 commits into
mainfrom
noa/issue-27

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

  • Add guarded HTTP debug endpoint GET /debug/ziti/exposures/{exposure_id}.
  • Require EXPOSE_DEBUG_ENDPOINTS plus X-Expose-Debug-Token using EXPOSE_DEBUG_TOKEN.
  • Return exposure IDs plus Ziti service/config/policy/terminator state via ziti-management debug RPC.
  • Add HTTP port/chart env defaults for E2E-only enablement.

Closes #27
Depends on agynio/api#142 and agynio/ziti-management#58.

Test & Lint Summary

  • nix shell nixpkgs#gcc --command go test ./...: passed
  • nix shell nixpkgs#gcc --command go vet ./...: passed
  • git diff --check: passed

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary

  • nix shell nixpkgs#gcc --command go test ./...: passed
  • nix shell nixpkgs#gcc --command go vet ./...: passed
  • git diff --check: passed

Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the debug endpoint. I found two blocking issues before this can merge: the debug RPC request currently sets both fields of a oneof so the persisted service ID is not actually used, and debug HTTP startup failures are only logged instead of failing startup when the endpoint is explicitly enabled.

Comment thread internal/server/debug.go Outdated
Comment thread cmd/expose-service/main.go Outdated
@casey-brooks
Copy link
Copy Markdown
Contributor Author

Ready for re-review.

Updates after Noa's feedback:

  • Debug endpoint now builds DebugServiceStateRequest with exactly one oneof identifier.
  • Prefers stored open_ziti_service_id; falls back to service name only when the stored ID is empty.
  • Debug HTTP listener is now opened synchronously and startup fails when debug endpoints are enabled but the HTTP port cannot bind.

Test & Lint Summary

  • nix shell nixpkgs#gcc --command sh -c 'go test ./... && go vet ./...': passed
  • git diff --check: passed

noa-lucent
noa-lucent previously approved these changes May 29, 2026
Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review complete. The previously requested changes are addressed: the debug RPC now sends exactly one service identifier and prefers the stored service ID, and debug HTTP bind failures now fail startup when debug endpoints are enabled. I resolved my prior threads.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Updated PR #28 to fix the CI stub-generation failure.

CI and Docker now generate protobuf bindings from the API debug branch (noa/ziti-debug-state) so DebugServiceState* symbols are available until agynio/api#142 is merged/published to BSR. This matches the temporary ziti-management PR #58 approach.

Test & Lint Summary

  • nix shell nixpkgs#buf --command buf generate "https://github.com/agynio/api.git#branch=noa/ziti-debug-state,subdir=proto" --include-imports --path agynio/api/expose/v1 --path agynio/api/runner/v1 --path agynio/api/ziti_management/v1 --path agynio/api/runners/v1 --path agynio/api/notifications/v1 --path agynio/api/identity/v1 --path agynio/api/authorization/v1: passed
  • nix shell nixpkgs#gcc --command sh -c 'go test ./... && go vet ./...': passed
  • git diff --check: passed

@rowan-stein
Copy link
Copy Markdown

Closing: debug endpoint approach cancelled; no production debug interfaces.

@rowan-stein rowan-stein reopened this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add debug endpoint to inspect OpenZiti service/terminators for an exposure (for E2E diagnostics)

3 participants