Skip to content

Commit 2e067ae

Browse files
fix: replace misleading value_prefix_len with actual prefix in token snapshots
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1a288ef commit 2e067ae

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

crates/uselesskey-token/tests/snapshots/snapshots_token__token_api_key_shape.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ expression: result
55
label: snapshot-api-key
66
kind: api_key
77
value_len: 40
8-
starts_with_uk_test: true
8+
prefix: uk_test_
99
authorization_header_prefix: ApiKey

crates/uselesskey-token/tests/snapshots/snapshots_token__token_bearer_shape.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ expression: result
55
label: snapshot-bearer
66
kind: bearer
77
value_len: 43
8-
starts_with_uk_test: false
8+
prefix: bEHjRLHk
99
authorization_header_prefix: Bearer

crates/uselesskey-token/tests/snapshots_token.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct TokenSnapshot {
1414
label: &'static str,
1515
kind: &'static str,
1616
value_len: usize,
17-
starts_with_uk_test: bool,
17+
prefix: String,
1818
authorization_header_prefix: String,
1919
}
2020

@@ -27,7 +27,7 @@ fn snapshot_api_key_shape() {
2727
label: "snapshot-api-key",
2828
kind: "api_key",
2929
value_len: tok.value().len(),
30-
starts_with_uk_test: tok.value().starts_with("uk_test_"),
30+
prefix: tok.value().chars().take(8).collect::<String>(),
3131
authorization_header_prefix: tok
3232
.authorization_header()
3333
.split(' ')
@@ -48,7 +48,7 @@ fn snapshot_bearer_shape() {
4848
label: "snapshot-bearer",
4949
kind: "bearer",
5050
value_len: tok.value().len(),
51-
starts_with_uk_test: tok.value().starts_with("uk_test_"),
51+
prefix: tok.value().chars().take(8).collect::<String>(),
5252
authorization_header_prefix: tok
5353
.authorization_header()
5454
.split(' ')

0 commit comments

Comments
 (0)