Added invalid token cache for Alfred and Nexus#24196
Merged
dhr-verma merged 4 commits intomicrosoft:mainfrom Apr 11, 2025
Merged
Added invalid token cache for Alfred and Nexus#24196dhr-verma merged 4 commits intomicrosoft:mainfrom
dhr-verma merged 4 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a caching mechanism for invalid access tokens used by Alfred, Nexus, and Historian to reduce redundant API calls to Riddler when tokens are known to be invalid.
- Introduces a new IInvalidTokenError interface and exports it for consistency.
- Implements invalid token caching logic in the TenantManager with proper error conversion.
- Updates Nexus and Alfred runner factories to integrate a Redis cache for invalid tokens via new customization options.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| server/routerlicious/packages/services/src/tenant.ts | Adds invalid token caching logic and error conversion in token verification. |
| server/routerlicious/packages/services-core/src/tenant.ts | Defines the IInvalidTokenError interface. |
| server/routerlicious/packages/services-core/src/index.ts | Exports IInvalidTokenError. |
| server/routerlicious/packages/routerlicious-base/src/utils/constants.ts | Adds a new constant for invalid token cache prefix. |
| server/routerlicious/packages/routerlicious-base/src/nexus/runnerFactory.ts | Integrates Redis cache for invalid tokens into Nexus resources. |
| server/routerlicious/packages/routerlicious-base/src/nexus/customizations.ts | Adds customization option for the invalid token cache Redis connection manager. |
| server/routerlicious/packages/routerlicious-base/src/alfred/runnerFactory.ts | Integrates Redis cache for invalid tokens into Alfred resources. |
| server/routerlicious/packages/routerlicious-base/src/alfred/customizations.ts | Adds customization option for the invalid token cache Redis connection manager. |
…to vermadhr/cacheValidationErrorsOnClientServices
znewton
approved these changes
Apr 11, 2025
znewton
approved these changes
Apr 11, 2025
dhr-verma
added a commit
that referenced
this pull request
Apr 14, 2025
## Description Follow-up to #24196, adds the invalid token cache to Historian as well.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Alfred, Nexus and Historian validate access tokens by making API calls to Riddler. We have seen significant amount of these calls fail with a 401 or 403 error. Indicating that Riddler has determined tokens to invalid multiple times. To try and reduce the calls b/w these services and riddler, this PR introduces a means to cache invalid tokens. These tokens can be cached in plaintext since these are invalid and cannot be made valid in the future.