requests-oauthlib icon indicating copy to clipboard operation
requests-oauthlib copied to clipboard

New compliance hook and error handling

Open jamielennox opened this issue 6 years ago • 2 comments

  • Add a new compliance hook for token_request

Allow us to modify the request that is sent when a new token is requested. This helps in situations where the standard format is not accepted.

  • Use requests-mock for testing

requests-mock is already a dependency for some tests but extend it to the more core tests.

  • Throw an exception on a bad http return code

Throw an error when you get a non 2XX status code because at that point we are confident there's not going to be a token in the body.

jamielennox avatar Jun 17 '18 23:06 jamielennox

Coverage Status

Coverage increased (+0.3%) to 88.115% when pulling 94bec1b7b2bb0b927abab3315483f45c7ff06000 on jamielennox:compliance-request into 91298c3a2fc7b461862b4273da2f69d43eeb2346 on requests:master.

coveralls avatar Jun 17 '18 23:06 coveralls

Sorry for how these are combined, my biggest rant about github is not being able to do them as dependencies, but the code is intertwined so I can't completely separate them.

I recommend thinking of it as the 3 PRs itemized in the PR body with the first 2 part of the compliance hook.

If parts of this are an easier merge than other i'm more than willing to split it up in whatever way is most acceptable.

jamielennox avatar Jun 17 '18 23:06 jamielennox