Skip to content

Commit

Permalink
Release Delphi Epidata 4.1.2 (#1187)
Browse files Browse the repository at this point in the history
* dont look up user if no api key is given (#1185)
* disable recording of last key usage in redis (temporarily)

* chore: release delphi-epidata 4.1.2

---------

Co-authored-by: melange396 <[email protected]>
Co-authored-by: melange396 <[email protected]>
  • Loading branch information
3 people authored May 31, 2023
1 parent 934c170 commit 193c5b2
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 4.1.1
current_version = 4.1.2
commit = False
tag = False

Expand Down
2 changes: 1 addition & 1 deletion dev/local/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = Delphi Development
version = 4.1.1
version = 4.1.2

[options]
packages =
Expand Down
2 changes: 1 addition & 1 deletion src/client/delphi_epidata.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Epidata <- (function() {
# API base url
BASE_URL <- getOption('epidata.url', default = 'https://api.delphi.cmu.edu/epidata/')

client_version <- '4.1.1'
client_version <- '4.1.2'

auth <- getOption("epidata.auth", default = NA)

Expand Down
2 changes: 1 addition & 1 deletion src/client/delphi_epidata.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
})(this, function (exports, fetchImpl, jQuery) {
const BASE_URL = "https://api.delphi.cmu.edu/epidata/";
const client_version = "4.1.1";
const client_version = "4.1.2";

// Helper function to cast values and/or ranges to strings
function _listitem(value) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/packaging/npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "delphi_epidata",
"description": "Delphi Epidata API Client",
"authors": "Delphi Group",
"version": "4.1.1",
"version": "4.1.2",
"license": "MIT",
"homepage": "https://github.com/cmu-delphi/delphi-epidata",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion src/client/packaging/pypi/delphi_epidata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .delphi_epidata import Epidata

name = 'delphi_epidata'
__version__ = '4.1.1'
__version__ = '4.1.2'
2 changes: 1 addition & 1 deletion src/client/packaging/pypi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="delphi_epidata",
version="4.1.1",
version="4.1.2",
author="David Farrow",
author_email="[email protected]",
description="A programmatic interface to Delphi's Epidata API.",
Expand Down
4 changes: 4 additions & 0 deletions src/server/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ def after_request_execute(response):

@app.teardown_appcontext
def teardown_db(exception=None):
# drop reference to "user" (if it exists)
if "user" in g:
g.pop("user")

# close the db connection
db = g.pop("db", None)

Expand Down
2 changes: 1 addition & 1 deletion src/server/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

load_dotenv()

VERSION = "4.1.1"
VERSION = "4.1.2"

MAX_RESULTS = int(10e6)
MAX_COMPATIBILITY_RESULTS = int(3650)
Expand Down
7 changes: 6 additions & 1 deletion src/server/_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def require_api_key() -> bool:
def _get_current_user():
if "user" not in g:
api_key = resolve_auth_token()
g.user = User.find_user(api_key=api_key)
if api_key:
g.user = User.find_user(api_key=api_key)
else:
g.user = None
return g.user


Expand Down Expand Up @@ -122,6 +125,8 @@ def decorated_function(*args, **kwargs):


def update_key_last_time_used(user):
# TODO: reenable this once cc<-->aws latency issues are sorted out, or maybe do this call asynchronously
return
if user:
# update last usage for this user's api key to "now()"
r = redis.Redis(host=REDIS_HOST, password=REDIS_PASSWORD)
Expand Down

0 comments on commit 193c5b2

Please sign in to comment.