Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.
This repository was 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

Description

@tveastman

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.

Activity

  1. 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[/+] on May 22, 2017
  2. tveastman commented on May 22, 2017

    @tveastman
    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

  3. bors-ltd commented on Jun 5, 2017

    @bors-ltd

    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.

  4. njj6666 commented on Aug 2, 2017

    @njj6666

    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

  5. tyrdavis commented on Aug 29, 2017

    @tyrdavis

    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.

  6. blueyed commented on Sep 12, 2017

    @blueyed
  7. pombredanne commented on Oct 13, 2017

    @pombredanne

    @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 📦

  8. pau-minoves commented on Nov 20, 2017

    @pau-minoves

    I can confirm this happens with:

    coreapi==2.3.3
    coreapi-cli==1.0.6

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

  9. blueyed commented on Nov 20, 2017

    @blueyed

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

  10. pau-minoves commented on Nov 21, 2017

    @pau-minoves

    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?

  11. blueyed commented on Nov 21, 2017

    @blueyed

    @pau-minoves
    The first two commits are fixes.

  12. blueyed commented on Nov 21, 2017

    @blueyed

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

  13. pau-minoves commented on Nov 22, 2017

    @pau-minoves

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

    Any change it gets merged into a regular coreapi release?

  14. bradleyglen commented on Jan 9, 2018

    @bradleyglen

    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
  15. dominem commented on Feb 1, 2018

    @dominem

    @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.

  16. blueyed commented on Feb 2, 2018

    @blueyed

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

  17. pombredanne commented on Feb 15, 2018

    @pombredanne

    @tomchristie Thank you ++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions