feat: add backend BYOK support for GlobalPing integration#3421
Open
hybrid-zz wants to merge 16 commits intobluewave-labs:developfrom
Open
feat: add backend BYOK support for GlobalPing integration#3421hybrid-zz wants to merge 16 commits intobluewave-labs:developfrom
hybrid-zz wants to merge 16 commits intobluewave-labs:developfrom
Conversation
add globalping API key support in settings
Enhance Globalping integration: add key validity and credit check based on saved api key
Sync with develop
ajhollid
requested changes
Mar 18, 2026
Collaborator
ajhollid
left a comment
There was a problem hiding this comment.
Looks good for the most part, some minor changes required. Thanks for your contribution!
Comment on lines
+308
to
+312
| // Request helpers | ||
| private async getApiKey() { | ||
| const dbSettings = await this.settingsService.getDBSettings(); | ||
| return dbSettings.globalpingApiKey?.trim() || null; | ||
| } |
Collaborator
There was a problem hiding this comment.
This makes a DB call on every globalping request, that's a lot of overhead.
Let's cache the key with a reasonable invalidation period so we don't have to keep querying the DB
| const remainingCredits = this.toNullableNumber(parsedPayload.credits?.remaining); | ||
| const remainingLimit = this.toNullableNumber(createRateLimit?.remaining); | ||
|
|
||
| if (remainingCredits === null && remainingLimit === null) { |
Collaborator
There was a problem hiding this comment.
Tihs appears contradictory, as these values are both validated as nullable in the validation:
const globalpingLimitsResponseSchema = z.object({
rateLimit: z
.object({
measurements: z
.object({
create: z
.object({
remaining: z.number().nullable().optional(),
})
.optional(),
})
.optional(),
})
.optional(),
credits: z
.object({
remaining: z.number().nullable().optional(),
})
.optional(),
});
If they are expected to be null, then this should not be an error but an unknown response.
If they are not expected to be null, then let the validation handle this and remove the nullable
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.
Added backend support for admins to provide their own GlobalPing API key, aligning the implementation closely with the existing Google PageSpeed key integration. When a key is saved, the server automatically attaches an Authorization header to each GlobalPing request, otherwise it will fallback on anonymous checks.
As an additional improvement, I exposed an admin-only settings route that provides status information related to the configured API key:
This information could later be used to further enhance the integration. For example:
My apologies for the previous PR. I misunderstood your request and thought you wanted two separate PRs: one for BYOK and one for Granular Node Control. Don't mind the commits, lol I made a mess.
Partially Fixes #3413
Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks.
<div>Add</div>, use):