Skip to content

feat!: adapt auth client to authup camelCase management API#117

Open
tada5hi wants to merge 1 commit into
mainfrom
feat/authup-camelcase-management-api
Open

feat!: adapt auth client to authup camelCase management API#117
tada5hi wants to merge 1 commit into
mainfrom
feat/authup-camelcase-management-api

Conversation

@tada5hi

@tada5hi tada5hi commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

authup renamed its entity / management-API vocabulary from snake_case → camelCase in c31b20ee9 ("refactor!: camelCase entity properties, domain types & management API", authup#3273). The OAuth2/OIDC protocol surface and JWT claims deliberately stay snake_case in that change.

This PR mirrors the rename onto flame_hub's AuthClient (which wraps authup's management API), so the client keeps working against the new authup.

Changes

  • flame_hub/_auth_client.py — model fields, method keyword arguments, and the rapiq filter / sort / field / include vocabulary are now camelCase:
    • display_name → displayName, realm_id → realmId, built_in → builtIn, created_at → createdAt, updated_at → updatedAt, name_locked → nameLocked, first_name → firstName, last_name → lastName
    • is_confidential → isConfidential, secret_hashed → secretHashed, secret_encrypted → secretEncrypted, grant_types → grantTypes, redirect_uri → redirectUri, base_url (client field) → baseUrl, root_url → rootUrl
    • junction ids role_id → roleId, permission_id → permissionId, user_id → userId, robot_id → robotId, client_id → clientId, policy_id → policyId, *_realm_id → *RealmId
    • relation includes role_realm → roleRealm, permission_realm → permissionRealm, user_realm → userRealm, robot_realm → robotRealm
  • Tests / docs updated to the camelCase vocabulary (tests/test_auth.py, tests/test_flow.py, README.md, docs/user_guide.rst).

Deliberately unchanged

  • BaseClient, CoreClient, StorageClient — untouched. A pydantic field name is the wire key, so no shared serialization changes were needed. The FLAME Hub core/storage services did not change and stay snake_case (so users never see mixed casing within one service).
  • _auth_flows.py — the OAuth2 /token surface (grant_type, client_id, client_secret, refresh_token, id, secret, …) stays snake_case, matching authup's frozen protocol surface. RobotAuth / ClientAuth credential kwargs are unchanged.
  • Scope is the casing rename only — this is based on authup#3273. Later/other authup commits (robot-entity removal #3275, auth_method replacing is_confidential, rapiq v2) are not in scope here.

Verification

  • ruff format + ruff check clean.
  • Non-integration suite: 58 passed.
  • Smoke checks: create/update payloads serialize camelCase on the wire; camelCase responses parse back; get_includable_names(...) returns the camelCase relation names.
  • Integration tests (-m integration, need a live Hub) were not run locally.

Note

The deployed FLAME Hub / authup image must serve the plan-073 camelCase API for the integration suite (and real usage) to pass — this client change should land together with (or after) the corresponding Hub/authup bump.

Breaking change

AuthClient model attributes, method keyword arguments, and rapiq filter/sort/field/include keys are now camelCase.

Summary by CodeRabbit

  • Enhancements

    • Updated authentication client fields, parameters, and resource identifiers to use camelCase naming consistently.
    • Improved consistency across realm, user, role, permission, robot, and client operations.
  • Documentation

    • Updated Quickstart and nested-resource examples to show camelCase JSON field names.

authup renamed its entity/management-API vocabulary from snake_case to
camelCase (authup/authup@c31b20ee9, "refactor!: camelCase entity
properties, domain types & management API", #3273). Its OAuth2/OIDC
protocol surface and JWT claims stay snake_case.

Mirror that on the AuthClient: model fields, method keyword arguments and
the rapiq filter/sort/field/include vocabulary move to camelCase
(display_name -> displayName, realm_id -> realmId, role_id -> roleId,
built_in -> builtIn, created_at -> createdAt, is_confidential ->
isConfidential, the *_realm relation includes -> *Realm, ...). Because a
pydantic field name is the wire key, the shared BaseClient and the
CoreClient / StorageClient are untouched and stay snake_case (the FLAME
Hub core/storage services did not change). The _auth_flows OAuth2 token
surface (grant_type, client_id, client_secret, refresh_token, id, secret)
stays snake_case.

Docs and tests are updated to the camelCase vocabulary.

BREAKING CHANGE: AuthClient model attributes, method keyword arguments and
rapiq filter/sort/field/include keys are now camelCase.
Copilot AI review requested due to automatic review settings July 20, 2026 09:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The AuthClient Pydantic models and endpoint parameters now use camelCase names across resources, relationships, and clients. Tests and README/user-guide JSON examples were updated to match the renamed fields.

Changes

AuthClient camelCase API migration

Layer / File(s) Summary
Schema and core resource updates
flame_hub/_auth_client.py
Resource models and realm, robot, permission, and role endpoints now use camelCase fields and parameters.
Relationship endpoint updates
flame_hub/_auth_client.py
Role, user, and robot relationship endpoints use camelCase identifiers and payload fields.
Client endpoint updates
flame_hub/_auth_client.py
Client CRUD methods now accept and construct requests with camelCase fields and identifiers.
Usage and documentation alignment
tests/test_auth.py, tests/test_flow.py, README.md, docs/user_guide.rst
Tests and JSON examples were updated to use camelCase names and attributes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main breaking change: adapting the auth client to authup's camelCase management API.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/authup-camelcase-management-api

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
flame_hub/_auth_client.py (2)

376-393: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Pre-existing policyId=None TODO carried through the rename.

create_permission still hard-codes policyId=None pending hub policy support. Not introduced here, but flagging so it isn't lost in the camelCase churn. Want me to open a tracking issue?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@flame_hub/_auth_client.py` around lines 376 - 393, The existing
create_permission implementation still passes policyId=None; preserve this
intentional TODO during the camelCase rename and do not remove or alter the
field until hub policy support is implemented.

24-279: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Consider keeping snake_case Python fields and adding camelCase aliases.
Renaming the model attributes themselves makes the client API a breaking change for downstream code; alias_generator=to_camel with populate_by_name=True would preserve the Python surface while still serializing camelCase on the wire.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@flame_hub/_auth_client.py` around lines 24 - 279, Preserve the existing
snake_case Python attribute names across the models in this diff instead of
exposing camelCase names such as displayName, realmId, and createdAt. Configure
the shared Pydantic model setup with alias_generator=to_camel and
populate_by_name=True so Python callers use snake_case while request
serialization and response parsing continue to use camelCase wire fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@flame_hub/_auth_client.py`:
- Around line 376-393: The existing create_permission implementation still
passes policyId=None; preserve this intentional TODO during the camelCase rename
and do not remove or alter the field until hub policy support is implemented.
- Around line 24-279: Preserve the existing snake_case Python attribute names
across the models in this diff instead of exposing camelCase names such as
displayName, realmId, and createdAt. Configure the shared Pydantic model setup
with alias_generator=to_camel and populate_by_name=True so Python callers use
snake_case while request serialization and response parsing continue to use
camelCase wire fields.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d3c04c8d-4a37-4674-8483-71af45980f5e

📥 Commits

Reviewing files that changed from the base of the PR and between 1d66a1f and c356a64.

📒 Files selected for processing (5)
  • README.md
  • docs/user_guide.rst
  • flame_hub/_auth_client.py
  • tests/test_auth.py
  • tests/test_flow.py

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.

2 participants