Skip to main content

DCI authentication module used by dci-control-server and python-dciclient

Project description


DCI authentication module used by dci-control-server and python-dciclient

This section shows example programs written in python that illustrate how to work with Signature Version 2 in DCI. The algorithm used by dciauth is identical to Signature Version 4 in AWS.

Authentication example:


import requests

from dciauth.v2.headers import generate_headers

headers = generate_headers(
    {"endpoint": "/api/v1/jobs"},
    {"access_key": "remoteci/client_id", "secret_key": "secret"},
requests.get("", headers=headers)


import requests

from dciauth.v2.headers import generate_headers

payload = {"name": "user 1"}
headers = generate_headers(
        "method": "POST",
        "endpoint": "",
        "payload": payload,
    {"access_key": "remoteci/client_id", "secret_key": "secret"},
)"", headers=headers, json=payload)

Validation example

    from flask import request

    from dciauth.v2.headers import parse_headers
    from dciauth.v2.signature import is_valid

    valid, error_message = is_valid(
            "method": request.method,
            "endpoint": request.path,
            "params": request.args.to_dict(flat=True),
        {"secret_key": "secret"},
    if not valid:
        raise Exception("Authentication failed: %s" % error_message)


If you are using POSTMAN to discover DCI API you can use the following parameters with the AWS Signature authorization header:

AWS Region="BHS3"
Service Name="api"


Apache 2.0

Author Information

Distributed-CI Team

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dciauth, version 2.1.7
Filename, size File type Python version Upload date Hashes
Filename, size dciauth-2.1.7-py3-none-any.whl (13.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size dciauth-2.1.7.tar.gz (11.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page