Confine a token
Confines (restricts) a token provided in serialized form with given caveats. Returns the confined token. Does not verify the token.
This operation has public access.
Example cURL requests
Confine a token
curl -d '{
"token": "MDAxNmxvY2F00aW9uIHJlZ2lzdHJ5CjAwM2JpZGVudGlmaW",
"caveats": [{"type": "time", "validUntil": 1571147494}]
}' \
-H 'Content-type: application/json' \
https://$HOST/api/v3/onezone/tokens/confine
Request body
The token to be confined and caveats.
| Property | Type & Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
token required string (SerializedToken) The token in serialized form. | |||||||||||||||||||||||||||||
caveats required array of objects (Caveat) A list of caveats that confine the token.
| |||||||||||||||||||||||||||||
Request Examples
echo '{"token": "MDAx...", "caveats": [{"type": "time", "validUntil": 1571147494}]}' | onezone-rest-cli confineToken -Responses
Returns the confined token.
| Property | Type & Description |
|---|---|
token string (SerializedToken) The token in serialized form. | |
Invalid request.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}