sul-dlss / earthworks

Geospatial discovery application for Stanford University Libraries.
https://earthworks.stanford.edu
Other
21 stars 3 forks source link

Explore how to incorporate authorization into code samples for restricted datasets #1093

Closed hudajkhan closed 2 weeks ago

hudajkhan commented 1 month ago

1049 is about building in a code sample view. For restricted datasets, like https://earthworks.stanford.edu/catalog/stanford-cg357zz032, the user must be logged in as a Stanford user in order to view/download the data.

Questions to answer:

hudajkhan commented 1 month ago

Related references: Proxy controller setup specifically for the restricted GeoServer URL. https://github.com/sul-dlss/earthworks/blob/main/app/controllers/restricted_proxy_controller.rb EarthWorks shared configs has the specific restricted GeoServer URL to be used. https://github.com/sul-dlss/shared_configs/blob/earthworks-prod/config/settings/production.yml#L9 Looks like EarthWorks puppet also has related configuration. https://github.com/sul-dlss/puppet/blob/production/hieradata/node/earthworks-prod-a.stanford.edu.eyaml#L155

Related issues: https://github.com/sul-dlss/earthworks/issues/3

marlo-longley commented 1 month ago

Find out if this is even possible -- if so, close this exploration ticket, and create an implementation ticket that will depend on the merging of #1100.

Can we make the code snippet only visible after user login, similar to the logic behind the Download button? For unrestricted datasets the code snippet would always show. Maybe find an MVP-style path forward given our short workcycle timeline.

For restricted code snippets, indicate to users that fact that for the snippet to work in the future, the user will have to be authenticated.

@dbranchini will edit this ticket to add the 2 screens from her designs that reflect this flow.

dbranchini commented 1 month ago

Public dataset - https://www.figma.com/design/nkgg905s5FyXoyPZjVMco0/EarthWorks?node-id=911-24473&t=KfDIeJaBz5XarlOV-4

Restricted dataset - NOT LOGGED IN - https://www.figma.com/design/nkgg905s5FyXoyPZjVMco0/EarthWorks?node-id=911-24351&t=KfDIeJaBz5XarlOV-4

Restricted dataset - LOGGED IN - https://www.figma.com/design/nkgg905s5FyXoyPZjVMco0/EarthWorks?node-id=517-18605&t=KfDIeJaBz5XarlOV-4

hudajkhan commented 2 weeks ago

I am going to work on adding this in to the code snippet approach in #1100 as well. I will close this issue and add these examples to #1100

marlo-longley commented 2 weeks ago

See #1125