Table permissions#10
Conversation
the table description payload does not contain any notion of table ownership or permissions; this defines 3 headers that can be used to set and get minimum permissions without encumbering the table description document format(s) these headers are entirely optional and would only be applicable if a service wants to expose and allow modification of permissions via the API
|
If headers prove to a good/acceptable way to get and set permissions, this may also be a suitable approach to manage other optional attributes. |
brianmajor
left a comment
There was a problem hiding this comment.
Our other (minimal) use of headers, though not part of any spec at the moment, is for communicating your authentication status. If I call a service with my credentials I see
x-vo-authenticated: bmajor
Should we strive for a convention where IVOA headers start with x-vo-?
I think this is a good idea, but we should use If someone outside our community notices these odd headers being sent to their service they might try to use a search engine to find out where they are coming from. Putting |
add x-vosi-owner header
|
I think if headers work out as an acceptable approach (more below) we could considier VOSI as a good place to define general purpose headers. I would include the current For naming style, Headers currently defined here: By switching to The general idea to be documented in the standard is that services do not output any of these headers for normal tables, but can output them if they wish to reveal the info to the caller. For input (PUT and POST actions) services can simply ignore (reject?) attempts to set any of these that they do not support or allow. For example, The OpenCADC more on implementation experience to follow... |
|
Implementation experience (unreleased version of OpenCADC POST to set auth-read, group-read, and group-write attributes on schemas and tables using headers is working; can combine update metadata (body document) and permissions in one request
This part not in the openapi... To clear existing permissions, we could either define special values or a set of headers to unset. There is prior art in having headers behave like commands (set-cookie is an instruction, not just passing information) so in principle set and unset make some sense. I implemented "clear a permission setting in two ways: special header value The special values felt a little icky, but I don't see any obvious problems aside from arguing about OpenAPI includes a The explicit unset headers are straightforward but one has to define whether set or unset has precedence if/when a client sends both. I chose unset to have precedence (and ignore the corresponding set header). This option will require more explaining in the standard doc and even then clients and services can (will) make mistakes. TL;DR - I think defining a special |
use enum instead of boolean for explicit serialisation
|
OpenAPI updated to use special values; actual value aside: this value inspired by database where boolean has 3 values (true,false,null) more than other programming languages. |
|
Both approaches seem reasonable to me, so going with 'special value' sounds good. We talked about this a bit yesterday @pdowler -- what about when multiple, conflicting headers are provided? For example, |
|
I did find an OpenAPI mechanism to differentiate between single-valued and multi-valued params and I think the spec here means single values (because |
Possible solution using HTTP headers to convey minimal permission related information.
For issue #8 this is option 3.
As optional headers, any service can ignore request headers they do not support and only include response headers they do support.
This adds 3 optional headers that can be included in:
PUT /tables/{name} -- set permissions during create table op
POST /tables/{name} -- set permissions on an existing table
GET /tables/{name} -- headers will describe the current permissions
The 3 headers are: x-vosi-anon-read, x-vosi-group-read, x-vosi-group-write.
In addition, a 4th header specifies the owner of the table: x-vosi-owner and is only used in output from the service (GET requests).
Detail to be described in the standard document: a lack of x-vosi-owner header can be interpretted as "this is a normal table"... maybe we also specify that a missing x-anon-read header means the same thing as true: this is a normal table anyone can query?
pros:
cons: