Skip to content

fix(auth): pass API-key credentials to IAM user lookup - #173

Open
r0ny123 wants to merge 1 commit into
RevEngAI:mainfrom
r0ny123:fix/api-key-auth-for-iam-me
Open

fix(auth): pass API-key credentials to IAM user lookup#173
r0ny123 wants to merge 1 commit into
RevEngAI:mainfrom
r0ny123:fix/api-key-auth-for-iam-me

Conversation

@r0ny123

@r0ny123 r0ny123 commented Sep 8, 2026

Copy link
Copy Markdown

Problem

The plugin's startup authentication path validates the configured credential with ConfigApi.get_config() and then fetches the current user with IAMUsersApi.get_me(). The generated IAM operation advertises bearerAuth only, while the plugin configuration contains an APIKey and no bearer token. As a result, a valid credential produces a successful authentication log followed by a request with no Authorization header and a 401 response from /v2/iam/me.

Change

  • Reuse the APIKey auth setting already held by the SDK Configuration.
  • Pass it through the generated method's _request_auth override for IAMUsersApi.get_me().
  • Keep the existing call as a fallback when no API-key auth setting is available.
  • Add a regression test that checks the generated call receives the configured auth setting.

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.py
  • python -m py_compile reai_toolkit/app/services/auth/auth_service.py tests/unit/auth/test_service.py
  • git diff --check
  • A read-only request using the configured API-key auth setting returned a User from /v2/iam/me.

The focused pytest file was not executed in the local checkout because the standalone environment does not provide IDA's ida_netnode runtime module; the regression test is included for the repository's IDA-aware test environment.

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.

1 participant