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)
|
||||
|
||||
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.
|
||||
return _('The submitted data could not be validated.'), 422
|
||||
|
@ -60,7 +60,7 @@ def find_user_in_db(user_info: dict, provider='blender-id') -> dict:
|
||||
email address.
|
||||
|
||||
Does NOT update the user in the database.
|
||||
|
||||
|
||||
:param user_info: Information (id, email and full_name) from the auth provider
|
||||
:param provider: One of the supported providers
|
||||
"""
|
||||
@ -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.
|
||||
db_token = find_token(token, oauth_subclient)
|
||||
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
|
||||
# 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
|
||||
@ -377,6 +375,10 @@ def current_user():
|
||||
def setup_app(app):
|
||||
@app.before_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()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user