pub struct NewToken {
pub label: Option<String>,
pub expiration: Option<String>,
pub scopes: Option<Vec<String>>,
pub workspace_id: Option<String>,
pub read_only: Option<bool>,
pub super_admin: Option<bool>,
pub admin: Option<bool>,
pub allowed_ips: Option<Vec<String>>,
}Fields§
§label: Option<String>§expiration: Option<String>§scopes: Option<Vec<String>>§workspace_id: Option<String>Bind the token to this workspace: it is then refused on every other workspace and on instance-level endpoints. Omit for a token that reaches every workspace.
read_only: Option<bool>If true, the token is restricted to read-only HTTP methods (GET/HEAD/OPTIONS). Mutating endpoints and job-run actions are rejected with 403, regardless of the scopes attached.
super_admin: Option<bool>Carry the owner’s superadmin rights: admin in every workspace, including ones they are not a member of, and the superadmin endpoints. Defaults to false, and is ignored when the owner or the calling token does not hold them.
admin: Option<bool>Carry the owner’s workspace admin rights in the workspaces the token reaches. Defaults to false: the token then acts as a regular member. Ignored when the calling token does not hold them.
allowed_ips: Option<Vec<String>>IPs or CIDRs (IPv4 or IPv6) the token may be used from; omit to allow any. A request from elsewhere is refused as unauthenticated. A token that is itself restricted can only create tokens within its own networks, and creates one restricted to them when this is omitted.