Skip to content

Feature/security#15

Open
jorge-romero wants to merge 9 commits intodevelopfrom
feature/security
Open

Feature/security#15
jorge-romero wants to merge 9 commits intodevelopfrom
feature/security

Conversation

@jorge-romero
Copy link
Copy Markdown
Contributor

This pull request introduces a new modular security layer for the project by adding a core-security module. The changes implement a flexible policy-based authorization system integrated with Spring Security and Azure AD JWT authentication. The security configuration is now externalized, supporting public endpoints and dynamic policy evaluation for API requests. The main areas of change are the addition of new security components, policy evaluation infrastructure, and configuration updates.

Security configuration and integration:

  • Added a new core-security module with its own pom.xml, including dependencies for Spring Security, OAuth2 resource server, and project contracts.
  • Introduced SecurityConfig and SecurityProperties to configure Spring Security, define public endpoints, and integrate JWT authentication with Azure AD. [1] [2]
  • Updated application.yaml to configure OAuth2 resource server with Azure AD issuer and define public endpoints for health checks.

Policy-based authorization system:

  • Implemented PolicyAuthorizationManager, PolicyEngine, and PolicyService to support dynamic, rule-based authorization decisions for API requests. These components resolve API definitions, retrieve relevant policies, and evaluate them to allow or deny access. [1] [2] [3]
  • Added PolicyContextFactory to build policy evaluation contexts from HTTP requests and JWT claims.

Policy evaluators:

  • Added AllowedClientsEvaluator and FlavorRestrictionEvaluator as concrete policy evaluators, supporting client-based and request-body-based authorization rules, respectively. [1] [2]

Authentication flow enforcement:

  • Added AuthTypeEnforcementFilter, AuthFlowResolver, and AuthFlowValidator to ensure that only allowed authentication flows (e.g., OBO, client credentials) are accepted for each API, with flow-specific validation. [1] [2] [3]

…ity module

- Deleted FlowPropertiesTest, FlowEnforcementAspectTest, FlowValidatorTest, SecurityExpressionRootTest classes as they are no longer needed.
- Updated pom.xml to add core-security module to the project structure.
- Introduced PolicyEngineTest to validate policy evaluation logic.
- Added PolicyServiceTest to ensure correct policy retrieval based on client ID.
- Created SecurityConfigTest to verify security configuration and filter chain setup.
- Implemented AuthTypeEnforcementFilterTest to test authentication flow enforcement.
- Added AuthFlowResolverTest to validate authentication flow resolution based on JWT claims.
- Created AzureJwtAuthenticationConverterTest for testing JWT authority extraction.
- Added ApiDefinitionResolverTest and CoreApiRegistryTest to ensure API definition resolution works as expected.
- Removed outdated CustomRoleConverterTest and SecurityConfigTest from the tests directory.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@github-actions
Copy link
Copy Markdown

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

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