mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
remove client side encryption for connection strings
This commit is contained in:
parent
5a7a0f5a51
commit
4cd96a74ff
@ -47,7 +47,7 @@ export const POST = createSmartRouteHandler({
|
||||
|
||||
const uuidConnectionStrings: Record<string, string> = {};
|
||||
const store = await stackServerApp.getDataVaultStore('neon-connection-strings');
|
||||
const secret = getEnvVariable('STACK_SERVER_SECRET');
|
||||
const secret = "no client side encryption";
|
||||
for (const c of req.body.connection_strings) {
|
||||
const uuid = generateUuid();
|
||||
await store.setValue(uuid, c.connection_string, { secret });
|
||||
|
||||
@ -41,7 +41,7 @@ export const POST = createSmartRouteHandler({
|
||||
|
||||
if (hasNeonConnections) {
|
||||
const store = await stackServerApp.getDataVaultStore('neon-connection-strings');
|
||||
const secret = getEnvVariable('STACK_SERVER_SECRET');
|
||||
const secret = "no client side encryption";
|
||||
|
||||
for (const c of req.body.connection_strings!) {
|
||||
const uuid = generateUuid();
|
||||
|
||||
@ -55,7 +55,7 @@ async function resolveNeonConnectionString(entry: string): Promise<string> {
|
||||
return entry;
|
||||
}
|
||||
const store = await stackServerApp.getDataVaultStore('neon-connection-strings');
|
||||
const secret = getEnvVariable('STACK_SERVER_SECRET');
|
||||
const secret = "no client side encryption";
|
||||
const value = await store.getValue(entry, { secret });
|
||||
if (!value) throw new Error('No Neon connection string found for UUID');
|
||||
return value;
|
||||
|
||||
@ -282,12 +282,12 @@ it("can provision with a Neon connection string when provided via env (optional)
|
||||
method: "POST",
|
||||
accessType: "server",
|
||||
body: {
|
||||
hashed_key: await hashKey("23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo", sourceOfTruth.connectionStrings.main),
|
||||
hashed_key: await hashKey("no client side encryption", sourceOfTruth.connectionStrings.main),
|
||||
},
|
||||
});
|
||||
expect(getConnectionResponse.status).toBe(200);
|
||||
const connectionString = await decryptValue(
|
||||
"23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo",
|
||||
"no client side encryption",
|
||||
sourceOfTruth.connectionStrings.main,
|
||||
getConnectionResponse.body.encrypted_value
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user