-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Redact bearer tokens in insta snapshots (#325)
Also, implement `From` for various `Subject` enum variants.
- Loading branch information
1 parent
9ede96c
commit 9b054a6
Showing
17 changed files
with
282 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...t/snapshots/roadster__middleware__http__auth__jwt__tests__subject_from_string@case_1.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
Uri( | ||
Url { | ||
scheme: "http", | ||
cannot_be_a_base: false, | ||
username: "", | ||
password: None, | ||
host: Some( | ||
Domain( | ||
"example.com", | ||
), | ||
), | ||
port: None, | ||
path: "/", | ||
query: None, | ||
fragment: None, | ||
}, | ||
) |
7 changes: 7 additions & 0 deletions
7
...t/snapshots/roadster__middleware__http__auth__jwt__tests__subject_from_string@case_2.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
Uuid( | ||
[uuid], | ||
) |
7 changes: 7 additions & 0 deletions
7
...t/snapshots/roadster__middleware__http__auth__jwt__tests__subject_from_string@case_3.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
Int( | ||
1234, | ||
) |
7 changes: 7 additions & 0 deletions
7
...t/snapshots/roadster__middleware__http__auth__jwt__tests__subject_from_string@case_4.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
String( | ||
"foo", | ||
) |
7 changes: 7 additions & 0 deletions
7
...hots/roadster__middleware__http__auth__jwt__tests__subject_from_u16@subject_from_u16.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
Int( | ||
1234, | ||
) |
7 changes: 7 additions & 0 deletions
7
...hots/roadster__middleware__http__auth__jwt__tests__subject_from_u32@subject_from_u32.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
Int( | ||
1234, | ||
) |
7 changes: 7 additions & 0 deletions
7
...hots/roadster__middleware__http__auth__jwt__tests__subject_from_u64@subject_from_u64.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
Int( | ||
1234, | ||
) |
7 changes: 7 additions & 0 deletions
7
...pshots/roadster__middleware__http__auth__jwt__tests__subject_from_u8@subject_from_u8.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
Int( | ||
12, | ||
) |
21 changes: 21 additions & 0 deletions
21
...tp/auth/jwt/snapshots/roadster__middleware__http__auth__jwt__tests__subject_from_uri.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
Uri( | ||
Url { | ||
scheme: "https", | ||
cannot_be_a_base: false, | ||
username: "", | ||
password: None, | ||
host: Some( | ||
Domain( | ||
"example.com", | ||
), | ||
), | ||
port: None, | ||
path: "/", | ||
query: None, | ||
fragment: None, | ||
}, | ||
) |
7 changes: 7 additions & 0 deletions
7
...ts/roadster__middleware__http__auth__jwt__tests__subject_from_uuid@subject_from_uuid.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: src/middleware/http/auth/jwt/mod.rs | ||
expression: subject | ||
--- | ||
Uuid( | ||
[uuid], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/testing/snapshots/roadster__testing__snapshot__tests__bearer_token@case_1.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: src/testing/snapshot.rs | ||
expression: "format!(\"Foo {token} bar\")" | ||
--- | ||
Foo Sensitive bar |
5 changes: 5 additions & 0 deletions
5
src/testing/snapshots/roadster__testing__snapshot__tests__bearer_token@case_2.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: src/testing/snapshot.rs | ||
expression: "format!(\"Foo {token} bar\")" | ||
--- | ||
Foo Sensitive bar |
5 changes: 5 additions & 0 deletions
5
src/testing/snapshots/roadster__testing__snapshot__tests__bearer_token@case_3.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: src/testing/snapshot.rs | ||
expression: "format!(\"Foo {token} bar\")" | ||
--- | ||
Foo Sensitive bar |
5 changes: 5 additions & 0 deletions
5
src/testing/snapshots/roadster__testing__snapshot__tests__bearer_token@case_4.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: src/testing/snapshot.rs | ||
expression: "format!(\"Foo {token} bar\")" | ||
--- | ||
Foo Sensitive bar |
5 changes: 5 additions & 0 deletions
5
src/testing/snapshots/roadster__testing__snapshot__tests__bearer_token@case_5.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: src/testing/snapshot.rs | ||
expression: "format!(\"Foo {token} bar\")" | ||
--- | ||
Foo Sensitive; bar |