Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a value to "Default" expiry #153

Open
tchbla opened this issue Nov 21, 2023 · 6 comments
Open

add a value to "Default" expiry #153

tchbla opened this issue Nov 21, 2023 · 6 comments

Comments

@tchbla
Copy link

tchbla commented Nov 21, 2023

I suggest displaying the default expiry value as text next to the default button, or alternatively, preselecting the default value.

Based on my code analysis, the default value appears to be identical to the configured maximum value.
I implemented a frontend workaround that appends the text from the last element of the select list to the default label.
You can view the result in the following image:
image

Additionally, it might be beneficial to include an option in the specification for defining the default value. For instance, we could specify the shortest available period as the default while still allowing manual selection of longer expiry periods.

Please note that my current implementation is a temporary JavaScript solution, so no pull request is attached to this request. If time permits, I am considering submitting one in the future 😄.

@tchbla

This comment was marked as off-topic.

@Luzifer

This comment was marked as off-topic.

@Luzifer
Copy link
Owner

Luzifer commented Nov 21, 2023

Additionally, it might be beneficial to include an option in the specification for defining the default value.

The default value is set through the SECRET_EXPIRY environment variable and is used by the API when there is no value for expiry set which is exactly what the frontend choice "Default Expiry" does: It does not specify any value and therefore leaves the choice to the server.

Having two "defaults" is kinda confusing. On the one hand configuring the default expiry and then also configuring the default-frontend-expiry which is not the value of "Default Expiry" and also must match one of the software-defined choices not deriving by one second.

I suggest displaying the default expiry value as text next to the default button, or alternatively, preselecting the default value.

That's not that easy: How would you display SECRET_EXPIRY=263543? In Go notation that's 73h12m23s or assuming 86400s as a day "3 Days, 1 Hour, 12 Minutes, 23 Seconds". Sure, that's a constructed case but something to be taken into account. The full field text would then be "Default Expiry (3 Days, 1 Hour, 12 Minutes, 23 Seconds)" which is "a little" too long…

In this case also the default value cannot be selected as it simply does not exist in the dropdown.

Based on my code analysis, the default value appears to be identical to the configured maximum value.

The default value is null, which leaves the choice to the server (which can be infinite storage of the secret). Which also is difficult to display ("Default Expiry (Infinity)"? - too confusing for users)…

@Luzifer Luzifer linked a pull request Dec 15, 2023 that will close this issue
@mshedsilegx
Copy link

@Luzifer What would be the best approach to just display the value of default expiry or the related custom value if overwritten, in the frontend UI ?

@Luzifer
Copy link
Owner

Luzifer commented Apr 11, 2024

Well basically part of #161 - Just without the unrelated changes (see my last comment before closing the PR). Will have a look at this myself, just need to find the time.

@mshedsilegx
Copy link

Yes, that's exactly what I was looking for. Appreciate the response.

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 a pull request may close this issue.

3 participants