Skip to content

Commit a73a7a6

Browse files
committed
Added doc reference for Invalid WF and WL audience.
1 parent f013aa5 commit a73a7a6

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

oauth2_http/java/com/google/auth/oauth2/ExternalAccountAuthorizedUserCredentials.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ public String getTrustBoundaryUrl() throws IOException {
230230
Matcher matcher = WORKFORCE_AUDIENCE_PATTERN.matcher(getAudience());
231231
if (!matcher.matches()) {
232232
throw new IllegalStateException(
233-
"The provided audience is not in the correct format for a workforce pool.");
233+
"The provided audience is not in the correct format for a workforce pool. "
234+
+ "Refer: https://docs.cloud.google.com/iam/docs/principal-identifiers");
234235
}
235236
String poolId = matcher.group("pool");
236237
return String.format(

oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,8 @@ public String getTrustBoundaryUrl() {
648648
}
649649

650650
throw new IllegalStateException(
651-
"The provided audience is not in a valid format for either a workload identity pool or a workforce pool.");
651+
"The provided audience is not in a valid format for either a workload identity pool or a workforce pool."
652+
+ " Refer: https://docs.cloud.google.com/iam/docs/principal-identifiers");
652653
}
653654

654655
@Nullable

oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,6 @@ TrustBoundary getTrustBoundary() {
339339
return trustBoundary;
340340
}
341341

342-
protected void setTrustBoundary(TrustBoundary trustBoundary) {
343-
this.trustBoundary = trustBoundary;
344-
}
345-
346342
/**
347343
* Refreshes the trust boundary by making a call to the trust boundary URL.
348344
*

oauth2_http/javatests/com/google/auth/oauth2/AwsCredentialsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ public void testRefresh_trustBoundarySuccess() throws IOException {
14221422
.setSubjectTokenType("subjectTokenType")
14231423
.build();
14241424

1425-
awsCredential.refreshAccessToken();
1425+
awsCredential.refresh();
14261426

14271427
TrustBoundary trustBoundary = awsCredential.getTrustBoundary();
14281428
assertNotNull(trustBoundary);

oauth2_http/javatests/com/google/auth/oauth2/ExternalAccountAuthorizedUserCredentialsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,8 @@ public void testRefresh_trustBoundaryFails_incorrectAudience() {
12691269
credentials.refresh();
12701270
});
12711271
assertEquals(
1272-
"The provided audience is not in the correct format for a workforce pool.",
1272+
"The provided audience is not in the correct format for a workforce pool. "
1273+
+ "Refer: https://docs.cloud.google.com/iam/docs/principal-identifiers",
12731274
exception.getMessage());
12741275
}
12751276

oauth2_http/javatests/com/google/auth/oauth2/ExternalAccountCredentialsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,8 @@ public void getTrustBoundaryUrl_invalidAudience_throws() {
13051305
});
13061306

13071307
assertEquals(
1308-
"The provided audience is not in a valid format for either a workload identity pool or a workforce pool.",
1308+
"The provided audience is not in a valid format for either a workload identity pool or a workforce pool. "
1309+
+ "Refer: https://docs.cloud.google.com/iam/docs/principal-identifiers",
13091310
exception.getMessage());
13101311
}
13111312

0 commit comments

Comments
 (0)