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

Api key #1011

Merged
merged 92 commits into from
Mar 29, 2023
Merged

Api key #1011

merged 92 commits into from
Mar 29, 2023

Conversation

dmytrotsko
Copy link
Contributor

@dmytrotsko dmytrotsko commented Oct 27, 2022

Prerequisites:

  • Unless it is a documentation hotfix it should be merged against the dev branch
  • Branch is up-to-date with the branch to be merged with, i.e. dev
  • Build is successful
  • Code is cleaned up and formatted (Black was used as a code formatter)

Summary

Implements the server logic to require API keys and roles for the endpoints.

List of tasks:

  • check for api key
  • show a soft warning
  • show a hard warning
  • adapt tests
  • admin interface
  • [?] log / track api_key + query if allowed
  • create basic google form
  • connect google form with api server handling -> webhook
  • create a basic request a key form: /admin/create_key
  • use flask-limited for rate limiting
  • setup a Redis DB for shared rate limit tracking
  • add email address validation
  • update documentation ???
  • add tests for admin endpoint
  • define a good default rate limit
  • consider using Redis DB also for account management instead of SQL server

…method in _security.py by creating parent class for DBUser and APIUser classes.
nolangormley
nolangormley previously approved these changes Nov 10, 2022
Copy link
Contributor

@nolangormley nolangormley left a comment

Choose a reason for hiding this comment

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

Took a quick pass of this PR. I think some of the SQLAlchemy ORM usage can be cleaned up, but it is not dire and I do not think it is anything that would slow this system down in a measurable way.

src/server/_security.py Outdated Show resolved Hide resolved
@rzats rzats mentioned this pull request Dec 2, 2022
4 tasks
@korlaxxalrok korlaxxalrok changed the base branch from dev to api-keys March 23, 2023 14:27
@korlaxxalrok korlaxxalrok changed the base branch from api-keys to dev March 23, 2023 14:28
@korlaxxalrok korlaxxalrok changed the base branch from dev to api-keys March 23, 2023 14:28
@krivard krivard merged commit 73efe70 into cmu-delphi:api-keys Mar 29, 2023
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

Successfully merging this pull request may close these issues.

4 participants