Skip to content

feat: add JWT authentication and role-based API access - #9

Merged
nooby6 merged 9 commits into
mainfrom
feat/jwt-auth-rbac
Oct 16, 2026
Merged

nooby6 merged 9 commits into
mainfrom
feat/jwt-auth-rbac

Conversation

@nooby6

@nooby6 nooby6 commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add Spring Security OAuth2 Resource Server support for JWT bearer tokens.
  • Validate JWTs against configurable OIDC issuer and JWK-set endpoints.
  • Map top-level roles and Keycloak realm_access.roles claims to Spring role authorities.
  • Require authentication for every API route.
  • Restrict employee creation and leave mutations to ADMIN/HR, and shift mutations to ADMIN/SCHEDULER.
  • Derive shift/leave audit actor IDs from the validated JWT sub claim instead of trusting X-Actor-Id.
  • Add converter and MockMvc authorization tests.
  • Document role policies and the requirement to provision an OIDC identity provider.

Security notes

This PR configures the resource server; it does not deploy an identity provider or create users/roles. Configure JWT_ISSUER_URI and JWT_JWK_SET_URI to match the deployed provider.

Validation

GitHub Actions will run the Gradle suite, including PostgreSQL integration tests.

@nooby6
nooby6 merged commit 28b2bac into main Oct 16, 2026
1 check passed
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