Add a consumer to a group
-------------------------
Endpoint:
https://auth.datasetu.org/auth/v1/group/add
Description:
This API is used to add a consumer to a group.
Groups are useful in setting access control polcies where access to
resources is given to a group of consumers.
This is done using the "consumer-in-group(group-name)" function in
the aperture policy when using the "/acl/set" API.
Called by:
A "data provider" with a valid class-3 or above certificate.
Methods:
POST
Headers:
content-type : "application/json"
Body in JSON format:
{
"group" : <a valid group name created by the user>
"consumer" : <the consumer's email-id, which is to be added to the group>
"valid-till" : <how long (in hours) the consumer will be in the group>
}
Note: If the "group" doesn't exist, it will be created automatically.
Using pyIUDX SDK:
from pyIUDX.auth import auth
iudx_auth = auth.Auth("certificate.pem","private-key.pem")
# add user@domain.com to confidential group for 1 hour
iudx_auth.add_consumer_to_group("user@domain.com","confidential",1)
CURL example:
Request:
curl -XPOST https://auth.datasetu.org/auth/v1/group/add
--cert certificate.pem --key private-key.pem
-H 'content-type: application/json'
-d '{"group" : "confidential","consumer" : "user@domain.com", "valid-till" : 3600}'
Response:
200 OK
content-type : "application/json"
{
"success" : true
}
See also:
acl set API:
http://auth.datasetu.org/acl-set.html
group delete API:
http://auth.datasetu.org/group-delete.html
group list API:
http://auth.datasetu.org/group-list.html