Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the readme #31

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Java library for Aserto services

> **Warning**
>
> **0.20.9** is the latest version published to maven central. Versions starting with 1.0.z have been removed from maven central and are no longer available for download.
> **0.21.0** is the latest version published to maven central. Versions starting with 1.0.z have been removed from maven central and are no longer available for download.

### Build
`mvn clean install`
Expand All @@ -25,14 +25,15 @@ mvn clean test
```

### Run integration tests
In order to run integration tests we need to start [topaz](https://github.com/aserto-dev/topaz)
In order to run integration tests we need to have [topaz](https://github.com/aserto-dev/topaz) installed
```bash
go install github.com/topaz/cmd/topaz@latest
topaz install
topaz configure -d -s -r ghcr.io/aserto-policies/policy-todo-rebac:latest todo
topaz run
```
and then run the integration tests

The integration tests start topaz and configure it for testing. The tests will fail if topaz is not installed.
If you have topaz configured, no worries, the tests will save the configuration and restore it after the integration tests are finished.
To run the integration tests use the fallowing command:
```
mvn test -Pintegration
```
Expand All @@ -42,7 +43,7 @@ mvn test -Pintegration
mvn clean deploy -Dgpg.passphrase="<gpg-passphrase>" -Pci-cd
```

## Example
## Authorization Example
Start [topaz](https://github.com/aserto-dev/topaz)

```java
Expand All @@ -54,7 +55,7 @@ ManagedChannel channel = new ChannelBuilder()
.build();

// create authz client
AuthorizerClient authzClient = new AuthzClient(channel);
AuthorizerClient authzClient = new AuthzClient(channel);

// identity context contains information abou the user that requests access to some resource
IdentityCtx identityCtx = new IdentityCtx("[email protected]", IdentityType.IDENTITY_TYPE_SUB);
Expand All @@ -72,3 +73,4 @@ decisions.forEach(decision -> {
System.out.println("For decision [" + dec + "] the answer was [" + isAllowed + "]");
});
```
For more examples have a look in the [examples](examples) folder.