Skip to content

Comments

Add MetadataService.getCachedStatements()#745

Open
MasterKale wants to merge 3 commits intomasterfrom
feat/metadata-service-get-statements
Open

Add MetadataService.getCachedStatements()#745
MasterKale wants to merge 3 commits intomasterfrom
feat/metadata-service-get-statements

Conversation

@MasterKale
Copy link
Owner

This PR adds a new getCachedStatements() method to MetadataService. This returns an array of MetadataStatement's that can e.g. be saved somewhere to later feed back into a subsequent call to MetadataService.initialize({}) as the opts.statements argument to skip a network request.

Fixes #732.

Initial run:

await MetadataService.initialize();
const statements = MetadataService.getCachedStatements();
await writeStatementsToDisk(statements);

Subsequent Run:

const savedStatements = await readStatementsFromDisk();
await MetadataService.initialize({
  mdsServers: [],
  statements: savedStatements,
});

@MasterKale MasterKale added the package:server @simplewebauthn/server label Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:server @simplewebauthn/server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose MDS download or statement cache

1 participant