wso2 / carbon-apimgt

Apache License 2.0
165 stars 618 forks source link

Audience validation support for APIM #12404

Open Kirishikesan opened 3 months ago

Kirishikesan commented 3 months ago

Overview

API authentication with audience restriction in JWT (JSON Web Token) involves ensuring that the token is only accepted by the intended audience or recipients. The audience claim (aud) in a JWT specifies the intended recipients for the token. This PR adds api level audience validation in JWT tokens for api manager.

Resolves

https://github.com/wso2/api-manager/issues/2784

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 57.85714% with 59 lines in your changes are missing coverage. Please review.

Project coverage is 46.87%. Comparing base (af47e58) to head (371a2b7).

Files Patch % Lines
...i/publisher/v1/common/mappings/APIMappingUtil.java 51.85% 4 Missing and 9 partials :warning:
...gt/gateway/handlers/security/jwt/JWTValidator.java 44.44% 8 Missing and 2 partials :warning:
...t/rest/api/publisher/v1/dto/APIProductInfoDTO.java 22.22% 7 Missing :warning:
...pimgt/rest/api/publisher/v1/dto/APIProductDTO.java 40.00% 6 Missing :warning:
...arbon/apimgt/rest/api/publisher/v1/dto/APIDTO.java 44.44% 5 Missing :warning:
...n/apimgt/rest/api/publisher/v1/dto/APIInfoDTO.java 44.44% 5 Missing :warning:
...t/api/publisher/v1/common/TemplateBuilderUtil.java 60.00% 2 Missing and 2 partials :warning:
...ay/handlers/security/APIAuthenticationHandler.java 71.42% 0 Missing and 2 partials :warning:
...ateway/handlers/security/APISecurityConstants.java 0.00% 2 Missing :warning:
...on/apimgt/persistence/RegistryPersistenceImpl.java 66.66% 0 Missing and 2 partials :warning:
... and 2 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #12404 +/- ## ============================================ + Coverage 41.75% 46.87% +5.12% - Complexity 0 4203 +4203 ============================================ Files 1871 1871 Lines 138441 138575 +134 Branches 20045 20071 +26 ============================================ + Hits 57809 64961 +7152 + Misses 73634 65859 -7775 - Partials 6998 7755 +757 ``` | [Flag](https://app.codecov.io/gh/wso2/carbon-apimgt/pull/12404/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2) | Coverage Δ | | |---|---|---| | [integration_tests](https://app.codecov.io/gh/wso2/carbon-apimgt/pull/12404/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2) | `41.43% <57.85%> (+6.42%)` | :arrow_up: | | [unit_tests](https://app.codecov.io/gh/wso2/carbon-apimgt/pull/12404/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2) | `20.11% <20.38%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.