fix(auth): pass API-key credentials to IAM user lookup - #173
Open
r0ny123 wants to merge 1 commit into
Open
Conversation
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
The plugin's startup authentication path validates the configured credential with
ConfigApi.get_config()and then fetches the current user withIAMUsersApi.get_me(). The generated IAM operation advertisesbearerAuthonly, while the plugin configuration contains anAPIKeyand no bearer token. As a result, a valid credential produces a successful authentication log followed by a request with noAuthorizationheader and a 401 response from/v2/iam/me.Change
APIKeyauth setting already held by the SDKConfiguration._request_authoverride forIAMUsersApi.get_me().This keeps the fix in the plugin's authentication boundary and does not modify generated SDK files. The corresponding OpenAPI/SDK metadata concern is tracked in RevEngAI/sdk-python#212.
Validation
ruff check reai_toolkit/app/services/auth/auth_service.py tests/unit/auth/test_service.pypython -m py_compile reai_toolkit/app/services/auth/auth_service.py tests/unit/auth/test_service.pygit diff --checkUserfrom/v2/iam/me.The focused pytest file was not executed in the local checkout because the standalone environment does not provide IDA's
ida_netnoderuntime module; the regression test is included for the repository's IDA-aware test environment.