You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2022/05/13 14:31:05 UTC
[GitHub] [drill] cgivre commented on a diff in pull request #2547: DRILL-8223: Refactor auth modes dropping DRILL_PROCESS and allowing credential providers everywhere
cgivre commented on code in PR #2547:
URL: https://github.com/apache/drill/pull/2547#discussion_r872465743
##########
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StorageResources.java:
##########
@@ -276,24 +280,24 @@ public Response updateAccessToken(@PathParam("name") String name, OAuthTokenCont
public Response updateOAuthTokens(@PathParam("name") String name,
OAuthTokenContainer tokenContainer) {
try {
- if (storage.getPlugin(name).getConfig() instanceof CredentialedStoragePluginConfig) {
- DrillbitContext context = ((AbstractStoragePlugin) storage.getPlugin(name)).getContext();
- OAuthTokenProvider tokenProvider = context.getoAuthTokenProvider();
- PersistentTokenTable tokenTable = tokenProvider.getOauthTokenRegistry().getTokenTable(name);
-
- // Set the access and refresh token
- tokenTable.setAccessToken(tokenContainer.getAccessToken());
- tokenTable.setRefreshToken(tokenContainer.getRefreshToken());
-
- return Response.status(Status.OK)
- .entity("Access tokens have been updated.")
- .build();
- } else {
+ StoragePluginConfig config = storage.getPlugin(name).getConfig();
+ if (config.getValue("type") != "http") {
Review Comment:
@jnturton This is actually addressed in https://github.com/apache/drill/pull/2544. I refactored the OAuth stuff so that if other plugins needed to use OAuth, they can reuse almost all of what Drill already does.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org