Skip to content

feat(auth): implement per-application metadata for JWT client attributes#20

Merged
x42en merged 1 commit intomainfrom
develop
May 4, 2026
Merged

feat(auth): implement per-application metadata for JWT client attributes#20
x42en merged 1 commit intomainfrom
develop

Conversation

@x42en
Copy link
Copy Markdown
Contributor

@x42en x42en commented May 4, 2026

Add a metadata field to applications, allowing administrators to define custom key-value pairs that are injected into issued JWTs under the client_attrs claim. This enables resource servers (e.g., EMQX) to use these attributes for ACLs and other dynamic configurations.

  • Database: Add metadata jsonb column to applications table via migration.
  • Backend:
    • Implement validation to ensure metadata keys are valid identifiers and do not collide with reserved JWT claims.
    • Update auth logic to resolve and sanitize application metadata during token generation.
  • Frontend:
    • Add UI for managing metadata key-value pairs in the Application Form Modal.
    • Implement client-side validation for metadata keys.
    • Update API types and mock data to support the new field.
    • Add i18n translations for metadata-related labels and errors.

Add a `metadata` field to applications, allowing administrators to define custom key-value pairs that are injected into issued JWTs under the `client_attrs` claim. This enables resource servers (e.g., EMQX) to use these attributes for ACLs and other dynamic configurations.

- Database: Add `metadata` jsonb column to `applications` table via migration.
- Backend:
    - Implement validation to ensure metadata keys are valid identifiers and do not collide with reserved JWT claims.
    - Update auth logic to resolve and sanitize application metadata during token generation.
- Frontend:
    - Add UI for managing metadata key-value pairs in the Application Form Modal.
    - Implement client-side validation for metadata keys.
    - Update API types and mock data to support the new field.
    - Add i18n translations for metadata-related labels and errors.
@x42en x42en self-assigned this May 4, 2026
@x42en x42en added the enhancement New feature or request label May 4, 2026
@x42en x42en merged commit 2402649 into main May 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant