Skip to content

Commit

Permalink
docs: update examples
Browse files Browse the repository at this point in the history
Update the example output in README to match the new JSON produced by
platform-go-middleware/identity.
  • Loading branch information
subpop committed Jan 18, 2024
1 parent 4587b38 commit f15a910
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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==
```

```
Expand All @@ -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
Expand Down

0 comments on commit f15a910

Please sign in to comment.