Skip to content

Commit 9eb744d

Browse files
committed
chore: update token generation
1 parent c268b39 commit 9eb744d

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/replane-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: release-replane-image
22

33
on:
44
push:
5-
branches: [ main ]
6-
tags: [ 'v*.*.*' ]
5+
branches: [main]
6+
tags: ['v*.*.*']
77

88
permissions:
99
contents: read

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
FROM node:22-alpine AS base
99
WORKDIR /app
1010
ENV NODE_ENV=production \
11-
NEXT_TELEMETRY_DISABLED=1
11+
NEXT_TELEMETRY_DISABLED=1
1212

1313
# 2) Dependencies (install all deps including dev for build)
1414
FROM base AS deps
@@ -37,7 +37,7 @@ RUN pnpm prune --prod
3737
FROM node:22-alpine AS runner
3838
WORKDIR /app
3939
ENV NODE_ENV=production \
40-
NEXT_TELEMETRY_DISABLED=1
40+
NEXT_TELEMETRY_DISABLED=1
4141
ARG NEXT_PUBLIC_BUILD_SHA
4242
ENV NEXT_PUBLIC_BUILD_SHA=$NEXT_PUBLIC_BUILD_SHA
4343

src/engine/core/api-token-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import crypto from 'node:crypto';
22
import {parse as uuidParse, stringify as uuidStringify} from 'uuid';
33

4-
export const API_TOKEN_PREFIX = 'cm_'; // distinct from previous 'cm_' usage
4+
export const API_TOKEN_PREFIX = 'rp_'; // distinct from previous 'cm_' usage
55

66
// Basic canonical UUID (any version) validation regex.
77
const UUID_REGEX = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;

tests/api-keys.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('api keys', () => {
1616
});
1717

1818
// Expect format: cm.<80 hex chars> (24 random bytes + 16 uuid bytes)
19-
expect(result.apiKey.token).toMatch(/^cm_[a-f0-9]{80}$/i);
19+
expect(result.apiKey.token).toMatch(/^rp_[a-f0-9]{80}$/i);
2020
expect(result.apiKey.name).toBe('Primary Key');
2121
expect(result.apiKey.description).toBe('Main key');
2222

tests/create-api-key.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('createApiKey', () => {
1616
});
1717

1818
// Expect format: cm_<80 hex chars> (24 random bytes + 16 uuid bytes)
19-
expect(result.apiKey.token).toMatch(/^cm_[a-f0-9]{80}$/i);
19+
expect(result.apiKey.token).toMatch(/^rp_[a-f0-9]{80}$/i);
2020
expect(result.apiKey.name).toBe('Primary Key');
2121
expect(result.apiKey.description).toBe('Main key');
2222
});

0 commit comments

Comments
 (0)