Skip to content

Normalize auth taxonomy and Bloom role persistence#223

Merged
iamh2o merged 3 commits intomainfrom
codex/auth-taxonomy-refactor
Apr 4, 2026
Merged

Normalize auth taxonomy and Bloom role persistence#223
iamh2o merged 3 commits intomainfrom
codex/auth-taxonomy-refactor

Conversation

@iamh2o
Copy link
Copy Markdown
Contributor

@iamh2o iamh2o commented Apr 4, 2026

Summary

  • normalize Bloom auth taxonomy so identity groups, service roles, and service entitlements are distinct
  • add Bloom user role normalization and migration support for canonical uppercase persisted roles
  • update auth docs and focused auth tests for the new contract

Testing

  • source ./activate xxyyzz && pytest --no-cov tests/test_group_service_rbac.py tests/test_gui_auth_callback.py tests/test_bloom_user_role_migration.py tests/test_api_auth_rbac.py tests/test_admin_auth.py tests/test_cli_users_issue_token.py -q

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2352f159ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 123 to +124
if resolution.groups:
return resolution.roles, resolution.groups, candidate
return resolution.roles, resolution.groups, candidate, fallback
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep role lookup from stopping at first group hit

Returning immediately on a non-empty resolution.groups can short-circuit role resolution on cognito_sub before checking the email candidate for a persisted service role. After this change, roles are no longer derived from groups, so a user whose memberships are keyed by sub but whose stored role is keyed by email/login will be assigned the fallback READ_WRITE role instead of their persisted role (e.g., ADMIN) during login.

Useful? React with 👍 / 👎.

Comment on lines +84 to +87
group_service.remove_user_from_group(
group_code=group_code,
user_id=str(user.uid),
removed_by=str(user.uid),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove legacy memberships with the matched user identifier

The migration infers legacy role groups by checking memberships under multiple identifiers (uid, username, email), but removal is always executed with user_id=str(user.uid). When the active membership is stored under username/email, remove_user_from_group does not match and nothing is actually removed, even though the script records it as removed in the summary.

Useful? React with 👍 / 👎.

@iamh2o iamh2o merged commit 556988a into main Apr 4, 2026
5 checks passed
@iamh2o iamh2o deleted the codex/auth-taxonomy-refactor branch April 4, 2026 07:05
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