Skip to content

Commit

Permalink
Refactor templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Akila94 committed Feb 13, 2024
1 parent 8e5018c commit e625932
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<property name="grantVerificationClaim" value = "{{grantVerificationClaim}}"/>
<property name="grantVerificationClaimValue" value="{{grantVerificationClaimValue}}"/>
<property name="shouldAllowValidation" value="{{shouldAllowValidation}}"/>
<class name="{{claimBasedAccessGrantValidator}}"/>
<class name="org.wso2.carbon.apimgt.gateway.mediators.ClaimBasedResourceAccessValidationMediator">
<property name="accessVerificationClaim" value = "{{accessVerificationClaim}}"/>
<property name="accessVerificationClaimValue" value="{{accessVerificationClaimValue}}"/>
<property name="accessVerificationClaimValueRegex" value="{{accessVerificationClaimValueRegex}}"/>
<property name="shouldAllowValidation" value="{{shouldAllowValidation}}"/>
</class>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"category": "Mediation",
"name": "jwtClaimBasedAccessValidator",
"version": "v1",
"displayName": "JWT claim based access grant validator",
"displayName": "JWT claim based access validator",
"description": "This policy validates configured claim name and value in this policy with the claim name and value sent in the JWT access token to grant access to the API resource.",
"applicableFlows": [
"request"
Expand All @@ -15,38 +15,37 @@
],
"policyAttributes": [
{
"name": "grantVerificationClaim",
"displayName": "Access grant claim name",
"description": "This should be the name the custom claim which is expected in the JWT access token",
"name": "accessVerificationClaim",
"displayName": "Access verification claim name",
"description": "This should be the name the custom claim which is expected in the JWT access token.",
"validationRegex": "^[a-zA-Z_]+$",
"type": "String",
"defaultValue": "aut",
"required": true
},
{
"name": "grantVerificationClaimValue",
"displayName": "Access grant claim value",
"description": "This should be the value of a custom claim which is expected in the JWT access token",
"name": "accessVerificationClaimValue",
"displayName": "Access verification claim value",
"description": "This should be the value of a custom claim which is expected in the JWT access token.",
"type": "String",
"defaultValue": "APPLICATION",
"required": true
},
{
"name": "shouldAllowValidation",
"displayName": "Allow claim based access grant validation",
"description": "If ticked, the claim based access grant validation will be performed.",
"type": "Boolean",
"defaultValue": "true",
"name": "accessVerificationClaimValueRegex",
"displayName": "Access verification claim value regex",
"description": "If a regex is provided, the claim values will be matched using this regex. Otherwise they will be checked for equality.",
"type": "String",
"defaultValue": "",
"required": false
},
{
"name": "claimBasedAccessGrantValidator",
"displayName": "JWT claim based access grant validation mediator",
"description": "Fully qualified class name for the validation implementation",
"validationRegex": "^([a-zA-Z_$][a-zA-Z\\d_$.]*)$",
"type": "String",
"defaultValue": "org.wso2.carbon.apimgt.gateway.mediators.ClaimBasedResourceAccessValidationMediator",
"required": true
"name": "shouldAllowValidation",
"displayName": "Allow flow when claims are not matching",
"description": "Tick this to allow the flow when the claims are not matching. Keeping this un-ticked will allow the flow only when the claims are matched.",
"type": "Boolean",
"defaultValue": "false",
"required": false
}
]
}

0 comments on commit e625932

Please sign in to comment.