Skip to main content

osapi token

Generate and validate API tokens. osapi cli command get --name token shows the same.

Group​

Nametoken
DescriptionGenerate and validate API tokens

osapi token generate​

Methodgenerate
DescriptionGenerate a new token
Refusesno roles, an unknown role, no subject, an unknown permission

Flags (3)​

FLAGSHORTTYPEVALIDATEHELP
--rolesr[]stringrequired,dive,oneof=admin read writeRoles for the token
--subjectustringrequiredSubject for the token (e.g., user ID or unique identifier)
--permissionsp[]stringomitempty,dive,permissionDirect permissions, which override the roles; osapi token roles get --name admin lists each one

osapi token roles list​

Methodroles list
DescriptionList the roles and the permissions each grants

osapi token roles get​

Methodroles get
DescriptionShow a role and each permission it grants
Refusesno name

Flags (1)​

FLAGTYPEVALIDATEHELP
--namestringrequiredThe role, such as admin, or a custom role of the config.

osapi token validate​

Methodvalidate
DescriptionValidate a token for authenticity and claims
Refusesno token

Flags (1)​

FLAGSHORTTYPEVALIDATEHELP
--tokentstringrequiredThe Token string