Conversation

durran

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

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

Successfully merging this pull request may close these issues.