mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-18 23:45:26 +02:00
current stand
This commit is contained in:
parent
61291147c2
commit
d3276e7e6e
13
__tests__/get-encryption-password.test.ts
Normal file
13
__tests__/get-encryption-password.test.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import getEncryptionPassword from "../src/utils/get-encryption-password"
|
||||
|
||||
describe("getEncryptionPassword", () => {
|
||||
it("is defined", () => {
|
||||
expect(getEncryptionPassword).toBeDefined()
|
||||
})
|
||||
|
||||
it("returns a string", async () => {
|
||||
const result = await getEncryptionPassword("test@kleckrelay.example", "password", "salt")
|
||||
|
||||
expect(typeof result).toBe("string")
|
||||
})
|
||||
})
|
31
package.json
31
package.json
@ -6,7 +6,8 @@
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.10.4",
|
||||
@ -49,13 +50,14 @@
|
||||
"yup-locales": "^1.2.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@peculiar/webcrypto": "^1.4.1",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/date-fns": "^2.6.0",
|
||||
"@types/deep-equal": "^1.0.1",
|
||||
"@types/group-array": "^1.0.1",
|
||||
"@types/jest": "^29.2.4",
|
||||
"@types/node": "^18.11.18",
|
||||
"@types/openpgp": "^4.4.18",
|
||||
"@types/react": "^18.0.17",
|
||||
"@types/react-dom": "^18.0.6",
|
||||
"@types/react-icons": "^3.0.0",
|
||||
"@types/react-router": "^5.1.19",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
@ -72,12 +74,33 @@
|
||||
"eslint-plugin-ordered-imports": "^0.6.0",
|
||||
"eslint-plugin-react": "^7.31.10",
|
||||
"eslint-plugin-react-i18n": "^1.0.3",
|
||||
"jest": "^29.3.1",
|
||||
"jest-environment-jsdom": "^29.3.1",
|
||||
"prettier": "^2.7.1",
|
||||
"ts-jest": "^29.0.3",
|
||||
"typescript": "^4.6.4",
|
||||
"vite": "^3.1.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"defaults",
|
||||
"not op_mini all"
|
||||
]
|
||||
],
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testEnvironment": "jsdom",
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
},
|
||||
"testMatch": [
|
||||
"**/__tests__/**/*.test.ts?(x)"
|
||||
],
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"jsx",
|
||||
"json",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ export interface ServerSettings {
|
||||
emailResendWaitTime: number
|
||||
emailLoginExpirationInSeconds: number
|
||||
customAliasSuffixLength: number
|
||||
instanceSalt: string
|
||||
}
|
||||
|
||||
export interface Alias {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Crypto from "crypto-js"
|
||||
|
||||
export default function encryptString(value: string, password: string): string {
|
||||
return Crypto.AES.encrypt(value, password).toString()
|
||||
export default function encryptString(value: string, key: CryptoKey): string {
|
||||
return Crypto.AES.encrypt(value).toString()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user