Skip to content

Feature/security#15

Merged
angelmp01 merged 18 commits intodevelopfrom
feature/security
Apr 1, 2026
Merged

Feature/security#15
angelmp01 merged 18 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.
@github-actions
Copy link
Copy Markdown

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

…pdate imports in tests

- Moved MarketplaceExternalServicePlaceholder to its own file for better modularity
- Updated ComponentsFacade and ComponentsServiceTest to reference the new class location
- Cleaned up unused imports and improved static import specificity in test classes
- Minor code cleanup in PolicyAuthorizationManager and PolicyService
@github-actions
Copy link
Copy Markdown

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@github-actions
Copy link
Copy Markdown

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

…rite requests and update SecurityConfig to include CachedBodyRequestFilter
…rt reading request bodies multiple times; refactor ClientCredentialFlowValidator and FlavorRestrictionEvaluator for improved clarity
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

…for setting API definition attribute; update SecurityUtils to simplify error message for invalid authentication tokens
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@angelmp01 angelmp01 merged commit 28b7333 into develop Apr 1, 2026
3 of 4 checks passed
@angelmp01 angelmp01 deleted the feature/security branch April 1, 2026 15:15
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.

2 participants