Quarkus extension for Topaz, the aserto-dev/topaz authorizer. It provides a reactive gRPC client for the authorizer and the directory. It also adds a Dev Service, a readiness health check and a Dev UI card.
Maven:
<dependency>
<groupId>org.sitenetsoft</groupId>
<artifactId>quarkus-topaz</artifactId>
<version>0.1.0</version>
</dependency>Gradle:
implementation 'org.sitenetsoft:quarkus-topaz:0.1.0'Enforcement lives in a second artifact, quarkus-topaz-security. It provides:
- A
topazHTTP security policy for routes. It derives the policy path from the request, such astodoApp.DELETE.todos.__id. @TopazAuthorizeand@TopazCheckinterceptors for CDI bean methods.- An opt-in
@PermissionsAllowedbridge.
Every error denies. See Security.
<dependency>
<groupId>org.sitenetsoft</groupId>
<artifactId>quarkus-topaz-security</artifactId>
<version>0.1.0</version>
</dependency>Quarkus-zanzibar users can add quarkus-topaz-zanzibar. It supplies a RelationshipManager backed by the Topaz directory. Topaz then answers @FGARelation and the other quarkus-zanzibar annotations. The artifact also enables the quarkus-zanzibar filter, which by default denies REST endpoints without an annotation. See Zanzibar connector.
<dependency>
<groupId>org.sitenetsoft</groupId>
<artifactId>quarkus-topaz-zanzibar</artifactId>
<version>0.1.0</version>
</dependency>Put a Rego policy, a directory manifest and seed data under src/main/resources/topaz/. Point the Dev Service at them:
quarkus.topaz.devservices.policy.directory=classpath:topaz/policies
quarkus.topaz.devservices.manifest-location=classpath:topaz/manifest.yaml
quarkus.topaz.devservices.data-location=classpath:topaz/dataThen inject the client and ask for a decision:
@Inject
TopazClient topaz;
Uni<Boolean> allowed = topaz.authorizer().isAllowed(IdentityContexts.subject("rick@the-citadel.com"),
"todoApp.DELETE.todos.__id", "allowed", Map.of("id", "todo-1"));quarkus dev starts Topaz in a container, loads the manifest and data, and configures the client. The complete example is the todo application in integration-tests.
- Documentation.
mvn package -Pdocsbuilds it intodocs/target/generated-docs/. - Design spec
JAVA_HOME=/path/to/jdk-25 mvn -T 4 verifyWith rootless Podman, add DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock TESTCONTAINERS_RYUK_DISABLED=true. See Testing.
Releasing describes the release procedure, its secrets and the local rehearsal.