Introduce repository pattern across multiple services, including `favorites`, `tags`, `sessions`, `reports`, `auth`, and more. Decouple crypto functionalities into modular services like `HashingService`, `JwtService`, and `EncryptionService`. Improve testability and maintainability by simplifying dependencies and consolidating utility logic.
13 lines
483 B
JavaScript
13 lines
483 B
JavaScript
module.exports = {
|
|
SignJWT: class {
|
|
constructor() { return this; }
|
|
setProtectedHeader() { return this; }
|
|
setIssuedAt() { return this; }
|
|
setExpirationTime() { return this; }
|
|
sign() { return Promise.resolve('mocked-token'); }
|
|
},
|
|
jwtVerify: () => Promise.resolve({ payload: { sub: 'mocked-user' } }),
|
|
importJWK: () => Promise.resolve({}),
|
|
exportJWK: () => Promise.resolve({}),
|
|
generateKeyPair: () => Promise.resolve({ publicKey: {}, privateKey: {} }),
|
|
}; |