Skip to content

Commit bb7d089

Browse files
committed
insta: Redact email confirmation tokens
1 parent 525e9bb commit bb7d089

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tests/util/test_app.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ impl TestApp {
189189
static DATE_TIME_REGEX: LazyLock<Regex> =
190190
LazyLock::new(|| Regex::new(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z").unwrap());
191191

192+
static EMAIL_CONFIRM_REGEX: LazyLock<Regex> =
193+
LazyLock::new(|| Regex::new(r"/confirm/\w+").unwrap());
194+
192195
static INVITE_TOKEN_REGEX: LazyLock<Regex> =
193196
LazyLock::new(|| Regex::new(r"/accept-invite/\w+").unwrap());
194197

@@ -199,6 +202,7 @@ impl TestApp {
199202
.map(|email| {
200203
let email = EMAIL_HEADER_REGEX.replace_all(&email, "");
201204
let email = DATE_TIME_REGEX.replace_all(&email, "[0000-00-00T00:00:00Z]");
205+
let email = EMAIL_CONFIRM_REGEX.replace_all(&email, "/confirm/[confirm-token]");
202206
let email = INVITE_TOKEN_REGEX.replace_all(&email, "/accept-invite/[invite-token]");
203207
email.to_string()
204208
})

0 commit comments

Comments
 (0)