Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Authentication headers aren't being sent with coreapi 2.3.0, but 2.2.4 works #19

Closed
tveastman opened this issue May 22, 2017 · 16 comments
Closed

Comments

@tveastman
Copy link

The CLI doesn't seem to correctly use coreapi's authentication anymore with the latest coreapi libary.

If I use coreapi cli 1.0.6 and coreapi 2.0.0, the authentication header is being sent (Not my real creds or domain):

$ coreapi get https://xxx.xxx.xxx/ --debug
> GET / HTTP/1.1
> Accept-Encoding: gzip, deflate
> Connection: keep-alive
> Accept: application/coreapi+json, application/vnd.coreapi+json, */*
> Authorization: Basic dG9tOmE=

But if I switch to the latest coreapi 2.3.0, it doesn't get sent:

$ coreapi get https://xxx.xxx.xxx/ --debug
> GET / HTTP/1.1
> Accept-Encoding: gzip, deflate
> Connection: keep-alive
> Accept: application/coreapi+json, application/vnd.coreapi+json, */*
> Host: xxx.xxx.xxx
> User-Agent: coreapi
< 403 Forbidden

For the moment, I'm just reverting to coreapi 2.0.0 as a workaround.

@tveastman tveastman changed the title Authentication headers aren't being sent Authentication headers aren't being sent with coreapi 2.3.0, but 2.2.4 works May 22, 2017
@tveastman
Copy link
Author

Authentication works fine when using coreapi-cli and CoreAPI version 2.2.4, so the breaking change is somewhere between 2.2.4 and 2.3.0

@bors-ltd
Copy link

bors-ltd commented Jun 5, 2017

Same bug on coreapi 2.3.1, I also reverted to 2.2.4 and it instantly worked. coreapi-cli is version 1.0.6.

@njj6666
Copy link

njj6666 commented Aug 2, 2017

I degraded coreapi to 2.2.4, and coreapi-cli is 1.0.6. But I still get error of "TypeError: init() missing 1 required positional argument: 'enum'". Any idea? Thanks.

I degraded coreapi to 2.0.0, it works

@tyrdavis
Copy link

coreapi-cli is using the deprecated credentials argument for HTTPTransport instead of auth. As you can see from the code here, coreapi 2.3.1 is ingesting that deprecated argument, but then doing nothing with it. This is why this library won't send auth headers anymore.

@blueyed
Copy link

blueyed commented Sep 12, 2017

See core-api/python-client#146.

@pombredanne
Copy link

@blueyed Thanks! @tomchristie It would be awesome if you could have a look into this... atm any coreapi-generated doc will point to use the coreapi client and this is broken 📦

@pau-minoves
Copy link

I can confirm this happens with:

coreapi==2.3.3
coreapi-cli==1.0.6

@blueyed @tomchristie any chance we can get this fixed?

@blueyed
Copy link

blueyed commented Nov 20, 2017

@pau-minoves
IIRC core-api/python-client#146 should fix it?!
Have you tried it?

@pau-minoves
Copy link

hi @blueyed I just tried and I still have the problem. I see that pull request fixes some warnings but not actual logic. Am I right?

@blueyed
Copy link

blueyed commented Nov 21, 2017

@pau-minoves
The first two commits are fixes.

@blueyed
Copy link

blueyed commented Nov 21, 2017

Make sure to actually use the branch/PR with coreapi-cli when testing it.

@pau-minoves
Copy link

@blueyed right, I can confirm that branch works. Thanks!

Any change it gets merged into a regular coreapi release?

@bradleyglen
Copy link

Waiting for the fix on the coreapi credentials add <username>:<password> --auth basic command.

For now, downgrading coreapi worked for me:

  • coreapi==2.2.3
  • coreapi-cli==1.0.6

@dominem
Copy link

dominem commented Feb 1, 2018

@bradleyglen Thanks, I can confirm that. With 2.2.4 I'm getting TypeError: __init__() missing 1 required positional argument: 'enum', and with a higher version (2.3.x) it just doesn't work. It adds credential, but does not authenticate. I've only tested it with coreapi credentials add 127.0.0.1 <username>:<password> --auth basic command.

@blueyed
Copy link

blueyed commented Feb 2, 2018

There is a pending fix already at core-api/python-client#146 - no need to confirm this over and over again.

@pombredanne
Copy link

@tomchristie Thank you ++

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants