Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. artifactoryUserCreate () {
  2. local artifactory_url=$1
  3. local username=$2
  4. local password=$3
  5. local new_user=$4
  6. local new_pass=$5
  7. local request_body=$(cat <<EOF
  8. {
  9. "name" : "$new_user",
  10. "email" : "test@jfrog.com",
  11. "password": "$new_pass",
  12. "admin" : false,
  13. "profileUpdatable" : true,
  14. "internalPasswordDisabled" : false,
  15. "groups" : [ "testers", "readers" ],
  16. "lastLoggedInMillis" : 0,
  17. "realm" : "internal",
  18. "offlineMode" : false,
  19. "disableUIAccess" : false
  20. }
  21. EOF
  22. )
  23.  
  24. curl --silent -u${username}:${password} -X PUT \
  25. ${artifactory_url}/api/security/users/${new_user} -H 'Content-Type: application/json' -d "${request_body}"
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement