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: Allow setting API keys expiration #12954

Merged
merged 28 commits into from
Feb 3, 2025
Merged

Conversation

RicardoE105
Copy link
Contributor

@RicardoE105 RicardoE105 commented Jan 30, 2025

Summary

introduces expiration for API keys. Each API key can have one of 3 expiration states:

  1. Expires in the future.
  2. Expired.
  3. Never expires.

Also moved the creation date to the modal.

CleanShot 2025-01-30 at 10 52 21@2x

Demo

CleanShot 2025-01-30 at 10 55 01

Related Linear tickets, Github issues, and Community forum posts

https://www.notion.so/n8n/Public-API-scopes-and-expiration-51f6bad3305f4397869dc71b95ac2ceb?pvs=4

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@RicardoE105 RicardoE105 changed the title Allow setting API keys expiration feat: Allow setting API keys expiration Jan 30, 2025
@RicardoE105 RicardoE105 requested a review from tomi January 30, 2025 15:58
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jan 30, 2025
Copy link

codecov bot commented Jan 30, 2025

Copy link
Collaborator

@tomi tomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments. Testing this out next

@tomi
Copy link
Collaborator

tomi commented Jan 31, 2025

I can't create an API key with custom expiration?

image

The payload looks odd:

{"label":"asdasd","expirationUnixTimestamp":1}

@RicardoE105
Copy link
Contributor Author

@tomi fixed the custom date selector. In one of the latest changes broke it and did not notice it. Probably a sign that need more test coverage in the FE. Will increase coverage

@RicardoE105 RicardoE105 requested a review from tomi January 31, 2025 16:44
Copy link
Collaborator

@tomi tomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, almost there 🏁 Couple minor comments

@RicardoE105 RicardoE105 requested a review from tomi February 3, 2025 14:43
Copy link
Collaborator

@tomi tomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@tomi
Copy link
Collaborator

tomi commented Feb 3, 2025

Thank you for addressing everything 🫶

Copy link
Contributor

github-actions bot commented Feb 3, 2025

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Feb 3, 2025

n8n    Run #9090

Run Properties:  status check passed Passed #9090  •  git commit 9bcbc2c2cc: 🌳 master 🖥️ browsers:node18.12.0-chrome107 🤖 PR User 🗃️ e2e/*
Project n8n
Branch Review master
Run status status check passed Passed #9090
Run duration 04m 27s
Commit git commit 9bcbc2c2cc: 🌳 master 🖥️ browsers:node18.12.0-chrome107 🤖 PR User 🗃️ e2e/*
Committer Ricardo Espinoza
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 5
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 433
View all changes introduced in this branch ↗︎

Copy link
Contributor

github-actions bot commented Feb 3, 2025

✅ All Cypress E2E specs passed

@RicardoE105 RicardoE105 merged commit 9bcbc2c into master Feb 3, 2025
37 checks passed
@RicardoE105 RicardoE105 deleted the add-expiration-to-api-keys branch February 3, 2025 16:16
This was referenced Feb 5, 2025
@janober
Copy link
Member

janober commented Feb 6, 2025

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants