Giter Site home page Giter Site logo

httpie-credential-store's People

Contributors

ikalnytskyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

httpie-credential-store's Issues

Support httpie 3

httpie-credential-store current has a dependency on httpie = "^2.0". httpie 3 was released in January, which no longer meets this dependency. Additionally, httpie 3 introduced the httpie plugins command for managing plugins, and attempting to install httpie-credential-store currently results in httpie being forcibly downgraded:

$ httpie plugins install httpie-credential-store
Installing httpie-credential-store...
Collecting httpie-credential-store
  Downloading httpie_credential_store-2.0.0-py3-none-any.whl (8.4 kB)
Collecting keyring<22.0,>=21.0
  Downloading keyring-21.8.0-py3-none-any.whl (32 kB)
Collecting httpie<3.0,>=2.0
  Downloading httpie-2.6.0-py3-none-any.whl (63 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.9/63.9 KB 1.4 MB/s eta 0:00:00
Requirement already satisfied: requests[socks]>=2.22.0 in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from httpie<3.0,>=2.0->httpie-credential-store) (2.27.1)
Requirement already satisfied: setuptools in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from httpie<3.0,>=2.0->httpie-credential-store) (60.6.0)
Requirement already satisfied: charset-normalizer>=2.0.0 in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from httpie<3.0,>=2.0->httpie-credential-store) (2.0.12)
Requirement already satisfied: defusedxml>=0.6.0 in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from httpie<3.0,>=2.0->httpie-credential-store) (0.7.1)
Requirement already satisfied: Pygments>=2.5.2 in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from httpie<3.0,>=2.0->httpie-credential-store) (2.11.2)
Requirement already satisfied: requests-toolbelt>=0.9.1 in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from httpie<3.0,>=2.0->httpie-credential-store) (0.9.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from requests[socks]>=2.22.0->httpie<3.0,>=2.0->httpie-credential-store) (1.26.8)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from requests[socks]>=2.22.0->httpie<3.0,>=2.0->httpie-credential-store) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from requests[socks]>=2.22.0->httpie<3.0,>=2.0->httpie-credential-store) (3.3)
Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /usr/local/Cellar/httpie/3.1.0/libexec/lib/python3.10/site-packages (from requests[socks]>=2.22.0->httpie<3.0,>=2.0->httpie-credential-store) (1.7.1)
Installing collected packages: keyring, httpie, httpie-credential-store
  Attempting uninstall: httpie
    Found existing installation: httpie 3.1.0
    Uninstalling httpie-3.1.0:
      Successfully uninstalled httpie-3.1.0
Successfully installed httpie-2.6.0 httpie-credential-store-2.0.0 keyring-21.8.0

Please relax the dependency to httpie = ">=2".

[Docs] add full example for using shell provider

Hey having trouble figuring out how to use the shell token provider, not sure what I'm missing

I'd like to use a shell command to grab the token, and apply that as a header value with a custom key. Is that possible?

Add `system` keychain provider

httpie-credential-store should provide integration with system keychain/keyring to retrieve secrets from. This can be easily achieved by using nice keyring library available on PyPI.

Add 'password-store' keychain

Because password-store is a password manager I personally use. Despite being able to easily integrate one using existing shell keychain provider, using a separate provider for password-store may help to avoid duplicating hacks such as head -n 1 | tr -d '\n' all over again and again.

Ensure authorization options are shown on `http --debug`

When some http -A creds --debug https://httpbin.org/headers is ran, HTTPie prints extra context about ongoing request, such as:

>>> requests.request(**{
    "allow_redirects": false,
    "auth": "<httpie_credential_store._plug.CredentialStoreAuthPlugin.get_auth.<locals>.CredentialStoreAuth object at 0x7f3b27091e20>",
    "cert": "None",
    "data": {},
    "files": {},
    "headers": {
        "User-Agent": "HTTPie/1.0.3"
    },
    "method": "get",
    "params": {},
    "proxies": {},
    "stream": true,
    "timeout": 30,
    "url": "https://httpbin.org/headers",
    "verify": true
})

The line

    "auth": "<httpie_credential_store._plug.CredentialStoreAuthPlugin.get_auth.<locals>.CredentialStoreAuth object at 0x7f3b27091e20>",

is useless and does not help at all. We need to ensure that we show what auth providers have been used with what credentials (without secrets, of course).

Check illegal characters in secrets

Before using secrets in headers, we need to ensure they do not contain illegal characters such as \n character. And if they do, return a human readable error about that. Additionally, such check should probably be done for header name of header auth provider.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.