Compare commits
4 Commits
cryptograp
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8f3a03d311 | ||
![]() |
d9d3b73070 | ||
![]() |
2bce52e189 | ||
9f76657603 |
@ -663,7 +663,7 @@ class PillarServer(BlinkerCompatibleEve):
|
|||||||
return self.pillar_error_handler(error)
|
return self.pillar_error_handler(error)
|
||||||
|
|
||||||
def handle_sdk_resource_invalid(self, error):
|
def handle_sdk_resource_invalid(self, error):
|
||||||
self.log.info('Forwarding ResourceInvalid exception to client: %s', error, exc_info=True)
|
self.log.exception('Forwarding ResourceInvalid exception to client: %s', error, exc_info=True)
|
||||||
|
|
||||||
# Raising a Werkzeug 422 exception doens't work, as Flask turns it into a 500.
|
# Raising a Werkzeug 422 exception doens't work, as Flask turns it into a 500.
|
||||||
return _('The submitted data could not be validated.'), 422
|
return _('The submitted data could not be validated.'), 422
|
||||||
|
@ -169,8 +169,6 @@ def validate_this_token(token, oauth_subclient=None):
|
|||||||
# Check the users to see if there is one with this Blender ID token.
|
# Check the users to see if there is one with this Blender ID token.
|
||||||
db_token = find_token(token, oauth_subclient)
|
db_token = find_token(token, oauth_subclient)
|
||||||
if not db_token:
|
if not db_token:
|
||||||
log.debug('Token %r not found in our local database.', token)
|
|
||||||
|
|
||||||
# If no valid token is found in our local database, we issue a new
|
# If no valid token is found in our local database, we issue a new
|
||||||
# request to the Blender ID server to verify the validity of the token
|
# request to the Blender ID server to verify the validity of the token
|
||||||
# passed via the HTTP header. We will get basic user info if the user
|
# passed via the HTTP header. We will get basic user info if the user
|
||||||
@ -377,6 +375,10 @@ def current_user():
|
|||||||
def setup_app(app):
|
def setup_app(app):
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def validate_token_at_each_request():
|
def validate_token_at_each_request():
|
||||||
|
# Skip token validation if this is a static asset
|
||||||
|
# to avoid spamming Blender ID for no good reason
|
||||||
|
if request.path.startswith('/static/'):
|
||||||
|
return
|
||||||
validate_token()
|
validate_token()
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ bcrypt = "~3"
|
|||||||
blinker = "~1.4"
|
blinker = "~1.4"
|
||||||
bleach = "~3.1"
|
bleach = "~3.1"
|
||||||
celery = {version = "~4.3",extras = ["redis"]}
|
celery = {version = "~4.3",extras = ["redis"]}
|
||||||
|
cryptography = "2.7"
|
||||||
commonmark = "~0.9"
|
commonmark = "~0.9"
|
||||||
|
|
||||||
# These must match the version of ElasticSearch used:
|
# These must match the version of ElasticSearch used:
|
||||||
@ -59,5 +60,5 @@ pillar-devdeps = {path = "./devdeps"}
|
|||||||
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry>=0.12"]
|
requires = ["poetry==1.0","cryptography==2.7","setuptools==51.0.0","wheel==0.35.1"]
|
||||||
build-backend = "poetry.masonry.api"
|
build-backend = "poetry.masonry.api"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user