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

Initial implementation of Pbench user model and associated APIs in server #1937

Merged
merged 1 commit into from
Mar 5, 2021

Commits on Mar 5, 2021

  1. Initial pbench user authentication model implementation

    This implements 5 basic user APIs
    1. Register User
        Handles Pbench User registration via JSON request
        POST /v1/register
    2. Login User:
        POST /v1/login
        Returns a valid pbench auth token
        User is allowed to issue multiple login requests and thus generating multiple auth tokens,
        Each token is stored in a active_tokens table and has its own expiry
        User is authenticated for subsequest API calls if token not expired and present in the active_tokens table
    3. Logout user:
        POST /v1/logout
        Deletes the auth_token from the active_tokens table.
        Once logged out user can not use the same auth token for other API access.
    4. Get User:
        GET /v1/user/<string:username>
        Returns the user's self information that was registered, the username must be provided in the url
        If the Auth header does not belong to the username, reject the request unless auth token belongs to the admin
    5. Delete User:
        DELETE /v1/user/<string:username>"
        An API for a user to delete himself from the pbench database.
        A user can only perform delete action on himself unless the auth token belongs to the admin user.
    6. Updare User:
        PUT /v1/user/<string:username>
        An API for updating the User registration fields, the username must be provided in the url
        Update is not allowed on registerd_on field
    npalaska committed Mar 5, 2021
    Configuration menu
    Copy the full SHA
    60aa002 View commit details
    Browse the repository at this point in the history