Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(coderd/database/dbpurge): make API keys retention configurable#21037

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mafredri wants to merge5 commits intomafredri/feat-coderd-db-retention-policy-3
base:mafredri/feat-coderd-db-retention-policy-3
Choose a base branch
Loading
frommafredri/feat-coderd-db-retention-policy-4

Conversation

@mafredri
Copy link
Member

@mafredrimafredri commentedDec 1, 2025
edited by dannykopping
Loading

Replace hardcoded 7-day retention for expired API keys with configurable
retention from deployment settings. Skips deletion entirely when effective retention is 0.

Depends on#21021
Updates#20743


PR Stack

PRTitle
#21021feat(coderd): add retention policy configuration
#21022feat(coderd/database/dbpurge): add retention for connection logs
#21025feat(coderd/database/dbpurge): add retention for audit logs
👉#21037feat(coderd/database/dbpurge): make API keys retention configurable
#21038docs: add data retention documentation
#21039feat: add retention config forworkspace_agent_logs

@mafredrimafredriforce-pushed themafredri/feat-coderd-db-retention-policy-4 branch 4 times, most recently from008a48a to03f5ec5CompareDecember 1, 2025 18:07
@mafredrimafredriforce-pushed themafredri/feat-coderd-db-retention-policy-3 branch from07ae594 to9ca58c3CompareDecember 1, 2025 18:07
@mafredrimafredriforce-pushed themafredri/feat-coderd-db-retention-policy-3 branch from9ca58c3 toa21395aCompareDecember 2, 2025 10:02
@mafredrimafredriforce-pushed themafredri/feat-coderd-db-retention-policy-4 branch from03f5ec5 to46f07e1CompareDecember 2, 2025 10:05
@mafredrimafredri marked this pull request as ready for reviewDecember 2, 2025 10:29
Replace hardcoded 7-day retention for expired API keys with configurableretention from deployment settings. Falls back to global retention whennot set, and skips deletion entirely when effective retention is 0.Depends on#21021Updates#20743
API keys retention is now explicit - it's enabled when--api-keys-retention is set to a non-zero duration (default 7d),and disabled when set to 0. No fallback to global retention.
Use :execrows instead of :one to simplify the query by removing theextra CTE wrapper. This lets PostgreSQL return the row count directlyvia RowsAffected() instead of requiring an explicit COUNT(*) scan.
@mafredrimafredriforce-pushed themafredri/feat-coderd-db-retention-policy-3 branch froma21395a to82f1c2bCompareDecember 2, 2025 11:37
@mafredrimafredriforce-pushed themafredri/feat-coderd-db-retention-policy-4 branch from46f07e1 to27c90ddCompareDecember 2, 2025 11:37
user_id= $1;

-- name: DeleteExpiredAPIKeys :one
-- name: DeleteExpiredAPIKeys :execrows
Copy link
Member

Choose a reason for hiding this comment

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

woah TIL!

Copy link
Member

Choose a reason for hiding this comment

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

@dannykopping have you seen this annotation?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@EmyrkEmyrkEmyrk approved these changes

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@mafredrimafredri

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@mafredri@dannykopping@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp