-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement OpenID token expressions evaluation #63
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR, a bit complex since this adds lots of things in the same PR - would have been nice if this could be split, but that's ok.
I've put few remarks, and the patch seems breaking.
Also, you might need to rebase, since I've merged some lib updates.
} | ||
} | ||
|
||
return &StaticOIDCClientsStore{clients: clients} | ||
} | ||
|
||
func NewEmptyStaticOIDCClientStore() *StaticOIDCClientsStore { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably be removed since never used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that NewStaticOIDCClientStore is used here https://github.com/ErmakovDmitriy/haproxy-spoe-auth/blob/83168273b5dfb93155e124958989b14f471e7ce6/cmd/haproxy-spoe-auth/main.go#L141
and NewEmptyStaticOIDCClientStore is used in a test: https://github.com/ErmakovDmitriy/haproxy-spoe-auth/blob/83168273b5dfb93155e124958989b14f471e7ce6/internal/auth/oidc_clients_store_test.go#L12
return "" | ||
} | ||
|
||
const ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To simplify, you could probably merge this with the constants
operationIn string = "in"
operationNotIn string = "notin"
operationExists string = "exists"
operationDoesNotExist string = "doesnotexist"
)```
so that during the assignement it becomes as simple as
expr.Operation = val[0].value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry, I might have misunderstood your idea but I can not see how I can simplify this.
May I ask you to explain me?
Hi mougams, Thank you and sorry for such a complex PR. I will try to fix what you requested and update this PR. |
Bumps [github.com/tidwall/gjson](https://github.com/tidwall/gjson) from 1.17.3 to 1.18.0. - [Commits](tidwall/gjson@v1.17.3...v1.18.0) --- updated-dependencies: - dependency-name: github.com/tidwall/gjson dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.22.0 to 0.25.0. - [Commits](golang/oauth2@v0.22.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](stretchr/testify@v1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
This implicitly bumps crypto lib which fixes a CVE. https://github.com/go-ldap/ldap/releases/tag/v3.4.9
Bumps [github.com/coreos/go-oidc/v3](https://github.com/coreos/go-oidc) from 3.11.0 to 3.12.0. - [Release notes](https://github.com/coreos/go-oidc/releases) - [Commits](coreos/go-oidc@v3.11.0...v3.12.0) --- updated-dependencies: - dependency-name: github.com/coreos/go-oidc/v3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github.com/go-ldap/ldap/v3](https://github.com/go-ldap/ldap) from 3.4.9 to 3.4.10. - [Release notes](https://github.com/go-ldap/ldap/releases) - [Commits](go-ldap/ldap@v3.4.9...v3.4.10) --- updated-dependencies: - dependency-name: github.com/go-ldap/ldap/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github.com/go-jose/go-jose/v4](https://github.com/go-jose/go-jose) from 4.0.2 to 4.0.5. - [Release notes](https://github.com/go-jose/go-jose/releases) - [Changelog](https://github.com/go-jose/go-jose/blob/main/CHANGELOG.md) - [Commits](go-jose/go-jose@v4.0.2...v4.0.5) --- updated-dependencies: - dependency-name: github.com/go-jose/go-jose/v4 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
This PR implements an OpenID token expression evaluation.
The idea and the use-case is to be able to define different behavior in HAProxy based on OpenID token claims.
An example:
roles
which is an array of admin, viewer, editor;/admin
URL path only for people withadmin
role;With this PR, it is possible to define in HAProxy: