nearform / udaru

Open source Access Manager for node.js
https://nearform.github.io/udaru
MIT License
124 stars 19 forks source link

policy association joi.alternatives causing issue with swagger docs #522

Closed cianfoley-nearform closed 6 years ago

cianfoley-nearform commented 6 years ago

Suggest that we remove the alternatives for associating a policy

Currently we can associate a policy with user/team/org with a string id or object (string, variables) as array elements in the payload

If using a string it results in the association being created with empty policy instance variables anyway.

Suggest we enforce just the object elements in the array for associating policies; an empty variables array is effectively then the same as the string id alternative currently in place.

A major reason to do this is swagger does not like joi.alternatives when generating the docs so it adds a little confusion to that endpoint. This would simplify, however it would be a breaking change.

cianfoley-nearform commented 6 years ago

merged :-)