make auth more robust, if not email key#303
Conversation
| # set the apitally consumer, this means we can see who has used which routes | ||
| email = claims["https://openclimatefix.org/email"] | ||
| set_consumer(request,identifier=email) | ||
| if EMAIL_KEY in claims: |
There was a problem hiding this comment.
What is EMAIL_KEY / where does it get set..?
There was a problem hiding this comment.
There was a problem hiding this comment.
Its "https://openclimatefix.org/email" and just set at the top of this file
There was a problem hiding this comment.
Righhht okay, we just weren't using it before, got it
braddf
left a comment
There was a problem hiding this comment.
Would be good to be able to tell if we are connecting ourselves using client_id/client_secret, but at least this will stop the errors 👍
| # set the apitally consumer, this means we can see who has used which routes | ||
| email = claims["https://openclimatefix.org/email"] | ||
| set_consumer(request,identifier=email) | ||
| if EMAIL_KEY in claims: |
There was a problem hiding this comment.
Righhht okay, we just weren't using it before, got it
I could add a log warning? If you think that would be useful |
I slipped this in so we can see whats happen |
Pull Request
Description
Fix if the authentication has no email key. This can happen if auth is done via secret id and key.
Helps with https://github.com/openclimatefix/client-private/issues/418
How Has This Been Tested?
Checklist: