10346: Document manifest format in more detail. Document token signatures. Add...
[arvados.git] / doc / api / methods / api_client_authorizations.html.textile.liquid
index 75ffd3ffbed0e191915749855b34fd4964a13466..660e5ddf30c060a638be07e5aae76dec2272dde0 100644 (file)
@@ -6,98 +6,114 @@ title: "api_client_authorizations"
 
 ...
 
+See "REST methods for working with Arvados resources":{{site.baseurl}}/api/methods.html
 
+API endpoint base: @https://{{ site.arvados_api_host }}/arvados/v1/api_client_authorizations@
 
 Required arguments are displayed in %{background:#ccffcc}green%.
 
+h2. Resource
 
-h2. create
+The @api_client_authorizations@ resource stores the API tokens that have been issued to permit access the API server.
 
-Create a new ApiClientAuthorization.
-
-Arguments:
+An ApiClientAuthorization is *not* a generic Arvados resource.  The full list of properties that belong to an ApiClientAuthorization is:
 
 table(table table-bordered table-condensed).
-|_. Argument |_. Type |_. Description |_. Location |_. Example |
-|api_client_authorization|object||query||
+|_. Attribute|_. Type|_. Description|_. Example|
+|uuid|string|An identifier used to refer to the token without exposing the actual token.||
+|api_token|string|The actual token string that is expected in the Authorization header.||
+|api_client_id|integer|-||
+|user_id|integer|-||
+|created_by_ip_address|string|-||
+|last_used_by_ip_address|string|The network address of the most recent client using this token.||
+|last_used_at|datetime|Timestamp of the most recent request using this token.||
+|expires_at|datetime|Time at which the token is no longer valid.  May be set to a time in the past in order to immediately expire a token.||
+|owner_uuid|string|The user associated with the token.  All operations using this token are checked against the permissions of this user.||
+|scopes|array|A list of resources this token is allowed to access.  A scope of ["all"] allows all resources.  See below.||
 
-h2. create_system_auth
+h3(#scope). Scopes
 
-create_system_auth api_client_authorizations
+Scopes can restrict a token so it may only access certain resources.  This is in addition to normal permission checks for the user associated with the token.
 
-Arguments:
+Each entry in scopes consists of a @request_method@ and @request_path@, where the @request_method@ is a HTTP method (one of @GET@, @POST@, @PUT@ or @DELETE@) and @request_path@ is the request URI.  A given request is permitted if it matches a scopes exactly, or the scope ends with @/@ and the request string is a prefix of the scope.
 
-table(table table-bordered table-condensed).
-|_. Argument |_. Type |_. Description |_. Location |_. Example |
-|api_client_id|integer||query||
-|scopes|array||query||
+As a special case, a scope of ["all"] allows all resources.
 
-h2. delete
+h4. Examples
 
-Delete an existing ApiClientAuthorization.
+A scope of @GET /arvados/v1/collections@ permits listing collections.
 
-Arguments:
+* Requests with different methods, such as creating a new collection using @POST /arvados/v1/collections@, will be rejected.
+* Requests to access other resources, such as @GET /arvados/v1/groups@, will be rejected.
+* Be aware that requests for specific records, such as @GET /arvados/v1/collections/962eh-4zz18-xi32mpz2621o8km@ will also be rejected.  This is because the scope @GET /arvados/v1/collections@ does not end in @/@
 
-table(table table-bordered table-condensed).
-|_. Argument |_. Type |_. Description |_. Location |_. Example |
-{background:#ccffcc}.|uuid|string|The UUID of the ApiClientAuthorization in question.|path||
+A scope of @GET /arvados/v1/collections/@ (with @/@ suffix) will permit access to individual collections.
+
+* The request @GET /arvados/v1/collections/962eh-4zz18-xi32mpz2621o8km@ will succeed
+* Be aware that requests for listing @GET /arvados/v1/collections@ (no @/@ suffix) will be rejected, because it is not an exact match with @GET /arvados/v1/collections/@
+
+To allow both listing objects and requesting individual objects, include both in the scope: @["GET /arvados/v1/collections", "GET /arvados/v1/collections/"]@
+
+A narrow scope such as @GET /arvados/v1/collections/962eh-4zz18-xi32mpz2621o8km@ will disallow listing objects as well as disallow requesting any object other than those in the scope.
 
-h2. destroy
+h2. Methods
 
-destroy api_client_authorizations
+h3(#create). create
+
+Create a new ApiClientAuthorization.
+
+Regular users may only create self-owned API tokens, but may provide a restricted "scope"#scope .  Administrators may create API tokens corresponding to any user.
 
 Arguments:
 
 table(table table-bordered table-condensed).
 |_. Argument |_. Type |_. Description |_. Location |_. Example |
-{background:#ccffcc}.|uuid|string||path||
+|api_client_authorization|object||query||
 
-h2. get
+h3. create_system_auth
 
-Gets a ApiClientAuthorization's metadata by UUID.
+create_system_auth api_client_authorizations
 
 Arguments:
 
 table(table table-bordered table-condensed).
 |_. Argument |_. Type |_. Description |_. Location |_. Example |
-{background:#ccffcc}.|uuid|string|The UUID of the ApiClientAuthorization in question.|path||
+|api_client_id|integer||query||
+|scopes|array||query||
 
-h2. index
+h3. delete
 
-index api_client_authorizations
+Delete an existing ApiClientAuthorization.
 
 Arguments:
 
 table(table table-bordered table-condensed).
 |_. Argument |_. Type |_. Description |_. Location |_. Example |
-|order|string||query||
-|where|object||query||
+{background:#ccffcc}.|uuid|string|The UUID of the ApiClientAuthorization in question.|path||
 
-h2. list
+h3. get
 
-List api_client_authorizations.
+Gets a ApiClientAuthorization's metadata by UUID.
 
 Arguments:
 
 table(table table-bordered table-condensed).
 |_. Argument |_. Type |_. Description |_. Location |_. Example |
-|limit|integer (default 100)|Maximum number of api_client_authorizations to return.|query||
-|order|string|Order in which to return matching api_client_authorizations.|query||
-|pageToken|string|Page token.|query||
-|q|string|Query string for searching api_client_authorizations.|query||
-|where|object|Conditions for filtering api_client_authorizations.|query||
+{background:#ccffcc}.|uuid|string|The UUID of the ApiClientAuthorization in question.|path||
 
-h2. show
+h3. list
 
-show api_client_authorizations
+List api_client_authorizations.
 
 Arguments:
 
 table(table table-bordered table-condensed).
 |_. Argument |_. Type |_. Description |_. Location |_. Example |
-{background:#ccffcc}.|uuid|string||path||
+|limit|integer (default 100)|Maximum number of api_client_authorizations to return.|query||
+|order|string|Order in which to return matching api_client_authorizations.|query||
+|filters|array|Conditions for filtering api_client_authorizations.|query||
 
-h2. update
+h3. update
 
 Update attributes of an existing ApiClientAuthorization.