BryanMLima commented on code in PR #6924:
URL: https://github.com/apache/cloudstack/pull/6924#discussion_r1033618883


##########
api/src/main/java/org/apache/cloudstack/api/response/LoginCmdResponse.java:
##########
@@ -163,4 +175,28 @@ public String getSessionKey() {
     public void setSessionKey(String sessionKey) {
         this.sessionKey = sessionKey;
     }
+
+    public String Is2FAenabled() {
+        return is2FAenabled;
+    }
+
+    public void set2FAenabled(String is2FAenabled) {
+        this.is2FAenabled = is2FAenabled;
+    }
+
+    public String Is2FAverfied() {

Review Comment:
   ```suggestion
       public String is2FAverfied() {
   ```



##########
api/src/main/java/org/apache/cloudstack/auth/UserTwoFactorAuthenticator.java:
##########
@@ -0,0 +1,45 @@
+// 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.cloudstack.auth;
+
+import com.cloud.exception.CloudAuthenticationException;
+import com.cloud.user.UserAccount;
+import com.cloud.utils.component.Adapter;
+
+public interface UserTwoFactorAuthenticator extends Adapter {
+
+    /**
+     * Returns the unique name of the provider
+     * @return returns provider name
+     */
+    String getName();
+
+    /**
+     * Returns description about the user 2FA provider plugin

Review Comment:
   ```suggestion
        * Returns the description about the user 2FA provider plugin
   ```



##########
api/src/main/java/org/apache/cloudstack/api/response/LoginCmdResponse.java:
##########
@@ -163,4 +175,28 @@ public String getSessionKey() {
     public void setSessionKey(String sessionKey) {
         this.sessionKey = sessionKey;
     }
+
+    public String Is2FAenabled() {

Review Comment:
   ```suggestion
       public String is2FAenabled() {
   ```



##########
api/src/main/java/com/cloud/user/UserAccount.java:
##########
@@ -67,4 +67,18 @@ public interface UserAccount extends InternalIdentity {
     public String getExternalEntity();
 
     public void setExternalEntity(String entity);
+
+    public boolean isTwoFactorAuthenticationEnabled();
+
+    public void setTwoFactorAuthenticationEnabled(boolean 
twoFactorAuthenticationEnabled);
+
+    public String getKeyFor2fa();
+
+    public void setKeyFor2fa(String keyFor2fa);
+
+    public String getUser2faProvider();
+
+    public void setUser2faProvider(String user2faProvider);

Review Comment:
   There are instances of `TwoFactorAuthentication` and `2fa` in this and 
others files as well. Maybe standardize the name to `2fa` as it is more concise.



##########
api/src/main/java/org/apache/cloudstack/auth/UserTwoFactorAuthenticator.java:
##########
@@ -0,0 +1,45 @@
+// 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.cloudstack.auth;
+
+import com.cloud.exception.CloudAuthenticationException;
+import com.cloud.user.UserAccount;
+import com.cloud.utils.component.Adapter;
+
+public interface UserTwoFactorAuthenticator extends Adapter {
+
+    /**
+     * Returns the unique name of the provider
+     * @return returns provider name
+     */
+    String getName();
+
+    /**
+     * Returns description about the user 2FA provider plugin
+     * @return returns description
+     */
+    String getDescription();
+
+    /**
+     * verifies the 2FA code provided by user

Review Comment:
   ```suggestion
        * Verifies the 2FA code provided by user
   ```



-- 
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