| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
OPA Spring Security is a library that enables using OPA for authorization in Spring applications.
Add dependency using Maven
<dependency>
<groupId>com.bisnode.opa</groupId>
<artifactId>opa-filter-spring-boot-starter</artifactId>
<version>{version}</version>
</dependency>or Gradle
implementation 'com.bisnode.opa:opa-filter-spring-boot-starter:{version}'All properties are prefixed with opa.filter
| Property | Default value | Description | Example |
|---|---|---|---|
| enabled | true | Whether the filter should be enabled | |
| documentPath | Name of OPA document path to use for queries | "http/request/authz" | |
| instance | http://localhost:8181 | Address of OPA instance | |
| endpointsWhitelist | Comma-separated list of ant patterns to use for matching whitelisted endpoints | /ping,/info,/api-docs/** |
Currently, the filter sends following information to OPA:
Those properties are available in your policy's input.
Your OPA policy response should contain following properties:
Unknown properties are ignored.
Example OPA response would look as follows:
{ "result": { "allow": false, "reason": "You shall not pass" } }
When library denies access to the resource, AuthorizationFailureEvent is published and therefore can be used in user's code.
Build process and dependency management is done using Gradle. Tests are written in Spock.
Interested in contributing? Please, start by reading this document.
| Back | FazBrowse Home | New Git URL |