-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Change logic in auth with swagger ui #53597
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
Conversation
vincbeck
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.
Nice! Can you update tests to cover that?
5e27f9d to
8bb8ae6
Compare
ebd3ec8 to
25becb1
Compare
|
I found CI bug. -> I will make 2 PR
|
592c206 to
3ff212c
Compare
203c429 to
c332acd
Compare
e83720b to
28c888f
Compare
ashb
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.
Please check out the settings we have in the Execution API sub-application.
airflow-core/src/airflow/api_fastapi/auth/managers/simple/routes/login.py
Outdated
Show resolved
Hide resolved
Reflections on the Feedback and Purpose of the PRAfter receiving the feedback yesterday, I spent some time reflecting on Airflow's philosophy and current internal structure. From my perspective, there seems to be a distinction between the authentication mechanisms used for user-facing APIs and those used internally between components within Airflow. The reason I created this PR was to improve the developer experience for users interacting with the Airflow API through Swagger UI, making it easier to test and trigger endpoints directly. During this process, I noticed that a 422 Unprocessable Entity error was occurring when using application/x-www-form-urlencoded content type. While working on this, I also observed that JWT token handling in Airflow is not yet fully unified across different parts of the system. (Note: I drafted my thoughts and structure in Korean first, based on my understanding of the feedback and the current state of the codebase. If there's anything I may have misunderstood, I’d really appreciate your clarification. |
619e146 to
49e42c2
Compare
d98afb8 to
2ce8683
Compare
airflow-core/src/airflow/api_fastapi/auth/managers/simple/utils.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/openapi-gen/queries/queries.ts
Outdated
Show resolved
Hide resolved
50e0419 to
280de53
Compare
280de53 to
9f78fc3
Compare
...e/src/airflow/api_fastapi/auth/managers/simple/openapi/v2-simple-auth-manager-generated.yaml
Show resolved
Hide resolved
9f78fc3 to
d662892
Compare
jason810496
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.
Cool! LGTM.
bugraoz93
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.
Looks good! Thanks @kyungjunleeme ! Small suggestion to speed up the procedures, please resolve any thread you think you addressed. This can make merging a lot easier since not everyone checking the PR has the full context of all of the threads :)
|
@bugraoz93 Thank you, I followed your instructions |
|
Update: I can dismissed review from ash |
|
Ah ha thank you for telling me! :) |
* ADD: test code for application/x-www-form-urlencoded * ADD: FORM * ADD: header_content_type_json_or_form_depends * NEW: parse_login_body * CHG: create_token * DEL: parametrize
* ADD: test code for application/x-www-form-urlencoded * ADD: FORM * ADD: header_content_type_json_or_form_depends * NEW: parse_login_body * CHG: create_token * DEL: parametrize

Descritpion
422 root cause related with this
https://github.com/fastapi/fastapi/issues/1431first)
I added this logic to manually convert the request body to a LoginBody instance when it’s received as a dictionary (e.g., from application/x-www-form-urlencoded).
changed my mind)
I think that airflow needs to support both
application/jsonandapplication/x-www-form-urlencodedcontent types.This helps prevent FastAPI from raising a 422 Unprocessable Entity error due to automatic validation failure.
#53567 related. (first this pr merged -> 53597)
Result
cf) https://github.com/koxudaxi/datamodel-code-generator
^ 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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.