Skip to content

Commit

Permalink
Document each test case
Browse files Browse the repository at this point in the history
Signed-off-by: Oded Ben-Ozer <[email protected]>
  • Loading branch information
Oded-B committed Aug 6, 2023
1 parent faddcdc commit 1e93952
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions connector/oidc/oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,31 +298,33 @@ func TestHandleCallback(t *testing.T) {
expectGroups: []string{"group1", "gh::acme::pipeline-one", "tfe-acme-foobar", "bk-emailvalue"},
expectedEmailField: "emailvalue",
claimConcatenations: []ClaimConcatenation{
{
{ // The basic functionality, should create "gh::acme::pipeline-one".
ClaimList: []string{
"organization",
"pipeline",
},
Delimiter: "::",
Prefix: "gh",
},
{
{ // Non existing claims, should not generate any any new group claim.
ClaimList: []string{
"non-existing1",
"non-existing2",
},
Delimiter: "::",
Prefix: "tfe",
},
{
{ // In this case the delimiter character("-") should be removed removed from "claim-with-delimiter" claim to ensure the resulting
// claim structure is in full control of the Dex operator and not the person creating a new pipeline.
// Should create "tfe-acme-foobar" and not "tfe-acme-foo-bar".
ClaimList: []string{
"organization",
"claim-with-delimiter",
},
Delimiter: "-",
Prefix: "tfe",
},
{
{ // Ignore non string claims (like arrays), this should result in "bk-emailvalue".
ClaimList: []string{
"non-string-claim",
"non-string-claim2",
Expand Down

0 comments on commit 1e93952

Please sign in to comment.