-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add CacheManager and refactor LocalStorageCache * Refactor in-memory cache to use new interface * Move refresh token logic to CacheManager * Refactor Auth0Client to use async CacheManager * Refactor structure of cache objects into their own files * Add cache property to Auth0Client * Add example of custom cache to playground (session storage) * Add some basic tests for cache manager * Fix cache tests * Fixed up remaining tests * Split tests for memory and local storage, increase coverage * Add test file for both localstorage + memory * Fix tests for local storage * Rename localstorage cache module file * Export cache objects from primary module * Add test coverage for Auth0Client * Use constant for audience in cache tests * Use Promise.resolve everywhere rather than two patterns * Use Promise.resolve in playground sample * Make cache interface generic * Wrap cache key creation in a helper method * Initial tests for cache manifest * Add key removal + tests * Testing various scenarios around scope matching * Removing the key from the manifest if the cache item was not found * Remove key from manifest when expiry has been hit * Remove findExistingKey from local storage cache and simplify * Refactored findExistingCacheKey into cache manager * Remove unused import * Key migration into the manifest when keys do not exist * Run npm audit fix * Prefer exact match on cache before loose matching on scope * Don't really need to remove from key manifest if item wasn't found there * Add button for checkSession to the playground * Remove unused import * Add custom cache info to the readme * Rename some symbols * Add strong typing to ICache over using unknown types * Remove clear(), refactor manifest to take key string over CacheKey * Remove clear() from cache mock * Remove unused import * Add tests for cache shared utility funcs * Remove cache entry type guards * Use types instead of interfaces for various cache objects More semantically correct than interfaces since these types just define shapes of objects, they are not designed to be implemented by classes. * Fix up Promise.resolve examples based on feedback * Fix use of arrow function in playground, which breaks IE11 * Move Array.split outside of the loop * Refactor CacheKeyManifest#add to use Set * Prefer this.manifestKey * Prefer using Set over includes. Also rename vars for readability * Prefer Set in CacheKeyManifest#remove * Add optional allKeys to cache and refactor manager to prefer this * Consider optional keyManifest and update tests * Added LocalStorageCache.allKeys, refined tests * Remove unused import * Add docs for allKeys in the readme * Remove marketing blurb for Organizations * Cache manager no longer adds to manifest on read * Rename cacheDescriptors to cacheFactories in tests * Implement allKeys on InMemoryCache * Refactor CacheManager#clear so that coverage can be ignored
- Loading branch information
Steve Hobbs
authored
Jul 5, 2021
1 parent
19103a6
commit e6d2507
Showing
29 changed files
with
16,250 additions
and
1,062 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.