Skip to content

Commit

Permalink
Add controller to list all non-expired API tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
ptzianos committed Mar 26, 2019
1 parent 0426890 commit c838894
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions marketplace/src/hermes/user/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,3 +685,8 @@ def verify_public_key(

request.public_key.verified = True
request.public_key.verified_on = datetime.now()


def list_active_api_token() -> List[APIToken]:
"""Return all non-expired tokens"""
return g.db_session.query(APIToken).filter_by(expired=False)

0 comments on commit c838894

Please sign in to comment.