From 8cc0d8e428b3ae20b9a4d3f94a334cece535f728 Mon Sep 17 00:00:00 2001 From: Stefano Brilli Date: Tue, 15 Jun 2021 10:49:05 +0200 Subject: [PATCH] Update README with new Cache Provider interface (#608) Cache Provider interface has changed in #532 . This updates the readme for the new interface. --- README.md | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 5c98100e..3ef6298f 100644 --- a/README.md +++ b/README.md @@ -359,28 +359,19 @@ To support this scenario you can provide an implementation for a cache provider ```javascript { - save: function(key, value, callback) { - // save the key with the optional value, invokes the callback with the value saves + saveAsync: async function(key, value) { + // saves the key with the optional value, returns the saved value }, - get: function(key, callback) { - // invokes 'callback' and passes the value if found, null otherwise + getAsync: async function(key) { + // returns the value if found, null otherwise }, - remove: function(key, callback) { - // removes the key from the cache, invokes `callback` with the + removeAsync: async function(key) { + // removes the key from the cache, returns the // key removed, null if no key is removed } } ``` -The `callback` argument is a function in the style of normal Node callbacks: - -``` -function callback(err, result) -{ - -} -``` - Provide an instance of an object which has these functions passed to the `cacheProvider` config option when using Passport-SAML. ## SLO (single logout)