vvysotskyi commented on a change in pull request #2401:
URL: https://github.com/apache/drill/pull/2401#discussion_r795927690



##########
File path: exec/java-exec/src/main/java/org/apache/drill/exec/oauth/Tokens.java
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.oauth;
+
+/**
+ * Aliases table. Provides API for managing and obtaining aliases.

Review comment:
       Please fix javadoc

##########
File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/oauth/TokenRegistry.java
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.oauth;
+
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * Registry for public and user-owned aliases.

Review comment:
       Please fix javadoc

##########
File path: 
logical/src/main/java/org/apache/drill/common/logical/security/CredentialsProvider.java
##########
@@ -33,6 +37,20 @@
    * Returns map with authentication credentials. Key is the credential name, 
for example {@code "username"}
    * and map value is corresponding credential value.
    */
+  Logger logger = LoggerFactory.getLogger(CredentialsProvider.class);
+
   @JsonIgnore
   Map<String, String> getCredentials();
+
+  /**
+   * Set an ephemeral credential.  Implementations are not expected to write 
this
+   * value to persistent storage.
+   */
+  @JsonIgnore
+  default void setCredential(String key, String value) throws UserException {

Review comment:
       And please remove this one.

##########
File path: 
logical/src/main/java/org/apache/drill/common/logical/security/PlainCredentialsProvider.java
##########
@@ -47,6 +51,18 @@ public PlainCredentialsProvider(@JsonProperty("credentials") 
Map<String, String>
     return credentials;
   }
 
+  @Override
+  @JsonIgnore
+  public void setCredential(String key, String value) {

Review comment:
       Please delete this method as it is not used anywhere.

##########
File path: pom.xml
##########
@@ -467,6 +467,7 @@
             <exclude>**/*.dbf</exclude>
             <exclude>**/*.cnf</exclude>
             <exclude>**/*.access_log</exclude>
+            <exclude>**/success.ftl</exclude>

Review comment:
       Please fix the license header instead of excluding the file.

##########
File path: exec/java-exec/src/main/java/org/apache/drill/exec/oauth/Tokens.java
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.oauth;
+
+/**
+ * Aliases table. Provides API for managing and obtaining aliases.
+ */
+public interface Tokens {
+  /**
+   * Key of {@link this} tokens table.
+   */
+  String getKey();
+
+  /**
+   * Gets the current access token.
+   *
+   * @return The current access token
+   */
+  String getAccessToken();
+
+  /**
+   * Sets the access token.
+   *
+   * @param accessToken Sets the access token.
+   */
+  void setAccessToken(String accessToken);
+
+  String getRefreshToken();
+
+  void setRefreshToken(String refreshToken);
+
+  /**
+   * Returns value from tokens table that corresponds to provided plugin.
+   *
+   * @param token token of the value to obtain
+   * @return value from token table that corresponds to provided plugin
+   */
+  String get(String token);
+
+  /**
+   * Associates provided token with provided plugin in token table.
+   *
+   * @param token   alias of the value to associate with
+   * @param value   value that will be associated with provided alias
+   * @param replace whether existing value for the same alias should be 
replaced
+   * @return {@code true} if provided alias was associated with
+   * the provided value in aliases table

Review comment:
       And here




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to