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

upd 0.31.1 #40

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
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
33 changes: 15 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
Expand All @@ -38,43 +38,45 @@ jobs:
run: brew tap aserto-dev/tap && brew install aserto-dev/tap/topaz && topaz install

- name: Run all tests
run: mvn clean test -Pintegration
run: mvn --no-transfer-progress clean test -Pintegration
release:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
name: Release to maven central
steps:
- name: Read Configuration
uses: hashicorp/vault-action@v2.5.0
uses: hashicorp/vault-action@v3
id: vault
with:
url: ${{ env.VAULT_ADDR }}
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/MavenCentral "USERNAME" | MAVEN_USERNAME;
kv/data/MavenCentral "PASSWORD" | MAVEN_PASSWORD;
kv/data/MavenCentral "PASSWORD" | MAVEN_CENTRAL_TOKEN;
kv/data/MavenCentral "GPG_PASSPHRASE" | MAVEN_GPG_PASSPHRASE;
kv/data/MavenCentral "PRIVATE_GPG_KEY" | GPG_PRIVATE_KEY;
kv/data/MavenCentral "PRIVATE_GPG_KEY" | MAVEN_GPG_PRIVATE_KEY;
kv/data/MavenCentral "TOKEN_USERNAME" | TOKEN_USERNAME;
kv/data/MavenCentral "TOKEN_PASSWORD" | TOKEN_PASSWORD;

- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ env.GPG_PRIVATE_KEY }}
server-username: TOKEN_USERNAME
server-password: TOKEN_PASSWORD
gpg-private-key: ${{ env.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: build artifact
run: mvn clean package
run: mvn --no-transfer-progress clean package

- name: Create release
uses: ncipollo/release-action@v1
Expand All @@ -84,9 +86,4 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to the Maven Central Repository
run: |
mvn \
--no-transfer-progress \
--batch-mode \
-Pci-cd \
deploy
run: mvn --no-transfer-progress --batch-mode -Pci-cd deploy
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2023 Aserto Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion 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.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.
> **0.31.1** 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 Down
6 changes: 3 additions & 3 deletions examples/authz-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.example</groupId>
<artifactId>authz-example</artifactId>
<version>1.0.0</version>
<version>1.0.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>19</maven.compiler.source>
Expand All @@ -18,7 +18,7 @@
<dependency>
<groupId>com.aserto</groupId>
<artifactId>aserto-java</artifactId>
<version>0.21.00</version>
<version>0.31.1</version>
</dependency>
</dependencies>

Expand All @@ -27,7 +27,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.6.0</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
Expand Down
6 changes: 3 additions & 3 deletions examples/directory-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.example</groupId>
<artifactId>directory-example</artifactId>
<version>0.0.1</version>
<version>1.0.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand All @@ -18,7 +18,7 @@
<dependency>
<groupId>com.aserto</groupId>
<artifactId>aserto-java</artifactId>
<version>0.21.00</version>
<version>0.31.1</version>
</dependency>
</dependencies>

Expand All @@ -27,7 +27,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.6.0</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
Expand Down
22 changes: 11 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.aserto</groupId>
<artifactId>aserto-java</artifactId>
<version>0.31.0</version>
<version>0.31.1</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>Java SDK to interact with aserto services</description>
Expand Down Expand Up @@ -41,34 +41,34 @@
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<grpc.version>1.60.1</grpc.version>
<log4j.version>2.22.0</log4j.version>
<grpc.version>1.64.0</grpc.version>
<log4j.version>2.23.1</log4j.version>
<exclude-tests>IntegrationTest</exclude-tests>
</properties>

<dependencies>
<dependency>
<groupId>com.aserto</groupId>
<artifactId>java-authorizer</artifactId>
<version>0.20.8</version>
<version>0.20.11</version>
</dependency>
<dependency>
<groupId>com.aserto</groupId>
<artifactId>java-directory</artifactId>
<version>0.31.0</version>
<version>0.31.2</version>
</dependency>

<!-- Used for unit testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.1</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.24.2</version>
<version>3.26.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -115,7 +115,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -146,7 +146,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -159,7 +159,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<version>3.7.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -174,7 +174,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/AuthzClientIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import utils.IntegrationTestsExtenion;
import utils.IntegrationTestsExtension;

import javax.net.ssl.SSLException;
import java.io.IOException;
Expand All @@ -16,7 +16,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;

@Tag("IntegrationTest")
@ExtendWith({IntegrationTestsExtenion.class})
@ExtendWith({IntegrationTestsExtension.class})
class AuthzClientIntegrationTest {
@Test
void testBuildAuthzClient() throws IOException {
Expand All @@ -25,7 +25,7 @@ void testBuildAuthzClient() throws IOException {
.withHost("localhost")
.withPort(8282)
.withInsecure(false)
.withCACertPath(System.getProperty("user.home") + "/.config/topaz/certs/grpc-ca.crt")
.withCACertPath(System.getProperty("user.home") + "/.local/share/topaz/certs/grpc-ca.crt")
.build();

AuthzClient authzClient = new AuthzClient(channel);
Expand Down
13 changes: 6 additions & 7 deletions src/test/java/DirectoryClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import io.grpc.StatusRuntimeException;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.extension.ExtendWith;
import utils.IntegrationTestsExtenion;
import utils.IntegrationTestsExtension;

import javax.net.ssl.SSLException;

Expand All @@ -29,7 +29,7 @@
import static org.junit.jupiter.api.Assertions.*;

@Tag("IntegrationTest")
@ExtendWith({IntegrationTestsExtenion.class})
@ExtendWith({IntegrationTestsExtension.class})
class DirectoryClientTest {
private static DirectoryClient directoryClient;
private static ManagedChannel channel;
Expand Down Expand Up @@ -138,7 +138,7 @@ void testGetUserWithNoRelations() throws UninitilizedClientException {
// Assert
assertThat(getObjectResponse.getResult())
.usingRecursiveComparison()
.comparingOnlyFields("objectType_", "objectId_")
.comparingOnlyFields("type_", "id_")
.isEqualTo(managerObject);
assertEquals(0, getObjectResponse.getRelationsList().size());
}
Expand All @@ -156,7 +156,7 @@ void testGetUserWithRelations() throws UninitilizedClientException {
// Assert
assertThat(getObjectResponse.getResult())
.usingRecursiveComparison()
.comparingOnlyFields("objectType_", "objectId_")
.comparingOnlyFields("type_", "id_")
.isEqualTo(managerObject);
assertThat(getObjectResponse.getRelationsList())
.usingRecursiveFieldByFieldElementComparatorOnFields("objectId_", "objectType_", "relation_", "subjectId_", "subjectType_")
Expand Down Expand Up @@ -311,7 +311,7 @@ void testGetGraph() {

// Assert
assertThat(getGraphResponse.getResultsList())
.usingRecursiveFieldByFieldElementComparatorOnFields("objectId_", "objectType_", "relation_", "subjectId_", "subjectType_")
.usingRecursiveFieldByFieldElementComparatorOnFields("objectType_", "objectId_")
.containsExactlyInAnyOrderElementsOf(objectDependencyList);
}

Expand Down Expand Up @@ -430,9 +430,8 @@ void importDataTest() throws InterruptedException, UninitilizedClientException {
// Assert
GetObjectsResponse getObjectsResponse = directoryClient.getObjects("user");
assertThat(getObjectsResponse.getResultsList())
.usingRecursiveFieldByFieldElementComparatorOnFields("objectId_", "objectType_", "relation_", "subjectId_", "subjectType_")
.usingRecursiveFieldByFieldElementComparatorOnFields("type_", "id_")
.containsAll(users);

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL;

public class IntegrationTestsExtenion implements BeforeAllCallback, ExtensionContext.Store.CloseableResource {
public class IntegrationTestsExtension implements BeforeAllCallback, ExtensionContext.Store.CloseableResource {

private static boolean started = false;
private static Topaz topaz;
Expand Down
Loading