Skip to content

feat(NODE-6952): support configuring DEK cache expiration #4538

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

Merged
merged 8 commits into from
May 13, 2025

Conversation

durran
Copy link
Member

@durran durran commented May 9, 2025

Description

Adds support to configure the DEK cache expiration time.

What is changing?

  • Adds the option keyTimeoutMS to both client encryption and auto encryption options.
Is there new documentation needed for these changes?

None

What is the motivation for this change?

Release Highlight

Support Added for Configuring the DEK cache expiration time.

Default value is 60000. Requires using mongodb-client-encryption >= 6.4.0

For ClientEncryption:

import { MongoClient, ClientEncryption } from 'mongodb';
const client = new MongoClient(process.env.MONGODB_URI);
const clientEncryption = new ClientEncryption(client, { keyExpirationMS: 100000, kmsProviders: ... });

For auto encryption:

import { MongoClient, ClientEncryption } from 'mongodb';
const client = new MongoClient(process.env.MONGODB_URI, {
  autoEncryption: {
    keyExpirationMS: 100000,
    kmsProviders: ...
  }
});

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@durran durran changed the title feat(NODE-6952): add support for configuring DEK cache expiration feat(NODE-6952): support configuring DEK cache expiration May 9, 2025
@durran durran marked this pull request as ready for review May 9, 2025 22:27
@durran durran requested a review from a team as a code owner May 9, 2025 22:27
@baileympearson baileympearson self-assigned this May 12, 2025
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label May 12, 2025
addaleax
addaleax previously approved these changes May 13, 2025
@baileympearson baileympearson merged commit c529f07 into main May 13, 2025
28 of 31 checks passed
@baileympearson baileympearson deleted the NODE-6952 branch May 13, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants