Skip to content

Commit

Permalink
add more tests to cover substring matches
Browse files Browse the repository at this point in the history
  • Loading branch information
tommartensen committed Dec 18, 2024
1 parent 0fa5429 commit 2eaa54d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ nohup.out
test/mocks
__debug_bin*
.DS_Store
report.xml
22 changes: 22 additions & 0 deletions auth/claimrule/claim_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,28 @@ func getDataSets() map[string]dataSet {
}},
err: true,
},
"eq-regex-no-match-substring-claim": {
tokenClaims: map[string]interface{}{
"field": "val",
},
rules: ClaimRules{{
Value: "val1",
Path: "field",
Op: "eq",
}},
err: true,
},
"eq-regex-no-match-substring-rule": {
tokenClaims: map[string]interface{}{
"field": "val23",
},
rules: ClaimRules{{
Value: "val2",
Path: "field",
Op: "eq",
}},
err: true,
},
"in-regex-match": {
tokenClaims: map[string]interface{}{
"field": []string{"val1", "val2"},
Expand Down

0 comments on commit 2eaa54d

Please sign in to comment.