# Configuration file
quarkus.oidc.auth-server-url=${keycloak.url}/realms/quarkus
quarkus.oidc.client-id=quarkus-app
quarkus.oidc.credentials.secret=secret
quarkus.http.cors=true

# Enable Policy Enforcement
quarkus.keycloak.policy-enforcer.enable=true
quarkus.keycloak.policy-enforcer.enforcement-mode=PERMISSIVE

# Defines a global claim to be sent to Keycloak when evaluating permissions for any requesting coming to the application
quarkus.keycloak.policy-enforcer.claim-information-point.claims.request-uri={request.relativePath}
quarkus.keycloak.policy-enforcer.claim-information-point.claims.request-method={request.method}

# Defines a static claim that is only sent to Keycloak when evaluating permissions for a specific path
quarkus.keycloak.policy-enforcer.paths.1.name=Permission Resource
quarkus.keycloak.policy-enforcer.paths.1.path=/api/permission
quarkus.keycloak.policy-enforcer.paths.1.claim-information-point.claims.static-claim=static-claim

# Defines a claim which value references a request parameter
quarkus.keycloak.policy-enforcer.paths.2.path=/api/permission/claim-protected
quarkus.keycloak.policy-enforcer.paths.2.claim-information-point.claims.grant={request.parameter['grant']}

# Defines a claim which value is based on the response from an external service
quarkus.keycloak.policy-enforcer.paths.3.path=/api/permission/http-response-claim-protected
quarkus.keycloak.policy-enforcer.paths.3.claim-information-point.http.claims.user-name=/userName
quarkus.keycloak.policy-enforcer.paths.3.claim-information-point.http.url=http://localhost:8081/api/users/me
quarkus.keycloak.policy-enforcer.paths.3.claim-information-point.http.method=GET
quarkus.keycloak.policy-enforcer.paths.3.claim-information-point.http.headers.Content-Type=application/x-www-form-urlencoded
quarkus.keycloak.policy-enforcer.paths.3.claim-information-point.http.headers.Authorization=Bearer {keycloak.access_token}

# Disables policy enforcement for a path
quarkus.keycloak.policy-enforcer.paths.4.path=/api/public
quarkus.keycloak.policy-enforcer.paths.4.enforcement-mode=DISABLED

# Defines a claim which value is based on the response from an external service
quarkus.keycloak.policy-enforcer.paths.5.path=/api/permission/body-claim
quarkus.keycloak.policy-enforcer.paths.5.claim-information-point.claims.from-body={request.body['/from-body']}

