Skip to content

Conversation

@Xynnn007
Copy link

Refactor the admin module from simple monolithic implementations to a modular architecture that separates token verification from authorization decisions.

Key changes:

  • Split admin functionality into two independent modules:
    • token_verifier: Handles token parsing and verification (BearerJwt)
    • authorization: Handles access control decisions (RegexAcl)
  • Replace simple backend types (allow_all, deny_all, simple) with trait-based architecture for better extensibility
  • Update AdminConfig to use "mode" enum (InsecureAllowAll, DenyAll, Enforce) instead of "type" for clearer semantics
  • Enforce mode requires both token_verifier and authorizer configuration
  • Improve error handling with detailed reason messages in AdminAccessDenied

This refactoring improves code organization, maintainability, and makes it easier to add new token verifiers or authorization strategies in the future.

Note that this PR does not handle the following things

  • Unit tests
  • Config updations
  • Documents
  • KBS client updates

Refactor the admin module from simple monolithic implementations to a
modular architecture that separates token verification from authorization
decisions.

Key changes:
- Split admin functionality into two independent modules:
  * token_verifier: Handles token parsing and verification (BearerJwt)
  * authorization: Handles access control decisions (RegexAcl)
- Replace simple backend types (allow_all, deny_all, simple) with
  trait-based architecture for better extensibility
- Update AdminConfig to use "mode" enum (InsecureAllowAll, DenyAll, Enforce)
  instead of "type" for clearer semantics
- Enforce mode requires both token_verifier and authorizer configuration
- Improve error handling with detailed reason messages in AdminAccessDenied

This refactoring improves code organization, maintainability, and makes it
easier to add new token verifiers or authorization strategies in the future.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
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