Package io.deephaven.enterprise.auth
Class AuthServerForwarder
java.lang.Object
io.deephaven.enterprise.auth.AuthServerForwarder
- All Implemented Interfaces:
AutoCloseable
Class to manage requests that need to go to a specific authentication server origin. Eg, verifying tokens.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAuthServerForwarder(io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()verifyChallengeAsync(ClientId clientId, com.google.protobuf.ByteString publicKey, UserContext userContext, InetAddress addy, com.google.protobuf.ByteString challengeResponse, long remainingDeadlineTimeMillis) Asynchronously verify a challenge to the particular authentication server that generated it.verifyTokenToOriginAsync(String service, AuthToken authToken, long remainingDeadlineTimeMillis) Asynchronously verify an AuthToken to the particular authentication server that generated it.booleanverifyTokenToOriginOrThrow(String service, AuthToken authToken, long remainingDeadlineTimeMillis) Verify an AuthToken to the particular authentication server that generated it.
-
Field Details
-
LOG_PFX
- See Also:
-
-
Constructor Details
-
AuthServerForwarder
public AuthServerForwarder(io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient)
-
-
Method Details
-
verifyTokenToOriginAsync
public CompletableFuture<VerifyTokenResponse> verifyTokenToOriginAsync(String service, AuthToken authToken, long remainingDeadlineTimeMillis) Asynchronously verify an AuthToken to the particular authentication server that generated it.- Parameters:
service- The service for which the token is intendedauthToken- The auth tokenremainingDeadlineTimeMillis- How much time is remaining in the deadline for this request- Returns:
- a future representing the async operation
-
verifyTokenToOriginOrThrow
public boolean verifyTokenToOriginOrThrow(String service, AuthToken authToken, long remainingDeadlineTimeMillis) throws AuthServerForwarder.InvalidTokenOriginException Verify an AuthToken to the particular authentication server that generated it.- Parameters:
service- The service for which the token is intendedauthToken- The auth tokenremainingDeadlineTimeMillis- How much time is remaining in the deadline for this request- Returns:
- true if the token verifies correctly.
- Throws:
AuthServerForwarder.InvalidTokenOriginException- if the token origin address is not recognized as a valid origin address
-
verifyChallengeAsync
public CompletableFuture<VerifyChallengeResponse> verifyChallengeAsync(ClientId clientId, com.google.protobuf.ByteString publicKey, UserContext userContext, InetAddress addy, com.google.protobuf.ByteString challengeResponse, long remainingDeadlineTimeMillis) Asynchronously verify a challenge to the particular authentication server that generated it.- Parameters:
clientId- The client id of the requesting clientpublicKey- The public keyuserContext- The user contextaddy- The address where to forwardchallengeResponse- the challenge response to verifyremainingDeadlineTimeMillis- How much time is remaining in the deadline for this request- Returns:
- a future representing the async operation
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-