Skip to content
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

Connect user service with oAuth2 #245

Closed
Tracked by #240
atompie opened this issue Dec 3, 2021 · 0 comments
Closed
Tracked by #240

Connect user service with oAuth2 #245

atompie opened this issue Dec 3, 2021 · 0 comments
Milestone

Comments

@atompie
Copy link
Collaborator

atompie commented Dec 3, 2021

Task

User #244 service instead of current mock-up authorization.

File has a mock-up UserDb object that fetches data from internal dictionary instead of the database.

 def __init__(self):
        self.users_db = UserDb()
        self.token2user = token2user

    def authorize(self, username, password):  # username exists
        if not password:
            raise ValueError("Password empty")

        db_username_record = self.users_db.get_user(username)
        if not db_username_record:
            raise ValueError("Incorrect username or password")

        db_username = db_username_record['username']
        db_password = db_username_record['password']
        db_disabled = db_username_record["disabled"]

        if db_disabled:
            raise ValueError("This account was disabled")

        if db_username != username or db_password != password:
            raise ValueError("Incorrect username or password")

        return db_username_record

Replace this with service form #244

@atompie atompie mentioned this issue Dec 3, 2021
8 tasks
@atompie atompie added this to the version 0.7.0 milestone Dec 3, 2021
@atompie atompie closed this as completed Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant