Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.

Feature/upgrade to microservice#3

Merged
RandithaK merged 3 commits intodevfrom
feature/upgrade_to_microservice
Sep 28, 2025
Merged

Feature/upgrade to microservice#3
RandithaK merged 3 commits intodevfrom
feature/upgrade_to_microservice

Conversation

@RandithaK
Copy link
Copy Markdown
Member

No description provided.

RandithaK and others added 3 commits September 27, 2025 19:25
Implement role-based authentication and authorization system
Modifies the auth service to work correctly behind the new API Gateway. This involves removing gateway-specific configurations and fixing a critical JWT signature mismatch.

Changes:
1.  **Path Decoupling:**
    - Removed class-level `@RequestMapping` prefixes (e.g., `/api/v1/auth`) from `AuthController` and `UserController`.
    - Updated `SecurityConfig` to permit the stripped paths (e.g., `/login`, `/register`) that the service now receives from the gateway.
    - This resolves the `401 Unauthorized` errors on public endpoints.

2.  **JWT Signature Alignment:**
    - Modified `JwtUtil` to generate the signing key using `jwtSecret.getBytes(StandardCharsets.UTF_8)` instead of `Decoders.BASE64.decode()`.
    - This ensures the key generation logic matches the Go gateway's verification logic, fixing the `token signature is invalid` error.

3.  **CORS Delegation:**
    - Removed all `@CrossOrigin` annotations and the `CorsConfigurationSource` bean from `SecurityConfig`.
    - Responsibility for CORS is now fully delegated to the API Gateway, resolving the 'multiple Access-Control-Allow-Origin headers' browser error."
@RandithaK RandithaK merged commit 64f5400 into dev Sep 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant