Provider-based authorization, updates to geoservice auth routes #865
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.
This PR is primarily concerned with updates to the authentication and authorization implementation. The existing code has some limitations:
primary issue is that it is left up to individual output-plugins to invoke the
authorize
method. This means that even if a Koop instance registered an auth-plugin, some outputs (e.g., vector-tile or OGC outputs) won't be securethe
authenticationSpecification
method defined by auth-plugins and intended to be used in output-plugin implementations is unnecessary. TMK, it's only ever been used to define auseHttp
setting, which is only used in the output-geoservices plugin. Therefore makes more sense to just make that an option to the output-geoservices plugin, and we can simply the auth-plugin specification by removing this methodregistering an auth-plugin means that all requests to all registered providers get authorized by one method (the auth-plugins
authorize
method). Different providers might require different auth-methods.users/developers generally know how to develop a provider, and it would be nice if auth-methods could just be added to a given provider as opposed to generating a whole new auth-plugin
To address the listed limitations, this PR includes the following changes:
authorize
method the koop-core's model "pull" methods (pull, pullLayer, pullCatalog, pullStream). This will leave the data secured regardless of the output-plugin by which it is accessed.authorize
andauthenticate
methods. These methods will be used preferentially if defined, even if a auth-plugin is registered.authenticationSpecification
method in output-geoservice. Add auseHttpForTokenUrl
registration option insteadOther updates included here:
/tokens
route in favor of arest/generateToken
route that appears on current versions of the ArcGIS Online and Enterprise ArcGIS ServerowningSystemUrl
to the rest/info response of output-geoservices