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

API token expiry warning emails #8154

Open
Turbo87 opened this issue Feb 19, 2024 · 5 comments
Open

API token expiry warning emails #8154

Turbo87 opened this issue Feb 19, 2024 · 5 comments
Assignees
Labels
A-backend ⚙️ C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works

Comments

@Turbo87
Copy link
Member

Turbo87 commented Feb 19, 2024

Some time last year we introduced optional expiration periods for API tokens. One caveat of the existing system is that users don't get notified when their tokens expire and they have to proactively monitor this if they use expiration.

In our team meeting on Friday we discussed how we could improve the situation and one idea was to automatically send out warning emails when an API token expires.

As #6664 (comment) states, such emails are seen as a requirement before we can change the default expiration setting on the API token creation page.

A couple of open questions:

  • When should we send these emails? At the time when the token expires? A week before? A day before?
  • Should we offer a way to create a new token based on the settings from an existing token?
  • Should we use a feature flag while testing this out on the staging environment?

In terms of implementation:

  • We will probably need to track for what tokens we have sent out warnings already. One way to do this would be to add another column to the api_tokens table.
  • A new background job could then be implemented that scans the api_tokens table for tokens that have expired (or are going to expire) and where a warning has not been sent yet, and then sends out such a warning email.
@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works A-backend ⚙️ labels Feb 19, 2024
@hi-rustin
Copy link
Member

  • Should we offer a way to create a new token based on the settings from an existing token?

I haven't seen this feature on other products and platforms. Do you have any examples we can refer to?

Are you working on this? If not, do you mind me to take it and help implement it?

@Turbo87
Copy link
Member Author

Turbo87 commented Feb 21, 2024

I haven't seen this feature on other products and platforms. Do you have any examples we can refer to?

can't think of one, but what I have in mind is a "Duplicate" button on each of the existing tokens that would take you to the "Create API token" page with the scopes from the other token filled in and a name of e.g. "XXX (Copy)".

Are you working on this? If not, do you mind me to take it and help implement it?

Sure, go ahead! :)

@hi-rustin hi-rustin self-assigned this Feb 22, 2024
@mdtro
Copy link
Contributor

mdtro commented Mar 1, 2024

I'll follow up with the infra team on Zulip in regards to hardening our DMARC and SPF configurations in preparation for sending these emails. 🙂

@hi-rustin
Copy link
Member

I was too busy last week, but I will begin working on the design and implementation this week.

@hi-rustin
Copy link
Member

I haven't seen this feature on other products and platforms. Do you have any examples we can refer to?

GitHub has this feature, for instance:
image
The UI looks like this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
Archived in project
Development

No branches or pull requests

3 participants