Scopes
This guide will walk you though the process of assigning, listing and removing scopes and also give you a better understanding about scope definition and it's context in DUM Engine.
Scope aggregate policies. This aggregation prevents sharing policies between users which are not in a particular scope.
What you need
To successfully complete this topic guide you need to ensure following prerequisites:
- have the DUM Engine application up and running
- have access to DUM Engine APIs and know the Basic Authentication credentials
For the sake of this guide we assume that the DUM Engine is available at http://localhost:8080.
Add a scope
To add a scope you need to execute an API call POST api/v1/scopes
to DUM Engine endpoint.
curl -i --user username:password
-H "Content-Type: application/json"
-H "Accept: application/json"
-X POST -d
'{
"name": "READ"
}'
http://localhost:8080/api/v1/scopes
The service responds with HTTP/1.1 201 Created
status code and a Scope representation for operation completed successfully.
Example response:
HTTP/1.1 201
Content-Type: application/json;charset=UTF-8
{
"id": "0d31a0fa-ac44-45e9-affd-92edf4b1b5b4",
"name": "READ"
}
To get more information about the endpoint signature please look into the API documentation.
List scopes
To list scopes you need to execute an API call GET api/v1/scopes
to DUM Engine endpoint.
curl -i --user username:password
-H "Content-Type: application/json"
-H "Accept: application/json"
-X GET http://localhost:8080/api/v1/scopes
The service responds with HTTP/1.1 200 Ok
status code and a list of scopes for operation completed successfully.
Example response:
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
[
{
"id": "0d31a0fa-ac44-45e9-affd-92edf4b1b5b4",
"name": "READ"
}
]
To get more information about the endpoint signature please look into the API documentation.
Remove scope
The remove a scope you need to execute an API call DELETE api/v1/scopes/{scopeId}
to DUM Engine endpoint.
curl -i --user client:password
-H "Content-Type: application/json"
-H "Accept: application/json"
-X DELETE http://localhost:8080/api/v1/scopes/0d31a0fa-ac44-45e9-affd-92edf4b1b5b4
The service responds with HTTP/1.1 200 Ok
for operation completed successfully.
To get more information about the endpoint signature please look into the API documentation.