tangled
alpha
login
or
join now
nekomimi.pet
/
wisp.place-monorepo
88
fork
atom
Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol.
wisp.place
88
fork
atom
overview
issues
9
pulls
pipelines
make jwk rotation 6 months, fix query to check created_at
nekomimi.pet
1 month ago
6e392755
4c8ab606
1/2
deploy-wisp.yml
success
35s
test.yml
failed
28s
+6
-4
1 changed file
expand all
collapse all
unified
split
apps
main-app
src
lib
oauth-client.ts
+6
-4
apps/main-app/src/lib/oauth-client.ts
···
161
161
await db`
162
162
INSERT INTO oauth_keys (kid, jwk, created_at)
163
163
VALUES (${kid}, ${JSON.stringify(priv)}, EXTRACT(EPOCH FROM NOW()))
164
164
-
ON CONFLICT (kid) DO UPDATE SET jwk = EXCLUDED.jwk
164
164
+
ON CONFLICT (kid) DO UPDATE SET
165
165
+
jwk = EXCLUDED.jwk,
166
166
+
created_at = EXCLUDED.created_at
165
167
`;
166
168
};
167
169
···
201
203
return await loadPersistedKeys();
202
204
};
203
205
204
204
-
// Key rotation - rotate keys older than 30 days (monthly rotation)
205
205
-
const KEY_MAX_AGE = 30 * 24 * 60 * 60; // 30 days in seconds
206
206
+
// Key rotation - rotate keys older than 6 months
207
207
+
const KEY_MAX_AGE = 182.5 * 24 * 60 * 60; // ~6 months in seconds
206
208
207
209
export const rotateKeysIfNeeded = async (): Promise<boolean> => {
208
210
const now = Math.floor(Date.now() / 1000);
···
221
223
return false;
222
224
}
223
225
224
224
-
logger.info(`[KeyRotation] Found ${oldKeys.length} key(s) older than 30 days, rotating oldest key`);
226
226
+
logger.info(`[KeyRotation] Found ${oldKeys.length} key(s) older than 6 months, rotating oldest key`);
225
227
226
228
// Rotate the oldest key
227
229
const oldestKey = oldKeys[0];