Allow to restrict access to POST endpoints #671
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original issue description
Is your feature request related to a problem? Please describe.
Currently, despite of DELETE, all endpoints are secured on a true/false basis, i.e., if someone has accepted credentials, schemas and documents can be created without restriction. In order to be able to restrict the proliferation of arbitrary numbers of schemas (and documents) in a single instance of MetaStore, a more fine-grained restriction also of POST endpoints should be possible.
Describe the solution you'd like
The easiest solution might be to allow to configure access to POST endpoints (POST /api/v2/schemas/ and POST /api/v2/metadata/) via WebSecurityConfig and application.properties There could be for example a configurable role reflected via groupId, which enables the caller to access these endpoints.
Describe alternatives you've considered
For the time being, this could also be covered on the UI level, but access to the API will still be "unrestricted" in that sense.
closes #670