-
Notifications
You must be signed in to change notification settings - Fork 67
Api key #1011
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
Merged
Merged
Api key #1011
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
c7b0120
Cleanup unused imports && added role definition and security
a700ef2
Simple api role checking
dmytrotsko 75509cb
Render api key warnings
dmytrotsko a796e2c
Move tests
dmytrotsko 8d48b20
Add api user ddl
dmytrotsko c753f73
tests
dmytrotsko a15a36e
improve dockerignore
dmytrotsko 4fc210d
support api date via env
dmytrotsko ee0c087
start with admin interface
dmytrotsko 0446ea9
start with simple admin interface
dmytrotsko c7ca927
very basic admin interface
dmytrotsko d066a90
list all known roles
dmytrotsko 8b09387
remove log statement
dmytrotsko e940f8b
fixup tests
dmytrotsko 8bb2789
add record flag to user
dmytrotsko 3161d2e
basic record based on flag logging
dmytrotsko 9ab8978
rename column to tracking
dmytrotsko 54dc83c
add webhook endpoint for google forms and simplify table
dmytrotsko 62122cf
tests for simplified api_user
dmytrotsko 32096ac
prepare for sending mails with mailgun
dmytrotsko 45414bc
disable security check for test setup
dmytrotsko 60f7cd6
fix tests
dmytrotsko dac3fcb
add registered flag
dmytrotsko d880795
request a simple api key form with recaptcha check
dmytrotsko e76cde4
implement rate limiting
dmytrotsko f1f008e
registered flag not saved
dmytrotsko 98315c6
mark all tests no rate limit
dmytrotsko f897e28
add link to registration form within api key form
dmytrotsko b345f76
elevate sqlalchemy log level to ERROR for test purpose
dmytrotsko 5ce96bd
add structlog to requirements
dmytrotsko f851d5b
add structured logging module
dmytrotsko 38abd83
implement api key scrubbing logs and getter functions for User class
dmytrotsko d65acb8
minor commenting change
dmytrotsko 5aee08f
change logging to kward format and add a get function for API key
dmytrotsko 7378e8d
move mask_apikey function out of User class
dmytrotsko 02a535b
minor change in variable name
dmytrotsko c18a122
Fixed test
dmytrotsko da947fd
added missing import
dmytrotsko 4732467
Fixed _is_public_route method. Added URL_PREFIX to list of routes
dmytrotsko ae1e6a1
Merge pull request #2 from dmytrotsko/fix_admin_endpoint_access
dmytrotsko 16a154c
Added email column to User table
dmytrotsko 4b5fa65
Merge branch 'api_key' of github.com:dmytrotsko/delphi-epidata into a…
dmytrotsko a8011fd
Fixed tests
dmytrotsko 6775384
Added Dockerfile for Redis
dmytrotsko 7e11435
Made email optional
dmytrotsko 74fd290
Added email address validaiton
dmytrotsko 8d496ba
Fixed API key creation via /create_key endpoint
dmytrotsko 3bc7095
Fixed /register endpoint after google script refactoring
dmytrotsko e39c82a
Fixed registration
dmytrotsko be80550
Reverted some changes in _config.py
dmytrotsko 8f21122
Reverted changes in .env.example
dmytrotsko 71bb186
Code refactoring
dmytrotsko aea77eb
Removed unused variables
dmytrotsko b7a6078
Code cleaning
dmytrotsko 635be31
Removed unused variables
dmytrotsko 93b056e
Removed default redis configuration file (it is not needed for now)
dmytrotsko df11183
Moved BASE_URL and auth to setUP, formatted code
dmytrotsko b63faa3
Moved BASE_URL and auth to setUP(), formatted code
dmytrotsko 9ed758b
Revert "Moved BASE_URL and auth to setUP(), formatted code"
dmytrotsko 02083a0
Formatted code & removed unused imports.
dmytrotsko 99f75a6
Created staticmethod _make_rqeuest() and reused it in test_caching() …
dmytrotsko f94ec4d
Returned BASE_URL and auth back, because if we use default BASE_URL f…
dmytrotsko 0480172
Completely removed patch_flask_config() function as it is useless. Th…
dmytrotsko 3586bcf
Removed duplicated _logger.py file (this is exact copy of src/acquisi…
dmytrotsko 1ee16f7
Fixed test
dmytrotsko 7ce411b
Removed unused method
dmytrotsko 68240ca
Added missing changes in Dockerfiles for copying logger
dmytrotsko d350347
Fixed misspelled filename
dmytrotsko 4bca6b4
Added missing variable in CSVPrinter
dmytrotsko 3cf15da
Formatted code
dmytrotsko ad00db5
Removed tests for admin endpoint for now
dmytrotsko 4285b87
Moved config variables from _security to _config. Removed duplicated …
dmytrotsko ec67149
Added missing changes
dmytrotsko 7a364d9
Replaced db.execute delete and update with built-it sqlalchemy functi…
dmytrotsko e4ae70c
Removed email field. Edited google form link to prefill tracking cons…
dmytrotsko c21689d
Removed api_user ddl
dmytrotsko 1ebff22
Changed user roles to use m2m table instead of string in api_user table
dmytrotsko c49c1f8
Added new variable for api key expiration date
dmytrotsko c54412c
Updated admin endpoint. Removed email from user details and added cre…
dmytrotsko 6c50703
Updated integration tests
dmytrotsko 3e34e3c
Updated endpoints to register user role on endpoint load
dmytrotsko 8fbae7d
Removed user_role FK in api_user table.
dmytrotsko 95507c2
Updated according to new structure
dmytrotsko 597eeb4
Removed API_KEY_EXPIRE_AFTER variable
dmytrotsko 08bd2b6
Removed creation_date, expiration_date and last_api_access_date from …
dmytrotsko c436b0a
Added roles registraion on endpoints load
dmytrotsko 199d434
Removed role registration statement
dmytrotsko 4422a5e
Fixed integration tests. Actually reverted latest changes as api_user…
dmytrotsko 806d6e4
Added new ddls
dmytrotsko 82a0e25
Merge branch 'dev' into api_key
dmytrotsko 58f715d
Fixed wrong import
dmytrotsko 73efe70
Fixed issue after resolving conflicts
dmytrotsko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/delphi-epidata | ||
/.mypy_cache | ||
**/.mypy_cache | ||
/.github | ||
/docs | ||
__pycache__ | ||
/node_modules | ||
**/__pycache__ | ||
**/.pytest_cache | ||
**/node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
FLASK_DEBUG=True | ||
SQLALCHEMY_DATABASE_URI=sqlite:///test.db | ||
FLASK_SECRET=abc | ||
SECRET_TWITTER=abc | ||
SECRET_GHT=abc | ||
SECRET_FLUVIEW=abc | ||
SECRET_CDC=abc | ||
SECRET_SENSORS=abc | ||
SECRET_SENSOR_TWTR=abc | ||
SECRET_SENSOR_GFT=abc | ||
SECRET_SENSOR_GHT=abc | ||
SECRET_SENSOR_GHTJ=abc | ||
SECRET_SENSOR_CDC=abc | ||
SECRET_SENSOR_QUID=abc | ||
SECRET_SENSOR_WIKI=abc | ||
SECRET_QUIDEL=abc | ||
SECRET_NOROSTAT=abc | ||
SECRET_AFHSB=abc | ||
#API_REQUIRED_STARTING_AT=2021-07-30 | ||
API_KEY_ADMIN_PASSWORD=abc | ||
API_KEY_REGISTER_WEBHOOK_TOKEN=abc | ||
RECAPTCHA_SITE_KEY | ||
RECAPTCHA_SECRET_KEY | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# start with the `delphi_python` image | ||
FROM delphi_python | ||
|
||
COPY repos/delphi/delphi-epidata/src/acquisition/covidcast/logger.py /usr/src/app/delphi/epidata/server/_logger.py | ||
|
||
RUN pip install --no-cache-dir -r repos/delphi/delphi-epidata/requirements.txt -r repos/delphi/delphi-epidata/requirements.dev.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM redis | ||
|
||
CMD ["redis-server"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
were you able to get the recaptcha checks working on the key request form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, but going to check it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UPD: it is working. I just registered new reCaptcha application and obtained new

RECAPTCHA_SITE_KEY
andRECAPTCHA_SECRET_KEY
.