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

feat(create-secret): add two expiration options #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const keyParameter = "{key:(?:[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})}"
// validExpiration validates that expiration is either
// 3600(1hour), 86400(1day) or 604800(1week)
func validExpiration(expiration int32) bool {
for _, ttl := range []int32{3600, 86400, 604800} {
for _, ttl := range []int32{3600, 86400, 604800, 1209600, 2592000} {
if ttl == expiration {
return true
}
Expand Down
4 changes: 3 additions & 1 deletion website/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
"legend": "The encrypted message will be deleted automatically after",
"optionOneHourLabel": "One Hour",
"optionOneDayLabel": "One Day",
"optionOneWeekLabel": "One Week"
"optionOneWeekLabel": "One Week",
"optionTwoWeeksLabel": "Two Weeks",
"optionOneMonthLabel": "One Month"
},
"features": {
"title": "Share Secrets Securely With Ease",
Expand Down
12 changes: 12 additions & 0 deletions website/src/shared/Expiration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ export const Expiration = (props: { control: Control<any> }) => {
control={<Radio color="primary" />}
label={t('expiration.optionOneWeekLabel') as string}
/>
<FormControlLabel
labelPlacement="end"
value="1209600"
control={<Radio color="primary" />}
label={t('expiration.optionTwoWeeksLabel') as string}
/>
<FormControlLabel
labelPlacement="end"
value="2592000"
control={<Radio color="primary" />}
label={t('expiration.optionOneMonthLabel') as string}
/>
</RadioGroup>
)}
/>
Expand Down