Filesystem-based KeyPersistenceAdapter for Node.js deployments.
KeyPersistenceAdapter
Writes are atomic: data is written to <filePath>.tmp then renamed to <filePath> to avoid leaving a corrupt file on crash or power loss.
<filePath>.tmp
<filePath>
const adapter = new JsonFileKeyPersistenceAdapter({ filePath: '/data/jwt-keys.json' });const provider = new IdentityProvider({ keyPersistenceAdapter: adapter }); Copy
const adapter = new JsonFileKeyPersistenceAdapter({ filePath: '/data/jwt-keys.json' });const provider = new IdentityProvider({ keyPersistenceAdapter: adapter });
Load the persisted key set. Returns null if no persisted state exists yet (first startup).
null
Persist the current key set. Implementations should write atomically to avoid corruption.
Filesystem-based
KeyPersistenceAdapterfor Node.js deployments.Writes are atomic: data is written to
<filePath>.tmpthen renamed to<filePath>to avoid leaving a corrupt file on crash or power loss.Example