-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[BUG][Python-fastapi] Ensure that authentication tokens are passed from the endpoint to implementation #20317
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: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ def __init_subclass__(cls, **kwargs): | |
async def create_user( | ||
self, | ||
user: Annotated[User, Field(description="Created user object")], | ||
token_api_key: str | ||
) -> None: | ||
"""This can only be done by the logged in user.""" | ||
... | ||
|
@@ -25,6 +26,7 @@ async def create_user( | |
async def create_users_with_array_input( | ||
self, | ||
user: Annotated[List[User], Field(description="List of user object")], | ||
token_api_key: str | ||
) -> None: | ||
"""""" | ||
... | ||
|
@@ -33,6 +35,7 @@ async def create_users_with_array_input( | |
async def create_users_with_list_input( | ||
self, | ||
user: Annotated[List[User], Field(description="List of user object")], | ||
token_api_key: str | ||
) -> None: | ||
"""""" | ||
... | ||
|
@@ -41,39 +44,41 @@ async def create_users_with_list_input( | |
async def delete_user( | ||
self, | ||
username: Annotated[StrictStr, Field(description="The name that needs to be deleted")], | ||
token_api_key: str | ||
) -> None: | ||
"""This can only be done by the logged in user.""" | ||
... | ||
|
||
|
||
async def get_user_by_name( | ||
self, | ||
username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")], | ||
username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")] | ||
) -> User: | ||
"""""" | ||
... | ||
|
||
|
||
async def login_user( | ||
self, | ||
username: Annotated[str, Field(strict=True, description="The user name for login")], | ||
password: Annotated[StrictStr, Field(description="The password for login in clear text")], | ||
username: Annotated[str, Field(strict=True, description="The user name for login")], password: Annotated[StrictStr, Field(description="The password for login in clear text")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i prefer each parameter in a new line instead. what do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will have a look at the spacing, but IIRC the different optional fields made that tricky... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let us know if you need any help regarding the formatting as mustache can be tricky sometimes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not know how to make this work. I tried the following:
But then if there are no parameter it adds empty lines like this:
|
||
) -> str: | ||
"""""" | ||
... | ||
|
||
|
||
async def logout_user( | ||
self, | ||
|
||
token_api_key: str | ||
) -> None: | ||
"""""" | ||
... | ||
|
||
|
||
async def update_user( | ||
self, | ||
username: Annotated[StrictStr, Field(description="name that need to be deleted")], | ||
user: Annotated[User, Field(description="Updated user object")], | ||
username: Annotated[StrictStr, Field(description="name that need to be deleted")], user: Annotated[User, Field(description="Updated user object")], | ||
token_api_key: str | ||
) -> None: | ||
"""This can only be done by the logged in user.""" | ||
... |
Uh oh!
There was an error while loading. Please reload this page.