-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: variable route pricing * feat: replace root access token checks with x-api-token accesslevel checks * chore: use multi url env for edge function selection * opti: make all cache updates pull only * patch: update lifetime of cache stores * feat: allow for auth to be conditionally imposed during deployment
- Loading branch information
1 parent
abeaf0a
commit ba63551
Showing
13 changed files
with
222 additions
and
232 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import { refreshAuthStore } from './authMiddleware' | ||
import NodeCache from 'node-cache' | ||
|
||
/** | ||
* Init cache that stores `accessLevel` & `accountRestricted` per api token. | ||
* On server boot, load it up with all auth data from db. | ||
* Cache that stores `accessLevel` & `accountRestricted` per API token | ||
* | ||
*/ | ||
export const authStore = new NodeCache({ stdTTL: 7 * 24 * 60 * 60 }) // 1 week | ||
refreshAuthStore() | ||
export const authStore = new NodeCache({ stdTTL: 60 * 60 }) // 1 hour | ||
|
||
/** | ||
* Init cache that collects `newRequests` per api token. | ||
* Cache that collects `newRequests` per API token | ||
* | ||
*/ | ||
export const requestsStore = new NodeCache({ stdTTL: 7 * 24 * 60 * 60 }) // 1 week | ||
export const requestsStore = new NodeCache({ stdTTL: 24 * 60 * 60 }) // 1 day |
Oops, something went wrong.