Skip to content

Commit

Permalink
test(tokens): Add test to ensure tokens redacted
Browse files Browse the repository at this point in the history
The test ensures that when the CLI args are echoed back, anything which might reasonably be an auth token is redacted.
  • Loading branch information
szokeasaurusrex committed Aug 1, 2024
1 parent 2665d8a commit 3d05326
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/integration/_cases/token-redacted.trycmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
```
$ sentry-cli sourcemaps upload --auth-token not-following-token-format -o asdf -p sntrys_project_looks_like_token ./ --log-level=info
? failed
[..]
[..]
[..]INFO[..] sentry-cli was invoked with the following command line: "[..]" "sourcemaps" "upload" "--auth-token" (redacted) "-o" "asdf" "-p" (redacted) "./" "--log-level=info"
...

```
5 changes: 5 additions & 0 deletions tests/integration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,8 @@ pub fn assert_endpoints(mocks: &[Mock]) {
mock.assert();
}
}

#[test]
pub fn token_redacted() {
register_test("token-redacted.trycmd");
}

0 comments on commit 3d05326

Please sign in to comment.