-
Notifications
You must be signed in to change notification settings - Fork 5
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
Filing waivers in Fedora fails with [ERROR] waiverdb.app: User info field 'sub' is unavailable; available are: dict_keys([])
#219
Comments
hmm, this may be specific to filing waivers via Bodhi. It looks to me like this code is correct assuming a normally-logged-in user is filing a waiver directly in waiverdb, but that is not how it's usually done in Fedora; people usually file waivers by clicking the 'waive' button in Bodhi, which causes Bodhi to do it. I suspect the way we let Bodhi submit waivers doesn't look sufficiently like a normally-logged-in-via-OIDC session and that's causing this to fail. But I'm having trouble digging up exactly how we have things set up so Bodhi has privs on waiverdb. |
okay, I think I found how we let Bodhi file to waiverdb - it's a special long-lasting token. The token value itself is an ansible secret. Bodhi has that token in its config. I guess the token was manually generated as I can find no other reference to it in ansible anywhere. When Bodhi sends a waiver to waiverdb, it includes that token in the headers. So...either this updated code for authorized user checking in waiverdb either needs to still handle that setup, or we need to tweak that setup somehow so that |
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
#220 might fix this, but it's just a guess based on https://flask-oidc.readthedocs.io/en/latest/#resource-server . |
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
…ng#219) Signed-off-by: Adam Williamson <[email protected]>
Oh, maybe #218 fixes this. |
The fix was deployed to stage ( BTW, it should also be possible to use the new web form: https://waiverdb.stg.fedoraproject.org/api/v1.0/waivers/new |
Great, I'll see if I can test it (it's a bit tricky to get staging Bodhi to file waivers, but I can probably bodge it somehow). The form is nice, but still much harder work than just hitting the button in Bodhi, which figures out the appropriate details of the waiver(s) automatically. |
You pass the default form field values through query parameters, letting user to specify just the comment. |
well, I mean, sure, but then something has to construct that URL. Are you saying Bodhi could do that instead of just auto-generating waivers? I guess it could, I'm not sure whether it's an improvement... edit...well, maybe it would be an improvement...it would mean we wouldn't need this magic token/superuser setup...but it does mean users would have to fill in the form multiple times to waive multiple failures...not that I'm against more hurdles in the way of the waiver cannon... |
This is to help us figure out release-engineering/waiverdb#219 , it adds an auth debugging endpoint so we can verify exactly what fields are present when doing token auth... Signed-off-by: Adam Williamson <[email protected]>
Hi all, any ETA on this? I have build with tests which failed on infrastructure error, and I can't waive them due this issue :) . e.g. https://bodhi.fedoraproject.org/updates/FEDORA-2024-4048cd7d28 . |
I've released the fix to production. Can you check if it works now? Otherwise, we can rollback to an older working version. |
We've tested yesterday using my test_auth point with @AdamWill |
So, latest issue we found is a difference between RH internal (keycloak) and Fedora (ipsilon) auth providers; waiverdb is now relying on token introspection via flask-oidc instead of validating the token itself, but flask-oidc expects the server to include a |
ugh, so now that's fixed, we've got another error:
|
Note, I'm pretty sure this is not a waiverdb issue. All waiverdb is doing here is decorating a route with the It's a bug somewhere between ipsilon, flask-oidc and authlib, I think. @abompard @puiterwijk any ideas? |
possibly something should be calling |
ehh, not sure that's it. I messed around with a test script that hits the token introspection endpoint:
If I run that script with the correct token string and client secret, I get a response that looks like it ought to make everything happy (it has an active key with value
If I run that script with an invalid token value - e.g. the correct token prefixed with "Bearer ", as I wondered if the problem might be that nothing's stripping that prefix from the token string - I get this response:
which shouldn't cause the problem we're seeing, because it does have an |
a weird thing about the failure we're getting here is that it implies |
okay, progress: this is because authlib is using the wrong I'm now drowning in the stuff in
...and how authlib actually expects it to be done. It is hard to puzzle out. edit: aha, I think I've got it, I think it's a bug in authlib. testing a fix. |
Wow, thank for the updates! This makes me think that making OIDC work in multiple infras is impossible task. 😿 |
lepture/authlib#662 fixes this in my testing at least. Of course, we have to get it into the waiverdb container to fix this for real. I am using a hideous method to do it for testing - carrying a copy of |
ehh, well in this specific case - if I'm right - that's kinda incidental...at a guess, maybe for keycloak, |
Yeah, that is that case. We still support the old kerberos/keytab authentication (so To get the token auth working internally, you would need to request a special service account. Currently, this is only tested with the waiverdb keycloak account via The token auth could be handy in some cases (especially when delegating waiving through a different service) but I would prefer users to go to the prefilled waiver form because waiving tests should not be usually automated. |
ugh...well, my fix makes my test script that hits the test auth endpoint with the correct token work, but waiving from staging bodhi still doesn't work (with the |
oh, hah, I think I see why. the endpoint bodhi hits is served by WaiversResource, which doesn't have the |
Hmm, I thought that would be fixed in #221. Did you test that fix? cc @mvalik We cannot use the decorator because we want to support also the other auth methods (kerberos; based on |
oh, I don't have that PR on the branch I'm working from. If that's preferable to adding the decorator, I can do it. I was assuming the decorator was rather...additive, than exclusive, IYSWIM. |
I confirmed at least that adding the decorator fixes waiving from staging Bodhi. waiver 5424 at https://waiverdb.stg.fedoraproject.org/api/v1.0/waivers/ was created that way. It's late here, so I'm going to bed, we can figure out the details later. note that currently I've set Fedora staging waiverdb to use my own container remote - https://quay.io/repository/adamwill/waiverdb-test - so you can't push anything there right now. It's running commit 4548471 , plus the |
well, I lied about going to bed...I tweaked it so now staging waiverdb is running 4548471 plus the authlib fix and the changes from #221 but not adding the decorator to |
…engineering#219) Signed-off-by: Adam Williamson <[email protected]>
…engineering#219) Signed-off-by: Adam Williamson <[email protected]>
…engineering#219) Signed-off-by: Adam Williamson <[email protected]>
…engineering#219) Signed-off-by: Adam Williamson <[email protected]>
…engineering#219) Signed-off-by: Adam Williamson <[email protected]>
) Signed-off-by: Adam Williamson <[email protected]>
The issue has been resolved, closing. |
well, it looks like the container build of waiverdb with the fix has been tagged as 'stage', 'latest' and 'master', but not 'prod' or 'prod-fedora'. Before I started poking at this, staging used the 'latest' tag, but prod uses 'prod-fedora', so we need the fixed container to have that tag in order to go back to 'normal'. If we flip the ansible config back to how it used to be right now, prod will break. |
@AdamWill I have released the new version with |
The fixes for release-engineering/waiverdb#219 were merged and the factory2 'latest' image now includes them. 'prod-fedora' does not, so for now, we'll have prod use 'latest' instead. Signed-off-by: Adam Williamson <[email protected]>
Several folks have reported recently that filing waivers for Fedora no longer works (I am tempted to call this a feature, but I'd probably get pelted with rotten fruit). Looking at the logs, we see:
The relevant code was heavily refactored in 2a4d031 and then touched again in abea90e , so something in those two commits is likely the issue. I will see if I can figure it out this afternoon.
CC @xvitaly @omajid
The text was updated successfully, but these errors were encountered: