Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-binary-authorization</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies

```Groovy
implementation 'com.google.cloud:google-cloud-binary-authorization:1.1.0'
implementation 'com.google.cloud:google-cloud-binary-authorization:1.1.1'
```

If you are using SBT, add this to your dependencies

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-binary-authorization" % "1.1.0"
libraryDependencies += "com.google.cloud" % "google-cloud-binary-authorization" % "1.1.1"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ public final ListAttestorsPagedResponse listAttestors(ListAttestorsRequest reque
* while (true) {
* ListAttestorsResponse response =
* binauthzManagementServiceV1Beta1Client.listAttestorsCallable().call(request);
* for (Attestor element : response.getResponsesList()) {
* for (Attestor element : response.getAttestorsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.create()) {
* PolicyName name = PolicyName.ofProjectName("[PROJECT]");
* PolicyName name = PolicyName.ofLocationName("[LOCATION]");
* Policy response = systemPolicyV1Beta1Client.getSystemPolicy(name);
* }
* }</pre>
Expand Down Expand Up @@ -155,7 +155,7 @@ public SystemPolicyV1Beta1Stub getStub() {
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.create()) {
* PolicyName name = PolicyName.ofProjectName("[PROJECT]");
* PolicyName name = PolicyName.ofLocationName("[LOCATION]");
* Policy response = systemPolicyV1Beta1Client.getSystemPolicy(name);
* }
* }</pre>
Expand Down Expand Up @@ -206,7 +206,7 @@ public final Policy getSystemPolicy(String name) {
* try (SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.create()) {
* GetSystemPolicyRequest request =
* GetSystemPolicyRequest.newBuilder()
* .setName(PolicyName.ofProjectName("[PROJECT]").toString())
* .setName(PolicyName.ofLocationName("[LOCATION]").toString())
* .build();
* Policy response = systemPolicyV1Beta1Client.getSystemPolicy(request);
* }
Expand All @@ -231,7 +231,7 @@ public final Policy getSystemPolicy(GetSystemPolicyRequest request) {
* try (SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.create()) {
* GetSystemPolicyRequest request =
* GetSystemPolicyRequest.newBuilder()
* .setName(PolicyName.ofProjectName("[PROJECT]").toString())
* .setName(PolicyName.ofLocationName("[LOCATION]").toString())
* .build();
* ApiFuture<Policy> future =
* systemPolicyV1Beta1Client.getSystemPolicyCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.create()) {
* PolicyName name = PolicyName.ofProjectName("[PROJECT]");
* PolicyName name = PolicyName.ofLocationName("[LOCATION]");
* Policy response = systemPolicyV1Beta1Client.getSystemPolicy(name);
* }
* }</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ public final ListAttestorsPagedResponse listAttestors(Service.ListAttestorsReque
* while (true) {
* Service.ListAttestorsResponse response =
* binauthzManagementServiceV1Client.listAttestorsCallable().call(request);
* for (Resources.Attestor element : response.getResponsesList()) {
* for (Resources.Attestor element : response.getAttestorsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
* PolicyName name = PolicyName.ofProjectName("[PROJECT]");
* PolicyName name = PolicyName.ofLocationName("[LOCATION]");
* Resources.Policy response = systemPolicyV1Client.getSystemPolicy(name);
* }
* }</pre>
Expand Down Expand Up @@ -150,7 +150,7 @@ public SystemPolicyV1Stub getStub() {
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
* PolicyName name = PolicyName.ofProjectName("[PROJECT]");
* PolicyName name = PolicyName.ofLocationName("[LOCATION]");
* Resources.Policy response = systemPolicyV1Client.getSystemPolicy(name);
* }
* }</pre>
Expand Down Expand Up @@ -204,7 +204,7 @@ public final Resources.Policy getSystemPolicy(String name) {
* try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
* Service.GetSystemPolicyRequest request =
* Service.GetSystemPolicyRequest.newBuilder()
* .setName(PolicyName.ofProjectName("[PROJECT]").toString())
* .setName(PolicyName.ofLocationName("[LOCATION]").toString())
* .build();
* Resources.Policy response = systemPolicyV1Client.getSystemPolicy(request);
* }
Expand All @@ -229,7 +229,7 @@ public final Resources.Policy getSystemPolicy(Service.GetSystemPolicyRequest req
* try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
* Service.GetSystemPolicyRequest request =
* Service.GetSystemPolicyRequest.newBuilder()
* .setName(PolicyName.ofProjectName("[PROJECT]").toString())
* .setName(PolicyName.ofLocationName("[LOCATION]").toString())
* .build();
* ApiFuture<Resources.Policy> future =
* systemPolicyV1Client.getSystemPolicyCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
* PolicyName name = PolicyName.ofProjectName("[PROJECT]");
* PolicyName name = PolicyName.ofLocationName("[LOCATION]");
* Resources.Policy response = systemPolicyV1Client.getSystemPolicy(name);
* }
* }</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void tearDown() throws Exception {
public void getSystemPolicyTest() throws Exception {
Policy expectedResponse =
Policy.newBuilder()
.setName(PolicyName.ofProjectName("[PROJECT]").toString())
.setName(PolicyName.ofLocationName("[LOCATION]").toString())
.setDescription("description-1724546052")
.addAllAdmissionWhitelistPatterns(new ArrayList<AdmissionWhitelistPattern>())
.putAllClusterAdmissionRules(new HashMap<String, AdmissionRule>())
Expand All @@ -94,7 +94,7 @@ public void getSystemPolicyTest() throws Exception {
.build();
mockSystemPolicyV1Beta1.addResponse(expectedResponse);

PolicyName name = PolicyName.ofProjectName("[PROJECT]");
PolicyName name = PolicyName.ofLocationName("[LOCATION]");

Policy actualResponse = client.getSystemPolicy(name);
Assert.assertEquals(expectedResponse, actualResponse);
Expand All @@ -116,7 +116,7 @@ public void getSystemPolicyExceptionTest() throws Exception {
mockSystemPolicyV1Beta1.addException(exception);

try {
PolicyName name = PolicyName.ofProjectName("[PROJECT]");
PolicyName name = PolicyName.ofLocationName("[LOCATION]");
client.getSystemPolicy(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
Expand All @@ -128,7 +128,7 @@ public void getSystemPolicyExceptionTest() throws Exception {
public void getSystemPolicyTest2() throws Exception {
Policy expectedResponse =
Policy.newBuilder()
.setName(PolicyName.ofProjectName("[PROJECT]").toString())
.setName(PolicyName.ofLocationName("[LOCATION]").toString())
.setDescription("description-1724546052")
.addAllAdmissionWhitelistPatterns(new ArrayList<AdmissionWhitelistPattern>())
.putAllClusterAdmissionRules(new HashMap<String, AdmissionRule>())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void tearDown() throws Exception {
public void getSystemPolicyTest() throws Exception {
Resources.Policy expectedResponse =
Resources.Policy.newBuilder()
.setName(PolicyName.ofProjectName("[PROJECT]").toString())
.setName(PolicyName.ofLocationName("[LOCATION]").toString())
.setDescription("description-1724546052")
.addAllAdmissionWhitelistPatterns(new ArrayList<Resources.AdmissionWhitelistPattern>())
.putAllClusterAdmissionRules(new HashMap<String, Resources.AdmissionRule>())
Expand All @@ -96,7 +96,7 @@ public void getSystemPolicyTest() throws Exception {
.build();
mockSystemPolicyV1.addResponse(expectedResponse);

PolicyName name = PolicyName.ofProjectName("[PROJECT]");
PolicyName name = PolicyName.ofLocationName("[LOCATION]");

Resources.Policy actualResponse = client.getSystemPolicy(name);
Assert.assertEquals(expectedResponse, actualResponse);
Expand All @@ -119,7 +119,7 @@ public void getSystemPolicyExceptionTest() throws Exception {
mockSystemPolicyV1.addException(exception);

try {
PolicyName name = PolicyName.ofProjectName("[PROJECT]");
PolicyName name = PolicyName.ofLocationName("[LOCATION]");
client.getSystemPolicy(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
Expand All @@ -131,7 +131,7 @@ public void getSystemPolicyExceptionTest() throws Exception {
public void getSystemPolicyTest2() throws Exception {
Resources.Policy expectedResponse =
Resources.Policy.newBuilder()
.setName(PolicyName.ofProjectName("[PROJECT]").toString())
.setName(PolicyName.ofLocationName("[LOCATION]").toString())
.setDescription("description-1724546052")
.addAllAdmissionWhitelistPatterns(new ArrayList<Resources.AdmissionWhitelistPattern>())
.putAllClusterAdmissionRules(new HashMap<String, Resources.AdmissionRule>())
Expand Down