Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
update to route and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cianfoley-nearform committed May 16, 2018
1 parent c4d0dc3 commit 59f370b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ A brief overview of the Authorization API calls are as follows, see the live [Sw
|Path|Method|Summary|
|----|------|-------|
|/authorization/access/{userId}/{action}/{resource*}|GET|Authorize user action against a resource|
|/authorization/batchaccess/{userId}|POST|Authorize user actions against resources|
|/authorization/access/{userId}|POST|Authorize a batch of action/resource pairs|
|/authorization/list/{userId}|GET|List all the actions a user can perform on a list of resources|
|/authorization/list/{userId}/{resource*}|GET|List all the actions a user can perform on a resource|
|/authorization/policies|POST|Create a policy for the current user organization|
Expand Down
2 changes: 1 addition & 1 deletion docs/swagger/swagger-json.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/udaru-hapi-16-plugin/routes/public/authorization.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports.register = function (server, options, next) {

server.route({
method: 'POST',
path: '/authorization/batchaccess/{userId}',
path: '/authorization/access/{userId}',
handler: function (request, reply) {
const { organizationId } = request.udaru
const { resourceBatch } = request.payload
Expand Down Expand Up @@ -75,8 +75,8 @@ exports.register = function (server, options, next) {
payload: Joi.object(_.pick(validation.batchAuthorization, ['resourceBatch'])).label('ResourceBatchPayload'),
headers
},
description: 'Authorize user actions against resources',
notes: 'The POST /authorization/batchaccess/{userId} endpoint determines if a user has authorization to perform actions on a list of resources\n',
description: 'Authorize a batch of action/resource pairss',
notes: 'The POST /authorization/access/{userId} endpoint determines if a user has authorization on a batch of action/resource pairs\n',
tags: ['api', 'authorization'],
response: { schema: swagger.BatchAccess }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ lab.experiment('Authorization inherited org policies', () => {

const options = utils.requestOptions({
method: 'POST',
url: '/authorization/batchaccess/' + testUserId1,
url: '/authorization/access/' + testUserId1,
headers: {
authorization: 'ROOTid',
org: orgId1
Expand All @@ -292,7 +292,7 @@ lab.experiment('Authorization inherited org policies', () => {
lab.test('batchcheck empty payload', (done) => {
const options = utils.requestOptions({
method: 'POST',
url: '/authorization/batchaccess/' + testUserId1,
url: '/authorization/access/' + testUserId1,
headers: {
authorization: 'ROOTid',
org: orgId1
Expand All @@ -311,7 +311,7 @@ lab.experiment('Authorization inherited org policies', () => {
lab.test('batchcheck invalid payload', (done) => {
const options = utils.requestOptions({
method: 'POST',
url: '/authorization/batchaccess/' + testUserId1,
url: '/authorization/access/' + testUserId1,
headers: {
authorization: 'ROOTid',
org: orgId1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ lab.experiment('Authorization inherited org policies', () => {

const options = utils.requestOptions({
method: 'POST',
url: '/authorization/batchaccess/' + testUserId1,
url: '/authorization/access/' + testUserId1,
headers: {
authorization: 'ROOTid',
org: orgId1
Expand All @@ -304,7 +304,7 @@ lab.experiment('Authorization inherited org policies', () => {
lab.test('batchcheck empty payload', async () => {
const options = utils.requestOptions({
method: 'POST',
url: '/authorization/batchaccess/' + testUserId1,
url: '/authorization/access/' + testUserId1,
headers: {
authorization: 'ROOTid',
org: orgId1
Expand All @@ -322,7 +322,7 @@ lab.experiment('Authorization inherited org policies', () => {
lab.test('batchcheck invalid payload', async () => {
const options = utils.requestOptions({
method: 'POST',
url: '/authorization/batchaccess/' + testUserId1,
url: '/authorization/access/' + testUserId1,
headers: {
authorization: 'ROOTid',
org: orgId1
Expand Down

0 comments on commit 59f370b

Please sign in to comment.