Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-21109

add-user should be able to create user credentials in a separate directory

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • OpenShift, Security
    • None
    • ---
    • ---

      As discussed in WFLY-20611, we need to improve the user experience to create user credentials (application & management) for cloud deployment.

      One of the approach is to use add-users.sh script to create these user credentials outside of the server directory and inject them to the deployment as a secret.

      Currently, the add-user.sh script fails if the directories specified by -sc or -dc do not exist:

      mkdir users-secret
      ./target/server/bin/add-user.sh -sc users-secret
      
      What type of user do you wish to add?
       a) Management User (mgmt-users.properties)
       b) Application User (application-users.properties)
      (a): a
      
       * Error *
      WFLYDM0023: No mgmt-users.properties files found.
      

      We could add an option to create the required properties file if they do not exist.
      Something like:

      -cf, --create-files  Create files & directories if they do not exist
      

      With that enhancement, create a Kubernetes secret to hold the WildFly credentials would be:

      ./target/server/bin/add-user.sh -a -cf -u 'quickstartUser' -p 'quickstartPwd1!' -sc user-secrets
      kubectl create secret generic users-secret --from-file=users-secret
      

      This flag would be optional and disabled by default (to preserve the existing behaviour)

              rh-ee-rarosa Rafael Rosa
              jmesnil1@redhat.com Jeff Mesnil
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: