Skip to content

Conversation

cesnietor
Copy link
Collaborator

@cesnietor cesnietor commented Oct 20, 2023

part of solution for: #922

Updates the UI to show the max expiration time returned from /api/v1/buckets/max-share-exp API.
It also adds some documentation on how that works.

Before:
Screenshot 2023-10-20 at 10 47 19 AM

After:
Screenshot 2023-12-13 at 10 44 57 AM

Test Steps:

  • Within Console running in dev mode
  • Set env variable CONSOLE_STS_DURATION value to 25h40m
  • Run server like:

make && CONSOLE_ACCESS_KEY=minioconsole
CONSOLE_SECRET_KEY=minioconsole
CONSOLE_MINIO_SERVER=http://localhost:9000
CONSOLE_DEV_MODE=on CONSOLE_STS_DURATION=25h40m ./console server

In the console UI with an existing bucket with an object:

  • click Share
  • Modal should open allowing only to set the date specified by the env variable

To TEST full integration:

  • generate assets
  • make assets
  • build console with minio https://github.com/minio/console/blob/master/DEVELOPMENT.md#building-with-minio
  • Run make build && MINIO_STS_DURATION=15m ./minio server ~/Data (the min allowed duration is 15 min) less than that it will return an invalid duration error.
  • Login
  • With an uploaded object click share and change the time to your preferred value.
  • The object should expire if the UI session expires (15 min after logging in) or after the selected expiration value
  • The UI shouldn't allow you to set more than the value set in the env variable

To TEST with IDP no env:

  • configure the IDP
  • Don't define the env variable
  • Share link max allowed exp time would be 12h in the UI
  • Share link should expire when it reaches the IDP expiration time

To TEST with IDP with env:

  • configure the IDP
  • define the env variable
  • Share link max allowed exp time would be the value of the env variable in the UI
  • Share link should expire when it reaches the env variable expiration time, not the one from the IDP.

@cesnietor cesnietor self-assigned this Oct 20, 2023
@jinapurapu
Copy link
Contributor

Is it a concern that the bucketName and objectName (Key and Resource) are displayed after link expiration?

Screenshot 2023-12-08 at 11 30 26 AM

@cesnietor
Copy link
Collaborator Author

cesnietor commented Dec 8, 2023

Is it a concern that the bucketName and objectName (Key and Resource) are displayed after link expiration?

@jinapurapu they are encoded in the url anyways so it's ok.

@ravindk89
Copy link
Contributor

ravindk89 commented Dec 12, 2023

Two suggested patterns @cesnietor (Forgot to hit Comment yesterday 😓 )

#. Show Max Possible Time

The following URL lets you share this object without requiring a login.
The URL expires automatically at the earlier of your configured time (1D and 1H and 1M) or the expiration of your current web session.

TOOLTIP
You can reset your session by logging out and logging back in to the web UI.
You can increase the maximum configuration time by setting the MINIO_STS_DURATION environment variable on all your nodes.
You can use mc share as an alternative to this UI, where the session length does not limit the URL validity.

#. Show Remaining Session Time

The following URL lets you share this object without requiring a login.
The URL expires automatically at the earlier of your configured time (1D and 1H and 1M) or the expiration of your current web session (1H and 1M).

TOOLTIP
You can reset your session by logging out and logging back in to the web UI.
You can increase the maximum configuration time by setting the MINIO_STS_DURATION environment variable on all your nodes.
You can use mc share as an alternative to this UI, where the session length does not limit the URL validity.

@cesnietor cesnietor force-pushed the update-share-link-exp-ui branch from 87145b9 to c8f6abd Compare December 13, 2023 18:49
@cesnietor cesnietor removed the blocked label Dec 13, 2023
@cesnietor cesnietor requested a review from ravindk89 December 13, 2023 18:50
@cesnietor
Copy link
Collaborator Author

@ravindk89 I've updated the PR using the first proposal and looks good. Thanks.

Copy link
Collaborator

@bexsoft bexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bexsoft bexsoft merged commit 044e570 into minio:master Dec 14, 2023
cesnietor added a commit to cesnietor/console that referenced this pull request Jan 12, 2024
cesnietor added a commit to cesnietor/console that referenced this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants