Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void tokenReceived(URI tokenUri)
.withMaxAttempts(-1)
.withMaxDuration(Duration.ofSeconds(4))
.withBackoff(100, 500, MILLIS)
.handleResultIf(code -> code != HTTP_OK))
.handleResultIf(code -> code >= 500))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about 4xx or 3xx?

.get(() -> {
Request request = prepareRequestBuilder(tokenUri)
.delete()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import static io.trino.server.security.oauth2.OAuth2TokenExchange.hashAuthId;
import static java.util.Objects.requireNonNull;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON_TYPE;
import static javax.ws.rs.core.MediaType.TEXT_PLAIN_TYPE;

@Path(OAuth2TokenExchangeResource.TOKEN_ENDPOINT)
public class OAuth2TokenExchangeResource
Expand Down Expand Up @@ -114,13 +115,15 @@ private static Response pendingResponse(HttpServletRequest request)
@ResourceSecurity(PUBLIC)
@DELETE
@Path("{authId}")
public void deleteAuthenticationToken(@PathParam("authId") UUID authId)
public Response deleteAuthenticationToken(@PathParam("authId") UUID authId)
{
if (authId == null) {
throw new BadRequestException();
}

tokenExchange.dropToken(authId);
return Response.ok("Authentication deleted", TEXT_PLAIN_TYPE)
.build();
}

public static String getTokenUri(UUID authId)
Expand Down