Repository navigation
feat(claudecode, codex): authenticate ingest with a Timeplus API key - #339
Merged
Merged
Conversation
From Timeplus REST API 3.5.4 a user can create API keys and use one in place of a username and password. Both plugins now take AGENTGUARD_API_KEY and send it as X-Api-Key, so no password has to be kept on the agent host. The key is used only with AGENTGUARD_INGEST_API=rest: timeplusd takes no key. In timeplusd mode the key is not sent, the username and password are used, and the plugin says so on stderr. A key does not change the ingest mode. Without a key nothing changes. Codex: applies to the hooks export; the otel export does not use it. Claude Code Makefile: writes AGENTGUARD_INGEST_API, and the key when set. Claude Code plugin 0.10.0, Codex plugin 0.5.0. Fixes #337 Fixes #338 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Fixes #337
Fixes #338
What
From Timeplus REST API 3.5.4 a user can create scoped API keys and use one in place of a username and password. The Claude Code plugin and the Codex plugin (
hooksexport) now takeAGENTGUARD_API_KEY, so no password has to be kept on the agent host.AGENTGUARD_INGEST_API=restand a key set, the plugin sendsX-Api-Key: <key>and noAuthorization: Basicheader. The username and password are not sent.restmode only. Intimeplusdmode (port 3218 takes no key) it is not sent, the username and password are used, and the plugin says on stderr that the key is ignored. A key does not change the ingest mode.otelexport does not use the key.Changes
config.ts(apiKey),timeplus-client.ts(authHeaders, one warning per process). Version 0.10.0.hookevents.py(IngestConfig.api_key,headers),cli.py(warning). Version 0.5.0.agents/claudecode/Makefile: writesAGENTGUARD_INGEST_API(it could not selectrestbefore) andAGENTGUARD_API_KEYwhen one is given;unconfigureremoves both.docs/plugin-install.md,skills/agentguard/SKILL.md, rootREADME.md,CLAUDE.md(the "no API keys" line).Tested
ag.agentguard_hook_events:rest+ key, with a wrong username/password also setrest+ key, no username/passwordrest+ key limited to another streamrest+ revoked keyrest+ malformed keyrest, no keytimeplusd+ keyrest+ key on a 3.5.1 REST API (no key support)configure/unconfigurerun against a scratch settings file.Not tested: an expired key, a key after its owner changed their password, a real Claude Code or Codex session with a key (the plugins were run with a hook payload on stdin), HTTPS.
Not in this PR
claudecode-plugin-v0.10.0andcodex-plugin-v0.5.0.🤖 Generated with Claude Code