Skip to main content

directory-sso-api-client

code-climate-image circle-ci-image codecov-image pypi-image semver-image

Directory SSO API client


Installation

    $ pip install directory-sso-api-client

The api client expects the following settings:

Setting Notes
DIRECTORY_SSO_API_CLIENT_BASE_URL
DIRECTORY_SSO_API_CLIENT_API_KEY Unique to client. Retrieved during the on-boarding process.
DIRECTORY_SSO_API_CLIENT_SENDER_ID Unique to client. Retrieved during the on-boarding process.
DIRECTORY_SSO_API_CLIENT_DEFAULT_TIMEOUT

Once that is done the API client can be used:

from directory_sso_api_client.client import sso_api_client

Authentication backend

Add the following to your settings

AUTHENTICATION_BACKENDS = ['directory_sso_api_client.backends.SSOUserBackend']

AUTH_USER_MODEL='directory_sso_api_client.SSOUser',

MIDDLEWARE_CLASSES = [
    ...
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    ...

That will result in the user being authenticate via their sso session cookie and then attached to request.user.

Development

$ git clone https://github.com/uktrade/directory-sso-api-client
$ cd directory-sso-api-client
$ [create virtual environment and activate]
$ pip install -r requirements_test.txt

Publish to PyPI

The package should be published to PyPI on merge to master. If you need to do it locally then get the credentials from rattic and add the environment variables to your host machine:

Setting
DIRECTORY_PYPI_USERNAME
DIRECTORY_PYPI_PASSWORD

Then run the following command:

    make publish

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

directory_sso_api_client-8.0.5-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file directory_sso_api_client-8.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for directory_sso_api_client-8.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6bbb948c0eb4c4d9b80b952947ced9e58c899a19bd94f5952be3831201399b58
MD5 66aad7545cb6de79b9af4bb35e7cdbed
BLAKE2b-256 243ef2c74205fa56c2ba417442d975ba89c66b808a08b1f3c253452ad6895c7b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

8.0.5 This release

1 file

8.0.4

1 file

8.0.3

1 file

8.0.2

1 file

8.0.1

1 file

8.0.0

1 file

7.6.1

1 file

7.6.0

1 file

7.5.4

1 file

7.5.3

1 file

7.5.2

1 file

7.5.1

1 file

7.5.0

1 file

7.4.0

1 file

7.3.7

1 file

7.3.6

1 file

7.3.5

1 file

7.3.4

1 file

7.3.3

1 file

7.3.2

1 file

7.3.1

1 file

7.3.0

1 file

7.2.8

1 file

7.2.7

1 file

7.2.6

1 file

7.2.5

1 file

7.2.4

1 file

7.2.3

1 file

7.2.2

1 file

7.2.1

1 file

7.2.0

1 file

7.1.2

1 file

7.1.1

1 file

7.1.0

1 file

7.0.0

1 file

6.5.6

1 file

6.5.5

1 file

6.5.4

1 file

6.5.3

1 file

6.5.2

1 file

6.5.1

1 file

6.5.0

1 file

6.4.0

1 file

6.3.0

1 file

6.2.0

1 file

6.1.0

1 file

6.0.1

1 file

6.0.0

1 file

5.1.1

1 file

5.1.0

1 file

5.0.1

1 file

5.0.0

1 file

4.1.1

1 file

4.1.0

1 file

4.0.0

1 file

3.2.0

1 file

3.1.0

1 file

3.0.2

1 file

3.0.1

1 file

3.0.0

1 file

2.5.2

1 file

2.5.1

1 file

2.5.0

1 file

2.4.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page