Skip to content

Commit 083478b

Browse files
fix: cluster topology connect fails with NOAUTH when username is empty string (#252)
When connecting to a discovered cluster node via the Cluster Topology page, credentials were silently dropped if username was an empty string (e.g. the ElastiCache 'default' user). The condition `primary.username && primary.password` short-circuits to false when username is "", so neither username nor password was sent in the connectPending payload, causing a NOAUTH error on the server side. Fix: gate only on password presence and default username to empty string. Also includes a Dockerfile fix to install ca-certificates for TLS connections. Signed-off-by: Alexey Temnikov <attemnik@amazon.com>
1 parent 2317a02 commit 083478b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

apps/frontend/src/components/cluster-topology/cluster-node.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export function ClusterNode({
4343
const connectionDetails: ConnectionDetails = {
4444
host: primary.host,
4545
port: primary.port.toString(),
46-
...(primary.username && primary.password && {
47-
username: primary.username,
46+
...(primary.password && {
47+
username: primary.username ?? "",
4848
password: await secureStorage.encrypt(primary.password),
4949
}),
5050
tls: primary.tls,

docker/Dockerfile.app

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ RUN npm run build:all
1616
# -------- Production Runtime --------
1717
FROM node:22-bookworm-slim
1818

19+
# Install CA certificates for TLS connections to ElastiCache
20+
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates && rm -rf /var/lib/apt/lists/*
21+
1922
WORKDIR /app
2023

2124
ENV NODE_ENV=production

0 commit comments

Comments
 (0)