Skip to main content

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

httpie-ovh-auth-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

httpie_ovh_auth-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file httpie-ovh-auth-0.1.0.tar.gz.

File metadata

  • Download URL: httpie-ovh-auth-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 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

Hashes for httpie-ovh-auth-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8d919b209b46a7e388d34010826c3f1cb15c3fe2dce62fbb257811185735ad88
MD5 1be52aff62d1c0fd3f132e97527829c9
BLAKE2b-256 d23eccf95cd30eed2387892685f47ffbb0ca71fb07cf3735b034da3cf4a3628e

See more details on using hashes here.

File details

Details for the file httpie_ovh_auth-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: httpie_ovh_auth-0.1.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

Hashes for httpie_ovh_auth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87f0c34e771a1a0305b6fe49b85d326a8b3754c1bb714252cd2f15494ca617f9
MD5 f20f4a7583829929b48b5627659c216d
BLAKE2b-256 263bdb68f056f81b0046b5b4dd1eecb05ebd4307bf9a15c960fc583712e8f083

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page