-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use aserto-java 0.21.0 in examples. (#30)
- Loading branch information
1 parent
29a8c04
commit 9216989
Showing
4 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/authz-example/src/main/java/org/example/AuthzExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
package org.example; | ||
|
||
import com.aserto.ChannelBuilder; | ||
import com.aserto.directory.v3.DirectoryClient; | ||
import com.aserto.directory.common.v3.ObjectIdentifier; | ||
import com.aserto.directory.reader.v3.GetObjectManyResponse; | ||
import com.aserto.directory.reader.v3.GetObjectResponse; | ||
import com.aserto.directory.reader.v3.GetObjectsResponse; | ||
import com.aserto.directory.v3.DirectoryClient; | ||
|
||
import com.aserto.directory.v3.Directory; | ||
import com.aserto.directory.v3.UninitilizedClientException; | ||
import io.grpc.ManagedChannel; | ||
|
||
import javax.net.ssl.SSLException; | ||
import java.util.List; | ||
|
||
public class DirectoryExample { | ||
public static void main(String[] args) throws SSLException { | ||
public static void main(String[] args) throws SSLException, UninitilizedClientException { | ||
// create a channel that has the connection details | ||
ManagedChannel channel = new ChannelBuilder() | ||
.withHost("localhost") | ||
|
@@ -29,19 +31,19 @@ public static void main(String[] args) throws SSLException { | |
getObjectManyRequest(directoryClient); | ||
} | ||
|
||
public static void getUserExample(DirectoryClient directoryClient) { | ||
public static void getUserExample(DirectoryClient directoryClient) throws UninitilizedClientException { | ||
System.out.println("------ Get user example ------"); | ||
GetObjectResponse getObjectResponse = directoryClient.getObject("user", "[email protected]", false); | ||
System.out.println(getObjectResponse); | ||
} | ||
|
||
public static void getUsersExample(DirectoryClient directoryClient) { | ||
public static void getUsersExample(DirectoryClient directoryClient) throws UninitilizedClientException { | ||
System.out.println("------ Get users example ------"); | ||
GetObjectsResponse getObjectsResponse = directoryClient.getObjects("user", 100, ""); | ||
System.out.println(getObjectsResponse); | ||
} | ||
|
||
public static void getObjectManyRequest(DirectoryClient directoryClient) { | ||
public static void getObjectManyRequest(DirectoryClient directoryClient) throws UninitilizedClientException { | ||
System.out.println("------ Get object many example ------"); | ||
List<ObjectIdentifier> objects = List.of( | ||
Directory.buildObjectIdentifier("user", "[email protected]"), | ||
|