-
Notifications
You must be signed in to change notification settings - Fork 29
feat: add GCP Memorystore for Valkey IAM auth and private-CA TLS support - ISSUE-507 #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5604ec4
30904b8
795dfac
92f2e04
1f2f957
04b277a
123e07e
4f59fee
e5a0c84
bd27b79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import fs from "node:fs" | ||
| import express from "express" | ||
| import { ORCHESTRATOR_AUTH_KEY_ENV, buildUrl } from "valkey-common" | ||
| import { registerGcpTokenRefresh, unregisterGcpTokenRefresh } from "valkey-common" | ||
| import { getConfig } from "./config.js" | ||
| import * as Streamer from "./effects/ndjson-streamer.js" | ||
| import { setupCollectors, stopCollectors } from "./init-collectors.js" | ||
|
|
@@ -33,6 +34,17 @@ async function main() { | |
| const client = await createValkeyClient(cfg) | ||
| const ownNodeId = sanitizeUrl(`${process.env.VALKEY_HOST}-${process.env.VALKEY_PORT}`) | ||
|
|
||
| // GCP OAuth2 tokens expire ~1h; rotate the connection password before then so | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's just reuse the common iam-token-refresh
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is done now. metrics now calls |
||
| // reconnects keep authenticating. AWS IAM refreshes natively inside Glide. | ||
| if (process.env.VALKEY_AUTH_TYPE === "gcp-iam") { | ||
| registerGcpTokenRefresh( | ||
| client, | ||
| "metrics", | ||
| process.env.VALKEY_TLS === "true", | ||
| process.env.VALKEY_VERIFY_CERT !== "false", | ||
| ) | ||
| } | ||
|
|
||
| await setupNdjsonCleaner(cfg) | ||
| await setupCollectors(client, cfg) | ||
|
|
||
|
|
@@ -247,6 +259,7 @@ async function main() { | |
| try { | ||
| await stopNdjsonCleaner() | ||
| await stopCollectors() | ||
| unregisterGcpTokenRefresh(client) | ||
| if (client) { | ||
| client.close() | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.