bravecollective / core

Authentication, Authorization, and API Proxy Service
https://core.braveineve.com/
59 stars 45 forks source link

Don't drop keys on transient EVE API failure #370

Closed ayust closed 3 years ago

ayust commented 9 years ago

Right now occasionally keys will just get dropped due to a transient failure from the EVE API. It's really annoying to keep re-adding them.

The dropping occurs here: https://github.com/bravecollective/core/blob/develop/brave/core/key/model.py#L229

Possible improvements I see:

  1. Don't just check for a 403 HTTP error - actually check to see if there was an XML error returned by the API; for actual key issues, you'll get a "Authentication failure." with API error code 203. (It's possible that the transient errors also manifest themselves this way, but they might not. Worth properly handling this.)
  2. Require multiple attempts to fail before actually deleting the key, to work around transient issues.
ayust commented 9 years ago

Update: apparently the recurring failures return API error code 221 ("Illegal page request! Please verify the access granted by the key you are using!"). So we should be able to filter on that.

https://forums.eveonline.com/default.aspx?g=posts&m=4790500#post4790500