Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

User and password authentication#2

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
davert0 wants to merge2 commits intoelchicodepython:master
base:master
Choose a base branch
Loading
fromepoch8:feat/auth

Conversation

davert0
Copy link
Contributor

No description provided.

Copy link
Owner

@elchicodepythonelchicodepython left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hello! 😄

Great feature!! ❤️

After checking the code I want to suggest some changes that in my opinion helps the project to stay clean avoiding implicit actions in the initialization of NocoDBClient. 🌟

raise ValueError("Either сredentials or token must be provided")

if not auth_token and (email and password):
auth_token = JWTAuthToken(self.get_auth_token(email, password))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm not sure about having a HTTP request in theNocoDBRequestsClient initialization. I suggest creating a class with the purpose of retrieving the AuthToken.

classDiagramclass NocoDBAuthClient {  << interface >>   +get_auth_token() AuthToken}class NocoDBAuthRequestsClient {   +get_auth_token() AuthToken}NocoDBAuthClient <|-- NocoDBAuthRequestsClient
Loading

Usage example:

auth_client=NocoDBAuthRequestsClient("username","password")auth_token=auth_client.get_auth_token()client=NocoDBRequestsClient(base_uri,auth_token)

self.__session.headers.update(
auth_token.get_header(),
)
auth_token.get_header(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This change has nothing to do with the commit.

Suggested change
auth_token.get_header(),
auth_token.get_header(),

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@elchicodepythonelchicodepythonelchicodepython requested changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@davert0@elchicodepython

[8]ページ先頭

©2009-2025 Movatter.jp