Initial implementation of Pbench user model and associated APIs in server#1937
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial framework to build Pbench user authentication:
This implements 6 basic user APIs
Register User:
POST/v1/registerLogin User
POST/v1/loginhowever, in the future there will be limit on the number of auth token a user can generate.
active_tokenstable in our db.active_tokenstable.Logout User
POST/v1/logoutactive_tokenstable.Get User
GET/v1/user/<string:username>Authorizationheader does not belong to the username provided in the url, we reject the request unless theAuthorizationtoken belongs to the admin user.Delete User
DELETE/v1/user/<string:username>"headers={Authorization: Bearer <Pbench authentication token (user received upon login)>
}
DELETEaction on another account if the presented auth token belongs to an admin user.Authorizationheader does not belong to the username provided in the url, we reject the request unless theAuthorizationtoken belongs to the admin user.Update User
PUT/v1/user/<string:username>Authorizationheader does not belong to the username provided in the url, we reject the request unless theAuthorizationtoken belongs to the admin user.registered_on