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

[#85] Allow to customize secret expiry #93

Merged
merged 6 commits into from
Jun 26, 2023

Conversation

Luzifer
Copy link
Owner

@Luzifer Luzifer commented Jun 26, 2023

image
image
image
Screenshot_2023-06-26-20-19-42-86_3aea4af51f236e4932235fdada7d1643
Screenshot_2023-06-26-20-19-56-62_3aea4af51f236e4932235fdada7d1643

@Luzifer Luzifer linked an issue Jun 26, 2023 that may be closed by this pull request
Signed-off-by: Knut Ahlers <knut@ahlers.me>
Signed-off-by: Knut Ahlers <knut@ahlers.me>
@Luzifer Luzifer force-pushed the 85-customizable-secret-expiry branch from 202d492 to b6bc052 Compare June 26, 2023 17:57
Signed-off-by: Knut Ahlers <knut@ahlers.me>
@Luzifer Luzifer force-pushed the 85-customizable-secret-expiry branch from b6bc052 to f22b67b Compare June 26, 2023 18:14
@Luzifer Luzifer self-assigned this Jun 26, 2023
@mshedsilegx
Copy link

This looks really good.
1- Can you think of a way to make the expiry list values customizable in "customize.yaml" ?
2- Can we display the date/time in UTC/GMT, to make sure it will not depend of the current TZ of the server ?

Signed-off-by: Knut Ahlers <knut@ahlers.me>
@Luzifer
Copy link
Owner Author

Luzifer commented Jun 26, 2023

1- Can you think of a way to make the expiry list values customizable in "customize.yaml" ?

I could do some logic to derive the translation strings to be used from the seconds values and then it would be possible to specify them… 🤔

2- Can we display the date/time in UTC/GMT, to make sure it will not depend of the current TZ of the server ?

Indeed the time is displayed in browser local time… The API passes UTC to the browser.

@mshedsilegx
Copy link

mshedsilegx commented Jun 26, 2023

OK, maybe I am not clear what the list of values would be in the drop down. Can we specify a number and a unit ?
examples:
30 mn
1 Hour
2 days

with a max value enforced at startup.

@Luzifer
Copy link
Owner Author

Luzifer commented Jun 26, 2023

OK, maybe I am not clear what the list of values would be in the drop down. Can we specify a number and a unit ?

Yeah I did get what your intention was. Have a look at the README changes in the last commit…

Signed-off-by: Knut Ahlers <knut@ahlers.me>
@Luzifer Luzifer force-pushed the 85-customizable-secret-expiry branch from e728673 to 1641e38 Compare June 26, 2023 19:24
@mshedsilegx
Copy link

I see, yes, that looks fine

@Luzifer Luzifer marked this pull request as ready for review June 26, 2023 19:31
Signed-off-by: Knut Ahlers <knut@ahlers.me>
@Luzifer Luzifer merged commit 901c85c into master Jun 26, 2023
4 checks passed
@Luzifer Luzifer deleted the 85-customizable-secret-expiry branch June 26, 2023 21:01
@Luzifer Luzifer restored the 85-customizable-secret-expiry branch June 26, 2023 21:17
@Luzifer Luzifer deleted the 85-customizable-secret-expiry branch June 26, 2023 21:23
@mshedsilegx
Copy link

I just tested, this is outstanding. Could you please document how would we access that custom expiration when creating the secret via automation - ie curl call to OTS API ? Many thanks.

@Luzifer
Copy link
Owner Author

Luzifer commented Jun 26, 2023

Could you please document how would we access that custom expiration when creating the secret via automation

That has been added to the API documentation: operation/createSecret - i.e.

curl 'https://ots.fyi/api/create?expire=300' \
  -H 'content-type: application/json' \
  --data-raw '{"secret":"U2FsdGVkX1+w3BJhbu6nQiKOK6HI0ZRUvwWGQ066F8Q="}'

{
    "success": true,
    "expires_at": "2023-06-26T22:24:02.051952626Z",
    "secret_id": "1a40aec3-24df-4fe8-91f1-5788420797b7"
}

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.

Suggestion - Configurable lifetime
2 participants