fix: case insensitive encoding for email triggers (#4211)

* fix: case insensitive encoding for email triggers

* update ee ref
This commit is contained in:
HugoCasa
2024-08-08 11:59:20 +02:00
committed by GitHub
parent 9d581920d5
commit fc07ae93cc
7 changed files with 28 additions and 4 deletions
+7
View File
@@ -1153,6 +1153,12 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
[[package]]
name = "base32"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "022dfe9eb35f19ebbcb51e0b40a5ab759f46ad60cadf7297e0bd085afb50e076"
[[package]]
name = "base64"
version = "0.13.1"
@@ -10443,6 +10449,7 @@ dependencies = [
"async-stripe",
"async_zip",
"axum",
"base32",
"base64 0.21.7",
"bytes",
"candle-core",
+1
View File
@@ -180,6 +180,7 @@ swc_ecma_parser = "=0.144.3"
swc_ecma_ast = "=0.113.7"
swc_ecma_visit = "=0.99.1"
base64 = "0.21.0"
base32 = "^0"
hmac = "0.12.1"
sha2 = "0.10.6"
sqlx = { version = "0.8.0", features = [
+1 -1
View File
@@ -1 +1 @@
86cfcdef47f8b740cbbdf568f7a2282984ea7460
9431876ca4dd2ce51a04b102557daa9f685dc5d5
+1
View File
@@ -51,6 +51,7 @@ chrono.workspace = true
chrono-tz.workspace = true
hex.workspace = true
base64.workspace = true
base32.workspace = true
serde_urlencoded.workspace = true
cron.workspace = true
mime_guess.workspace = true
+6
View File
@@ -42,6 +42,7 @@
"openai": "^4.47.1",
"pdfjs-dist": "^3.8.162",
"quill": "^1.3.7",
"rfc4648": "^1.5.3",
"svelte-carousel": "^1.0.25",
"svelte-chartjs": "^3.1.5",
"svelte-exmarkdown": "^3.0.5",
@@ -8577,6 +8578,11 @@
"node": ">=0.10.0"
}
},
"node_modules/rfc4648": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/rfc4648/-/rfc4648-1.5.3.tgz",
"integrity": "sha512-MjOWxM065+WswwnmNONOT+bD1nXzY9Km6u3kzvnx8F8/HXGZdz3T6e6vZJ8Q/RIMUSp/nxqjH3GwvJDy8ijeQQ=="
},
"node_modules/rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+1
View File
@@ -122,6 +122,7 @@
"openai": "^4.47.1",
"pdfjs-dist": "^3.8.162",
"quill": "^1.3.7",
"rfc4648": "^1.5.3",
"svelte-carousel": "^1.0.25",
"svelte-chartjs": "^3.1.5",
"svelte-exmarkdown": "^3.0.5",
@@ -21,6 +21,7 @@
import Alert from '../common/alert/Alert.svelte'
import { SettingService } from '$lib/gen'
import { base } from '$lib/base'
import { base32 } from 'rfc4648'
let userSettings: UserSettings
@@ -127,9 +128,16 @@
}
function emailAddress() {
return `${$workspaceStore}+${
requestType === 'hash' ? 'hash.' + hash : (isFlow ? 'flow.' : '') + path.replaceAll('/', '.')
}+${token}@${emailDomain}`
const pathOrHash = requestType === 'hash' ? hash : path.replaceAll('/', '.')
const plainPrefix = `${$workspaceStore}+${
(requestType === 'hash' ? 'hash.' : isFlow ? 'flow.' : '') + pathOrHash
}+${token}`
const encodedPrefix = base32
.stringify(new TextEncoder().encode(plainPrefix), {
pad: false
})
.toLowerCase()
return `${pathOrHash}+${encodedPrefix}@${emailDomain}`
}
function fetchCode() {