OVH auth plugin for HTTPie.
Project description
Auth plugin for OVH API
Obtain API credentials
You can find URLs to create your application credentials (client id and secret) here: https://github.com/ovh/python-ovh#1-create-an-application
Then, you need to perform a customer key request and validation.
# Replace $OVH_CLIENT_ID with the appropriate value
# Add needed method and path in accessRules list
http -b post https://api.ovh.com/1.0/auth/credential X-Ovh-Application:$OVH_CLIENT_ID accessRules:='[{"method": "GET", "path": "/*"}]'
{
"consumerKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"state": "pendingValidation",
"validationUrl": "https://eu.api.ovh.com/auth/?credentialToken=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
Visit validationUrl to validate your consumer key (you need to authenticate
and choose an expiration delay).
Credentials in environment
Plugin can use environement variables OVH_CLIENT_ID, OVH_CLIENT_SECRET and OVH_CONSUMER_KEY to perform httpie authentication.
Rename auth.env.tpl to auth.env and insert your credentials.
Configure your environment before running httpie commands by sourcing this file:
source auth.env
Trigger OVH authentication with --auth-type parameter:
http -b --auth-type ovh https://api.ovh.com/1.0/me
Credentials with -a option
Not yet implemented.
Credentials with configuration file
Not yet implemented.
Interactive credential generation
Not yet implmented.
Implementation
Here is the official API implementation: https://github.com/ovh/python-ovh
OVH API
API documentation available here: https://api.ovh.com/
Development
## install pipenv
# dnf install pipenv or apt install pipenv
## init virtualenv with pipenv
pipenv install --dev
## launch tests in pipenv environment
pytest
## launch tests for all envs
pipenv run tox
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file httpie-ovh-auth-1.0.0.tar.gz.
File metadata
- Download URL: httpie-ovh-auth-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33b405027d45f9eab76e0f1a21115f8d7dc6b96b105dcac26f61b8756d35b2ef
|
|
| MD5 |
1290d80d10e7762fdad8d70c03f39317
|
|
| BLAKE2b-256 |
0e914fe8ad31dcb08062b383d998ec9ad9d158237d4a40150f100dba1460219e
|
File details
Details for the file httpie_ovh_auth-1.0.0-py3-none-any.whl.
File metadata
- Download URL: httpie_ovh_auth-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27e0ec1d4d3d2387bdc09d88b62c390e75805d1e321cba6eda1618c21bfecb81
|
|
| MD5 |
8550da044612e04ce6b74332af83f59a
|
|
| BLAKE2b-256 |
7d4af2a2b4f7f1d19b1f56a34f59ddc67d8955468be547e191cc677a5548d19f
|