Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update go-bexpr to allow colons in paths; add a test #1453

Merged
merged 3 commits into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/hashicorp/dawdle v0.4.0
github.com/hashicorp/dbassert v0.0.0-20200930125617-6218396928df
github.com/hashicorp/eventlogger v0.1.0
github.com/hashicorp/go-bexpr v0.1.8
github.com/hashicorp/go-bexpr v0.1.9
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-hclog v0.16.2
github.com/hashicorp/go-kms-wrapping v0.6.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/eventlogger v0.1.0 h1:S6xc4gZVzewuDUP4R4Ngko419h/CGDuV/b4ADL3XLik=
github.com/hashicorp/eventlogger v0.1.0/go.mod h1:a3IXf1aEJfpCPzseTOrwKj4fVW/Qn3oEmpQeaIznzH0=
github.com/hashicorp/go-bexpr v0.1.8 h1:ETfuLF1bBAuHW/Qg6l1xCdV8WJ7lfatLtJ1N1w0IsfE=
github.com/hashicorp/go-bexpr v0.1.8/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0=
github.com/hashicorp/go-bexpr v0.1.9 h1:ouAaFgGdp28SwSFYbJycLo9hNWwbtgESzTVKeBC21pw=
github.com/hashicorp/go-bexpr v0.1.9/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
Expand Down
17 changes: 13 additions & 4 deletions internal/auth/oidc/service_callback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,10 +679,11 @@ func Test_ManagedGroupFiltering(t *testing.T) {
tp.SetExpectedSubject(sub)
tp.SetCustomAudience("foo", "alice-rp")
info := map[string]interface{}{
"roles": []string{"user", "operator"},
"sub": "[email protected]",
"email": "[email protected]",
"name": "alice doe joe foe",
"roles": []string{"user", "operator"},
"sub": "[email protected]",
"email": "[email protected]",
"name": "alice doe joe foe",
"co:lon": "colon",
}
tp.SetUserInfoReply(info)

Expand Down Expand Up @@ -733,6 +734,14 @@ func Test_ManagedGroupFiltering(t *testing.T) {
},
matchingMgs: mgs[1:2],
},
{
name: "colon test",
filters: []string{
TestFakeManagedGroupFilter,
`"/userinfo/co:lon" == "colon"`,
},
matchingMgs: mgs[1:2],
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down