-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Feature/default expiry #161
Conversation
That's a breaking change.
That's just plain wrong. Using the server default is not
That's exactly the intended behavior. You shall not be able to pick a longer value than the server allows.
You cannot set arbitrary values in the frontend: Those are defined in the frontend source-code.
What exactly do they ask? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't see why we need to increase complexity to the expiry configuration. Having the server select the maximum and also default and let the user specify smaller retention values is totally fine IMHO…
src/components/create.vue
Outdated
@@ -153,22 +155,18 @@ export default { | |||
}, | |||
|
|||
expiryChoices() { | |||
const choices = [{ text: this.$t('expire-default'), value: null }] | |||
const choices = [{ | |||
text: this.$t('expire-default') + " (" + this.getExpiryLabel(defaultSecretExpire) + ")", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be properly adjusted in the translation, not just appended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the label does not solve the issue when values other than 86400, 3600, 60
are set. 129600
will be 2 Days
which is wrong.
src/components/create.vue
Outdated
if (duration >= 86400) { | ||
text = this.$tc('expire-n-days', Math.round(duration / 86400)) | ||
} else if (duration >= 3600) { | ||
text = this.$tc('expire-n-hours', Math.round(duration / 3600)) | ||
} else if (duration >= 60) { | ||
text = this.$tc('expire-n-minutes', Math.round(duration / 60)) | ||
} else if (duration > 0) { | ||
text = this.$tc('expire-n-seconds', duration) | ||
} else { | ||
text = this.$t('never') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix formatting
src/components/create.vue
Outdated
} else { | ||
option.text = this.$tc('expire-n-seconds', choice) | ||
} | ||
option.text = this.getExpiryLabel(choice) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be joined with line above
i18n.yaml
Outdated
@@ -17,6 +17,7 @@ reference: | |||
expire-n-hours: '{n} hour | {n} hours' | |||
expire-n-minutes: '{n} minute | {n} minutes' | |||
expire-n-seconds: '{n} second | {n} seconds' | |||
never: 'never' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename: expire-never
(though as this is wrong on a functionality level, we don't need that)
Okay so to solve the issue you're having, simply modifying one translation string is sufficient. That wouldn't need a breaking change and would not throw off the limit in every installation. |
okay I got the point why it is bad to introduce this braking change that will cause installations that do not update this value to have no limit. could add some quirks to support also just SECRET_EXPIRY as before... Just to change the translation will fix the unknown default expiry value but I had a nother request in mind. |
What exactly does this solve?
So what's the benefit of pre-selecting another expiry just in the frontend (which is only one consumer to the API)? You're presenting a feature-change / solution, not the issue you want to solve. So: What do you want to solve by splitting up max-retention and default-retention? |
Closing this PR:
For me this feels like my questions and objections as a project owner are completely ignored. I still don't see the need for the bigger, (breaking) change and questions to understand the need were ignored. Feel free to open a new PR containing only the frontend changes to display the default expiry time and leave out the other unrelated changes from that PR. |
Hi @Luzifer
I found some time and prepared some changes regarding #153
Below my thoughts about your comments:
Yes, that is correct. The is able to pick shorter expiry values (if not disabled y
cust.DisableExpiryOverride
) but never longer periods.I renamed
SecretExpiry
toMaxSecretExpiry
and addedDefaultSecretExpiry
to make this less confusing.In my opinion that is even more clear than only one
SecretExpiry
variable.This problem does also occure with every other default value that can be set in the frontend.
You already included a tie breaker method that breaks this into discrete day / hour / minute or second values depending how big they are. I added a "never" part to reflect unconfigured or "0" values.
I added the defaultSecretExpiry as the preselected default.
I called it "never" and find it very less confusing than "Default Expiry" without explanation.
On my server users already asked and raises ticket to ask about the "Default Expiry" value.
My boss also told me that I have to add some notice... this is why I first came up with this quick but ugly overwriting the index.html and added custom javascript file to add this value to the frontend. But now the updated code in this PR does a better job (at least for my eyes 😄).