-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Move Rest API auth related methods to FAB auth manager #34924
Conversation
This reverts commit 4542594.
I think we should make it explicit in docs that those authentication backends for the API are available only when FAB auth manager is used. Likely we should also rename/depreceate the configuration option and make it more of "fab_authentication_manage" option - to configure the backends. This should become a configuration option of "FAB" one effectively which backend is used. There are two things to add (and all this might be part of separate PR I just wanted to make sure that we think about it).
|
Multiple answers here :)
I agree. But this one depends on whether we want to move this FAB auth manager to a separate provider. If so, then the configuration will be moved to the provider configuration (nice feature you needed :)). If not, then, as you said, we'll just have to rename these configurations. There is an issue for this one: #32210.
The authentication for the AIP has not changed. The authentication check is still on here. The only difference being, in case of an auth manager different from FAB,
I guess by UI you refer to the React UI (not the model views auto generated by FAB, these ones do not use APIs). The way I see it and is done, for UI and API, when the backend received a request, it checks if the user is logged in using |
Because there were multiple questions :) .
Cool.
Obviously. I missed the fact that "session_auth" remained where it was. I see that "session" will remain where it was. Clear. And expectation is that if you implement an AuthManger But that sparks another question. Maybe (just maybe and maybe that is the next step) we should not be to hasty to move few others to FAB? What if we also keep And maybe (that's a bit more tricky and maybe it is next step or follow-up) - we also keep
Yes. That I missed the fact that we are leaving the As far as I understand (and I might be wrong), currently the way how to configure backends in order to get the UI working is: |
That's very good point actually. That makes sense to me. |
I'd say we could just leave a base kerberos_auth_base.py: def requires_authentication(function: T, find_user: Callable[..right type here]):
,,,,
g.user = find_user(username=ctx.kerberos_user) fab/kerberos_auth.py: from .. import kerberos_auth_base
from functools import partial
requires_authentication = partial(kerberos_auth_base, find_user=get_airflow_app().appbuilder.sm.find_user) Might be a bit over-the-top, but I think it solves reusability in a very nice way |
Nice! This way, you just need to do something similar if you want your auth manager to provider Kerberos support! |
Precisely |
Here is the way I see it :) There is no such |
Ah... yes. Obviously ! That makes perfect sense |
Multiple authentications are possible for the Rest API. See documentation. With AIP-56, all these configurations besides the session one (which is the default one) should belong to the FAB auth manager.
No new code is created or being removed in this PR, it is only being moved.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.