osapi token
Generate and validate API tokens. osapi cli command get --name token shows the
same.
Group
| Name | token |
| Description | Generate and validate API tokens |
osapi token generate
| Method | generate |
| Description | Generate a new token |
| Refuses | no roles, an unknown role, no subject, an unknown permission |
Flags (3)
| FLAG | SHORT | TYPE | VALIDATE | HELP |
|---|---|---|---|---|
| --roles | r | []string | required,dive,oneof=admin read write | Roles for the token |
| --subject | u | string | required | Subject for the token (e.g., user ID or unique identifier) |
| --permissions | p | []string | omitempty,dive,permission | Direct permissions, which override the roles; osapi token roles get --name admin lists each one |
osapi token roles list
| Method | roles list |
| Description | List the roles and the permissions each grants |
osapi token roles get
| Method | roles get |
| Description | Show a role and each permission it grants |
| Refuses | no name |
Flags (1)
| FLAG | TYPE | VALIDATE | HELP |
|---|---|---|---|
| --name | string | required | The role, such as admin, or a custom role of the config. |
osapi token validate
| Method | validate |
| Description | Validate a token for authenticity and claims |
| Refuses | no token |
Flags (1)
| FLAG | SHORT | TYPE | VALIDATE | HELP |
|---|---|---|---|---|
| --token | t | string | required | The Token string |