This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
manuals:vps:api [2024/01/02 20:44] – Update auth methods aither | manuals:vps:api [2024/01/02 20:52] – Scopes aither | ||
---|---|---|---|
Line 65: | Line 65: | ||
The type of token and time period by which its validity is extended is chosen | The type of token and time period by which its validity is extended is chosen | ||
by the client. | by the client. | ||
+ | |||
+ | ===== Scopes ===== | ||
+ | Authentication tokens can be restricted to selected actions. Each action has its own scope, | ||
+ | you can find the available scopes in the documentation. You can configure scopes when you're | ||
+ | requesting a new authentication token. | ||
+ | |||
+ | Example scopes: | ||
+ | |||
+ | * '' | ||
+ | * an empty scope will allow access only to '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | Scopes can contain globs for resource and action names. Action name is separated from resource name by a hash (''#'' | ||
===== CLI ===== | ===== CLI ===== | ||
Line 295: | Line 312: | ||
--user USER User name | --user USER User name | ||
--password PASSWORD | --password PASSWORD | ||
+ | --scope [SCOPE] | ||
--token TOKEN Token | --token TOKEN Token | ||
--token-lifetime LIFETIME | --token-lifetime LIFETIME | ||
Line 339: | Line 357: | ||
access to '' | access to '' | ||
</ | </ | ||
+ | |||
+ | Specify a scope: | ||
+ | |||
+ | < | ||
+ | $ vpsfreectl --auth token --scope ' | ||
+ | </ | ||
+ | |||
+ | The command above will ask for an authentication token that will only be allowed to call actions on the vps resource and only on VPS with ID 123. | ||
==== Actions and Parameters ==== | ==== Actions and Parameters ==== |