-
-
Notifications
You must be signed in to change notification settings - Fork 493
[17.0][IMP] auth_oidc: add groups' handling #682
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
base: 17.0
Are you sure you want to change the base?
Conversation
|
Hi @sbidoul, |
ae41059 to
96788d5
Compare
|
the v14 PR is based on my v12 PR which was merged - why didn't you just forward port this? |
|
@hbrunn thanks for asking! As I'm quite fresh in the Odoo ecosystem, I did not see the v12 PR. Care to share a link? As you can see from the code, my patch works a bit differently; as it appeared that what I needed for group mapping was directly in the access token, there's no usage of the data_endpoint. But I'm also likely not fluent enough in OAuth2 to know if that is really a correct way too. Well; in any case, I'm happy to work towards merging either this or your v12 PR (or a mix of both) for v17. We need @sbidoul 's input, right? |
|
you find the v12 PR here |
96788d5 to
b360551
Compare
|
@hbrunn Great. Thanks for the pointer to the v12 PR. I've now understood the code much better, and did a mostly-straightforward port, with just two minor additions as separate commits. Could you perhaps review? |
|
As the codecov warnings seem critical, I've now added some more tests around the safe_eval call of the expressions. Edit: and now also added some groups' assignment/deassignment checks, pushing the codecov bar above the needed limits. |
a242ae4 to
7587cf0
Compare
hbrunn
left a comment
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.
thanks, just minor stylistic things
|
@OdyX please rebase your branch. If you allow edits by maintainers, I could say /ocabot rebase and it would do this automatically |
|
@hbrunn The rebase process failed, because command |
8f270be to
b9318fa
Compare
b9318fa to
7f29f85
Compare
|
Rebased and pushed. It would be nice to have @sbidoul 's input and get this merged (or commented upon). |
sbidoul
left a comment
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.
Sorry folks for the delay.
I've not had time to do a deep review yet, but I have a couple a questions from a first read.
c09d1f2 to
bc39e7b
Compare
|
@sbidoul Could you perhaps take another look? |
39c559c to
61c630f
Compare
|
@sbidoul Force-pushed a rebase with the comment suggestion included in the first commit. (twice because I forgot about |
|
I'm not comfortable with replacing upstream method completely. Is there no other way? It is not clear to me why it is necessary for this PR but I have unfortunately no time to dig into this until October. |
583c517 to
77c5c2d
Compare
|
@sbidoul I managed to dive back into this code again.
It turns out, there is. See 77c5c2d . In there, we just delete the duplicated code from I'd be thrilled if we could merge this in 17.0, and I'd then be happy with forward porting these to 18.0 and 19.0 as needed. (edited: sorry for the multiple force-pushes; tests turned out to be… relevant :-) ) |
77c5c2d to
89a2a5f
Compare
It turns out, after more tests and a (yet) better understanding of the code, doing so is actually worse than using the upstream code: the "Authorization: Bearer" is behind a system-level toggle, which makes things unnecessarily confusing and hard to debug. I finally went with just a copy of the response checker in 89a2a5f (and I could live without that last commit). |
Co-authored-by: Holger Brunn <mail@hunki-enterprises.com>
89a2a5f to
853d71b
Compare
This allows groups' handling via a token's attributes as passed by either a Keycloak or a Gitlab instance serving as IdP.
@sbidoul : I'd be happy to make any necessary changes!