From 6a996dcdb2d9cb8f92702ef6e278fc4c3b0681ec Mon Sep 17 00:00:00 2001 From: Link Dupont Date: Thu, 18 Jan 2024 13:58:53 -0500 Subject: [PATCH] docs: update examples Update the example output in README to match the new JSON produced by platform-go-middleware/identity. --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a6a7476..70efb05 100644 --- a/README.md +++ b/README.md @@ -26,29 +26,30 @@ specified type. Any flag set will be inserted instead of a random value. All remaining fields will be filled with a suitably random value. SUBCOMMANDS - user generate a user identity JSON record - internal generate an internal identity JSON record - system generate a system identity JSON record - associate generate an associate identity JSON record + user generate a user identity JSON record + internal generate an internal identity JSON record + system generate a system identity JSON record + associate generate an associate identity JSON record + service-account generate a service account identity JSON record FLAGS - -account-number ... set the identity.account_number field (string) - -auth-type ... set the identity.authtype field (string) - -employe-account-number ... set the identity.employee_account_number field (string) - -org-id ... set the identity.org_id field (string) - -type ... set the identity.type field (string) + -account-number value set the identity.account_number field (string) + -auth-type value set the identity.authtype field (string) + -employe-account-number value set the identity.employee_account_number field (string) + -org-id value set the identity.org_id field (string) + -type value set the identity.type field (string) ``` ### Examples ``` $ xrhidgen user -email someuser@redhat.com -{"identity":{"account_number":"16349","auth_type":"cert","employee_account_number":"06900","internal":{"org_id":"51818"},"org_id":"51818","type":"User","user":{"email":"someuser@redhat.com","first_name":"Quinn","is_active":true,"is_internal":true,"is_org_admin":true,"last_name":"Runolfsdottir","locale":"se","user_id":"taps","username":"dunstable"}}} +{"identity":{"org_id":"45841","internal":{"org_id":"45841"},"user":{"username":"backbencher","email":"someuser@redhat.com","first_name":"Cira","last_name":"Roob","is_active":false,"is_org_admin":true,"is_internal":false,"locale":"li","user_id":"nicole"},"system":{},"associate":{"Role":null,"email":"","givenName":"","rhatUUID":"","surname":""},"x509":{"subject_dn":"","issuer_dn":""},"service_account":{"client_id":"","username":""},"type":"User","auth_type":"cert-auth"},"entitlements":null} ``` ``` $ xrhidgen system | base64 -w0 -eyJpZGVudGl0eSI6eyJhY2NvdW50X251bWJlciI6IjQ0NDY4OCIsImVtcGxveWVlX2FjY291bnRfbnVtYmVyIjoiIiwib3JnX2lkIjoiODEzNTIiLCJzeXN0ZW0iOnsiY2VydF90eXBlIjoiIiwiY2x1c3Rlcl9pZCI6ImNjWWJhTllCIiwiY24iOiJhYzRlM2RmYy1kOGU3LTQwODUtYjg3YS0zMTcyZjU1M2I3M2UifSwidHlwZSI6IiJ9fQo= +eyJpZGVudGl0eSI6eyJvcmdfaWQiOiIyMTcwMyIsImludGVybmFsIjp7Im9yZ19pZCI6IjIxNzAzIn0sInVzZXIiOnsidXNlcm5hbWUiOiIiLCJlbWFpbCI6IiIsImZpcnN0X25hbWUiOiIiLCJsYXN0X25hbWUiOiIiLCJpc19hY3RpdmUiOmZhbHNlLCJpc19vcmdfYWRtaW4iOmZhbHNlLCJpc19pbnRlcm5hbCI6ZmFsc2UsImxvY2FsZSI6IiIsInVzZXJfaWQiOiIifSwic3lzdGVtIjp7ImNuIjoiRyIsImNlcnRfdHlwZSI6ImNvbnN1bWVyIiwiY2x1c3Rlcl9pZCI6IkhKbyJ9LCJhc3NvY2lhdGUiOnsiUm9sZSI6bnVsbCwiZW1haWwiOiIiLCJnaXZlbk5hbWUiOiIiLCJyaGF0VVVJRCI6IiIsInN1cm5hbWUiOiIifSwieDUwOSI6eyJzdWJqZWN0X2RuIjoiIiwiaXNzdWVyX2RuIjoiIn0sInNlcnZpY2VfYWNjb3VudCI6eyJjbGllbnRfaWQiOiIiLCJ1c2VybmFtZSI6IiJ9LCJ0eXBlIjoiU3lzdGVtIiwiYXV0aF90eXBlIjoiYmFzaWMtYXV0aCJ9LCJlbnRpdGxlbWVudHMiOm51bGx9Cg== ``` ``` @@ -60,7 +61,7 @@ used to initialize the generator to a deterministic state. ``` $ SEED=100 xrhidgen user -{"identity":{"auth_type":"basic","employee_account_number":"02299","internal":{"org_id":"41123"},"org_id":"41123","type":"User","user":{"email":"winnifredwinning@shred.org","first_name":"Cameron","is_active":false,"is_internal":false,"is_org_admin":false,"last_name":"Stehr","locale":"fi","user_id":"meredeth","username":"skeptic"}}} +{"identity":{"employee_account_number":"02299","org_id":"41123","internal":{"org_id":"41123"},"user":{"username":"skeptic","email":"winnifredwinning@shred.org","first_name":"Cameron","last_name":"Stehr","is_active":false,"is_org_admin":false,"is_internal":false,"locale":"fi","user_id":"meredeth"},"system":{},"associate":{"Role":null,"email":"","givenName":"","rhatUUID":"","surname":""},"x509":{"subject_dn":"","issuer_dn":""},"service_account":{"client_id":"","username":""},"type":"User","auth_type":"basic-auth"},"entitlements":null} ``` ## Go package