Skip to content

feat: Add deployment_key table, entity, repository, and migration#28329

Draft
BGZStephen wants to merge 1 commit intomasterfrom
IAM-484-create-deployment-key-table
Draft

feat: Add deployment_key table, entity, repository, and migration#28329
BGZStephen wants to merge 1 commit intomasterfrom
IAM-484-create-deployment-key-table

Conversation

@BGZStephen
Copy link
Copy Markdown
Contributor

@BGZStephen BGZStephen commented Apr 10, 2026

Summary

Adds the deployment_key table as pure DB infrastructure for the encryption key rotation epic (T01). No business logic is included.

What's added:

  • DeploymentKey TypeORM entity extending WithTimestampsAndStringId (id, createdAt, updatedAt inherited)
  • Columns: type (varchar 64), value (text), algorithm (varchar 20, nullable), status (varchar 20), deprecatedAt (datetime, nullable)
  • DeploymentKeyRepository with findActiveByType, findById, and findAllByType methods
  • Migration 1777000000000-CreateDeploymentKeyTable registered for both SQLite and PostgreSQL
  • Partial unique index IDX_deployment_key_data_encryption_active on type where status = 'active' AND type = 'data_encryption' — enforces at most one active data_encryption key at a time

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/IAM-484

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)
  • I have seen this code, I have run this code, and I take responsibility for this code.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 58.06452% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...n/db/src/repositories/deployment-key.repository.ts 33.33% 8 Missing ⚠️
...s/common/1777000000000-CreateDeploymentKeyTable.ts 16.66% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

1 participant