fix(runtime): don't generate an unused API key name for custom_jwt deploys#95
Open
yaozheng-fang wants to merge 1 commit into
Open
fix(runtime): don't generate an unused API key name for custom_jwt deploys#95yaozheng-fang wants to merge 1 commit into
yaozheng-fang wants to merge 1 commit into
Conversation
`_prepare_runtime_config` generated (and logged "Generated API key name:") an API key whenever `runtime_apikey_name` was "Auto", regardless of auth type. For `custom_jwt`, the gateway authorizes via JWT and never uses an API key (`_build_authorizer_config_for_create` only reads the name in the key_auth branch), so the generated key was unused and the log line was misleading. Skip generation/logging when auth type is custom_jwt. Co-Authored-By: Claude Opus 4.8 <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.
Problem
When deploying a harness with OAuth2/JWT (
custom_jwt), the deploy still printed:and the resolved config carried
runtime_apikey_name/runtime_apikey: Autoalongsideruntime_auth_type: custom_jwt— misleading, since undercustom_jwtthe gateway authorizes via JWT and the API key is never used.Root cause
VeAgentkitRuntimeRunner._prepare_runtime_configgenerated an API key name wheneverruntime_apikey_name == "Auto", without checking the auth type._build_authorizer_config_for_createonly readsruntime_apikey_namein thekey_authbranch; thecustom_jwtbranch builds a JWT authorizer and ignores it. So the generated key was unused and the log line was pure noise.Fix
Skip API-key-name generation (and its log line) when
runtime_auth_type == custom_jwt.key_authbehavior is unchanged.Test
tests/toolkit/runners/test_ve_agentkit_apikey_auth.py:runtime_apikey_namestaysAuto(not generated)runtime_apikey_nameis generatedpytest tests/toolkit/runners/test_ve_agentkit_apikey_auth.py→ 2 passed.🤖 Generated with Claude Code