Skip to content

Instantly share code, notes, and snippets.

@aelkiss
Created August 8, 2019 16:12
Show Gist options
  • Save aelkiss/a53ab27c08fbeb83e35da3dc4da77580 to your computer and use it in GitHub Desktop.
Save aelkiss/a53ab27c08fbeb83e35da3dc4da77580 to your computer and use it in GitHub Desktop.
create fake user for ht useradmin
require 'faker'
user = {
userid: Faker::Internet.username,
displayname: Faker::Name.name,
email: Faker::Internet.email,
activity_contact: Faker::Internet.email,
approver: Faker::Internet.email,
authorizer: Faker::Internet.email,
usertype: ['staff','external','student'].sample,
role: ['corrections','cataloging','ssdproxy','crms','quality','staffdeveloper','staffsysadmin','replacement','ssd'].sample,
access: ['total','normal'].sample,
expires: Faker::Time.forward,
expire_type: ['expiresannually','expiresbiannually','expirescustom90','expirescustom60'].sample,
iprestrict: Faker::Internet.ip_v4_address,
mfa: 0,
identity_provider: Faker::Internet.url
}
@aelkiss
Copy link
Author

aelkiss commented Aug 8, 2019

Will need to escape the IP address but other than that this should be pretty good. You could also have a variant that creates an MFA-enabled user (iprestrict = null, mfa=1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment