Skip to content

Commit 44d7c65

Browse files
authored
Merge branch 'main' into feat/add-charging-target-inputs-improvements
2 parents a0c5533 + 1286d98 commit 44d7c65

File tree

3 files changed

+70
-71
lines changed

3 files changed

+70
-71
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ COPY . .
1515
RUN npm run build
1616

1717
# The same image but now only install the production dependencies as the frontend is already built using vite in the build-stage
18-
FROM gcr.io/distroless/nodejs22-debian12@sha256:fd90468f47e91d0d3c9bc055c8c09edbf0c225c3c795d0c266e2ca94b3ba17e3 AS production
18+
FROM gcr.io/distroless/nodejs22-debian12@sha256:b765815eafacee5222bfa50179028f41dd8c642b68ad68ec4e6922d3b1ff2710 AS production
1919

2020
WORKDIR /usr/src/app
2121

package-lock.json

Lines changed: 61 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/encrypted-session.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ export const ENCRYPTED_COOKIE_REQUEST_DECORATOR = 'encryptedSessionInternal';
1313
export const UNDERLYING_SESSION_NAME_REQUEST_DECORATOR = 'underlyingSessionNotPerUserEncrypted';
1414

1515
// name of the secure-session cookie that stores the encryption key on user side.
16-
export const ENCRYPTION_KEY_COOKIE_NAME = 'session_encryption_key';
16+
export const ENCRYPTION_KEY_COOKIE_NAME = 'session-encryption-key';
1717
// the key used to store the encryption key in the secure-session cookie on user side.
1818
export const ENCRYPTED_COOKIE_KEY_ENCRYPTION_KEY = 'encryptionKey';
1919
// name of the cookie that stores the session identifier on user side.
20-
export const SESSION_COOKIE_NAME = 'session-cookie';
20+
export const SESSION_COOKIE_NAME = 'session';
2121

2222
async function encryptedSession(fastify) {
2323
const { COOKIE_SECRET, SESSION_SECRET } = fastify.config;
@@ -31,7 +31,7 @@ async function encryptedSession(fastify) {
3131
cookie: {
3232
path: '/',
3333
httpOnly: true,
34-
sameSite: "None", // cross-site cookies are needed for the session to work when embedded. By setting CORS to None and CSP.frame-anchestors we restrict the api calls from the browser that contain the cookies to originating from our site only.
34+
sameSite: 'None', // cross-site cookies are needed for the session to work when embedded. By setting CORS to None and CSP.frame-anchestors we restrict the api calls from the browser that contain the cookies to originating from our site only.
3535
partitioned: true, // use for modern isolation of third party cookies when embedded, every embedded iframe (or not embedded) gets its own cookie partition
3636
secure: true,
3737
maxAge: 60 * 60 * 24 * 7, // 7 days
@@ -44,7 +44,7 @@ async function encryptedSession(fastify) {
4444
cookie: {
4545
path: '/',
4646
httpOnly: true,
47-
sameSite: "None", // see secureSession cookie for explanation
47+
sameSite: 'None', // see secureSession cookie for explanation
4848
partitioned: true, // see secureSession cookie for explanation
4949
secure: true,
5050
maxAge: 60 * 60 * 24 * 7, // 7 days
@@ -54,7 +54,7 @@ async function encryptedSession(fastify) {
5454
await fastify.decorateRequest(REQUEST_DECORATOR, {
5555
getter() {
5656
return createStore(this);
57-
}
57+
},
5858
});
5959
}
6060

@@ -105,21 +105,18 @@ function createStore(request) {
105105
return {
106106
async set(key, value) {
107107
unencryptedStore[key] = value;
108-
await save()
108+
await save();
109109
},
110110
get(key) {
111111
return unencryptedStore[key];
112112
},
113113
async delete(key) {
114114
delete unencryptedStore[key];
115-
await save()
116-
},
117-
print() {
118-
console.log("printing", unencryptedStore)
115+
await save();
119116
},
120117
async clear() {
121118
unencryptedStore = {}; // Clear all data
122-
await save()
119+
await save();
123120
},
124121
};
125122
}

0 commit comments

Comments
 (0)