Secure Map Service - #1277
Conversation
* Added middleware to allow apps to require users to be authenticated with Oauth or be redirected to settings to get their account connected * Added GRiD backend for Oauth authentication * Added new basemap capabilities to allow secure map services to be used as basemaps * Added proxy url route and view for secure requests to SecureMapService endpoints with authentication data * Added helper methods for interacting with SecureMapServices and settings
* Added better error logging in fetch_response util method * Updated secure map service proxy controller to accept any kind of request, not just GET * Added form_id and draw attributes to MapLayout to allow for drawing and passing geometry to forms * Fixed user_data in grid backend
…re map service settings * Updated portal_config.yml file to have a generated SALT_KEY to use for encryption, updated settings.py to use this value * Updated secure map proxy endpoint to always include browser params(params supplied from the browser(bbox, etc))
…basemaps when using a proxy endpoint * Updated generate_request helper function in SecureMapServiceSetting class to return a lazy request to avoid error when using a secure map service as a basemap with a proxy endpoint * Updated generate_request, build_layer, and fetch_response to be private * Added _resolve_secure_map_service as a lazy target for get_secure_map_service
| def _generate_request(self, param_overrides=None): | ||
| """ | ||
| Generate a request to the secure map service, including any necessary authentication headers or parameters. | ||
| """ |
There was a problem hiding this comment.
@swainn I just noticed this function doesn't handle the OAuth2 token if the service setting is not set to use the proxy endpoint... Thoughts on how that should be handled?
There was a problem hiding this comment.
If we want to worry about the OAuth token here at all, maybe we have a note/warning to just use the service as a layer or a response instead of getting the endpoint url without the OAuth token, or should this function perhaps return the OAuth token as well as the url
…ccess apps that have a required OAuth2 provider
* Moved update params logic from setting to service * Renamed app facing update_params helper method to reflect moved update params logic
* Updated docstrings * Added Secure Map Service API documentation and linked to it in the secure map service tutorial * Fixed typos and code in secure map service tutorial
|
|
||
| try: | ||
| auth = user.social_auth.get(provider=self.oauth_provider) | ||
| except ObjectDoesNotExist: |
There was a problem hiding this comment.
@swainn Right now if the Tethys Portal is not configured to require a user to be linked to an oauth in order to even access the app and the user's account is not linked to the necessary oauth service, this will crash the app, showing an error page with this error message. We should maybe consider handling this differently and/or adding instructions to add that requirement to the portal config.
Description
This merge adds new capabilities to Tethys with Secure Map Services that allow for secure storing of authentication data used to access Map or Imagery services.
Changes Made to Code
Related PRs, Issues, and Discussions
Additional Notes
Quality Checks