datakaveri/dx-resource-server

1.18. Subscription API flow changes

Closed this issue · 0 comments

For every create subscription API call, we need to update the user permissions.
STEP:1 Get the list of permissions of the user
Example
curl --location --request GET 'http://localhost:15672/api/users/15c7506f-c800-48d6-adeb-0542b03947c6/permissions'
--header 'Authorization: Basic Z3Vlc3Q6Z3Vlc3Q='
--data-raw ''

Response
[
{
"user": "15c7506f-c800-48d6-adeb-0542b03947c6",
"vhost": "IUDX",
"configure": "",
"write": "",
"read": "15c7506f-c800-48d6-adeb-0542b03947c6/aqm-application"
}
]

Take the “read” attribute value. Add a “|” followed by the queue name obtained in the request and proceed to the next step. Make sure to keep the write and configure permissions as is.

STEP:2 Update the permissions
Example
curl --location --request PUT 'http://localhost:15672/api/permissions/IUDX/15c7506f-c800-48d6-adeb-0542b03947c6'
--header 'Authorization: Basic Z3Vlc3Q6Z3Vlc3Q='
--header 'Content-Type: application/json'
--data-raw '{
"configure":"",
"write": "",
"read": "15c7506f-c800-48d6-adeb-0542b03947c6/aqm-application|15c7506f-c800-48d6-adeb-0542b03947c6/itms-application"
}'