necouchman commented on a change in pull request #471: GUACAMOLE-753: Add TOTP 
auth method to Docker image
URL: https://github.com/apache/guacamole-client/pull/471#discussion_r392621985
 
 

 ##########
 File path: guacamole-docker/bin/start.sh
 ##########
 @@ -536,6 +536,21 @@ END
 
 }
 
+##
+## Adds properties to guacamole.properties which configure the TOTP two-factor
+## authentication mechanism.
+##
+associate_totp() {
+    # Update config file
+    [ -n "$TOTP_ISSUER" ] && set_property "totp-issuer"    "$TOTP_ISSUER"
+    [ -n "$TOTP_DIGITS" ] && set_property "totp-digits"    "$TOTP_DIGITS"
+    [ -n "$TOTP_PERIOD" ] && set_property "totp-period"    "$TOTP_PERIOD"
+    [ -n "$TOTP_MODE" ]   && set_property "totp-mode"      "$TOTP_MODE"
 
 Review comment:
   This is the code for `set_optional_property()`:
   ```
   set_optional_property() {
       NAME="$1"
       VALUE="$2"
       # Set the property only if a value is provided
       if [ -n "$VALUE" ]; then
           set_property "$NAME" "$VALUE"
       fi
   }
   ```
   
   So, it's essentially duplicating what you're doing, no?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to