Skip to content

Commit 3d05326

Browse files
test(tokens): Add test to ensure tokens redacted
The test ensures that when the CLI args are echoed back, anything which might reasonably be an auth token is redacted.
1 parent 2665d8a commit 3d05326

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```
2+
$ sentry-cli sourcemaps upload --auth-token not-following-token-format -o asdf -p sntrys_project_looks_like_token ./ --log-level=info
3+
? failed
4+
[..]
5+
[..]
6+
[..]INFO[..] sentry-cli was invoked with the following command line: "[..]" "sourcemaps" "upload" "--auth-token" (redacted) "-o" "asdf" "-p" (redacted) "./" "--log-level=info"
7+
...
8+
9+
```

tests/integration/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,8 @@ pub fn assert_endpoints(mocks: &[Mock]) {
235235
mock.assert();
236236
}
237237
}
238+
239+
#[test]
240+
pub fn token_redacted() {
241+
register_test("token-redacted.trycmd");
242+
}

0 commit comments

Comments
 (0)