Skip to content

Commit 2056ca3

Browse files
committed
Enhancements: Fix doc error, add method placeholder, rename function.
1 parent 272db77 commit 2056ca3

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

cab-token-generator/java/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactory.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import com.google.auth.Credentials;
3939
import com.google.auth.http.HttpTransportFactory;
4040
import com.google.auth.oauth2.AccessToken;
41+
import com.google.auth.oauth2.CredentialAccessBoundary;
4142
import com.google.auth.oauth2.GoogleCredentials;
4243
import com.google.auth.oauth2.OAuth2Utils;
4344
import com.google.auth.oauth2.StsRequestHandler;
@@ -60,7 +61,7 @@ private ClientSideCredentialAccessBoundaryFactory(Builder builder) {
6061
this.tokenExchangeEndpoint = builder.tokenExchangeEndpoint;
6162
}
6263

63-
private void refreshIntermediateCredentials() throws IOException {
64+
private void refreshCredentials() throws IOException {
6465
try {
6566
this.sourceCredential.refreshIfExpired();
6667
} catch (IOException e) {
@@ -100,6 +101,16 @@ private void refreshIntermediateCredentials() throws IOException {
100101
}
101102
}
102103

104+
private void refreshCredentialsIfRequired() {
105+
// TODO(negarb): Implement refreshCredentialsIfRequired
106+
throw new UnsupportedOperationException("refreshCredentialsIfRequired is not yet implemented.");
107+
}
108+
109+
public AccessToken generateToken(CredentialAccessBoundary accessBoundary) {
110+
// TODO(negarb/jiahuah): Implement generateToken
111+
throw new UnsupportedOperationException("generateToken is not yet implemented.");
112+
}
113+
103114
public static Builder newBuilder() {
104115
return new Builder();
105116
}
@@ -113,11 +124,12 @@ public static class Builder {
113124
private Builder() {}
114125

115126
/**
116-
* Sets the required source credential used to acquire the intermediary credential.
127+
* Sets the required source credential.
117128
*
118129
* @param sourceCredential the {@code GoogleCredentials} to set
119130
* @return this {@code Builder} object
120131
*/
132+
@CanIgnoreReturnValue
121133
public Builder setSourceCredential(GoogleCredentials sourceCredential) {
122134
this.sourceCredential = sourceCredential;
123135
return this;

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@
4040
import javax.annotation.Nullable;
4141

4242
/**
43-
* Represents an OAuth 2.0 token exchange request to the Google Security Token Service (STS), as
44-
* defined in <a href="https://tools.ietf.org/html/rfc8693#section-2.1">RFC 8693, Section 2.1</a>.
43+
* Represents a successful OAuth 2.0 token exchange response from the Google Security Token Service
44+
* (STS), as defined in <a href="https://tools.ietf.org/html/rfc8693#section-2.2.1">RFC 8693,
45+
* Section 2.2.1</a>.
4546
*
46-
* <p>This class encapsulates the parameters for the request, including the subject token and its
47-
* type, along with optional parameters like acting party, scopes, resource, audience, requested
48-
* token type, and internal options.
47+
* <p>This class provides access to the exchanged access token, issued token type, token type,
48+
* expiration time, refresh token (optional), scopes (optional), and the access boundary session key
49+
* (optional).
4950
*
50-
* <p>Instances are immutable. Use {@link #newBuilder(String, String, String)} to create a builder.
51+
* <p>Instances are immutable. Use {@link #newBuilder(String, String, String)} to create an
52+
* instance.
5153
*/
5254
public final class StsTokenExchangeResponse {
5355
private final AccessToken accessToken;

0 commit comments

Comments
 (0)