Skip to main content

Authena Python SDK

Description

Authena Python SDK allows an easy and fast integration with AUTHENA - authentication and authorization API.

Remarks

Biomapas aims to modernize life-science industry by sharing its IT knowledge with other companies and the community. This is an open source library intended to be used by anyone. Improvements and pull requests are welcome.

  • Python 3

Assumptions

The project assumes the following:

  • You have basic-good knowledge in python programming.

Install

The project is built and uploaded to PyPi. Install it by using pip.

pip install authena_python_sdk

Or directly install it through source.

pip install .

Usage & Examples

SDK client

Create Authena SDK client using the given AUTHENA PUBLIC API URL, API KEY, and API SECRET:

from authena_python_sdk.client import Client
from authena_python_sdk.config import Config

AUTHENA_PUBLIC_API_URL = 'http://localhost'
AUTHENA_API_KEY = 'DFCC345BE3C0DC42DF8A123F7579'
AUTHENA_API_SECRET = '4AomCEeUG2j7epT87GahHfh2e8YnaDRthx5k0zfgnnY='

sdk_client = Client(
    api_key=AUTHENA_API_KEY,
    api_secret=AUTHENA_API_SECRET,
    config=Config(
        public_api_url=AUTHENA_PUBLIC_API_URL
    )
)

Create a user

To create user, use SDK client method - user.create.

Request syntax:

response = sdk_client.user.create(
    email='string',
    preferred_username='string',
    first_name='string',
    last_name='string',
    username='string',
    group_ids=['string', 'string', '...'],
    permissions=['string', 'string', '...']
)

Parameters

  • email (string) [REQUIRED] - Email address of the user.
  • preferred_username (string) [REQUIRED] - Preferred username of the user.
  • first_name (string) [REQUIRED] - Given name of the user.
  • last_name (string) [REQUIRED] - Family name of the user.
  • username (string) [OPTIONAL] - Unique idnetifier of the user.
  • group_ids (list) [OPTIONAL] - A list of group unique identifiers.
  • permissions (list) [OPTIONAL] - A list of user permissions.

Returns

Return Type: User

User Attributes:

  • username (string) - Unique identifier of newly created user.
  • preferred_username (string) - Preferred username of newly created user.
  • email (string) - Email address of newly created user.
  • first_name (string) - Given name of newly created user.
  • last_name (string) - Family name of newly created user.
  • tmp_password (string) - Temporary password of newly created user.
  • group_ids (list) - A list of unique identifiers of assigned permission groups.
  • permissions (list) - A list of directly assigned user permissions.

Get User

Retrieval of previously created user.

Request syntax:

response = sdk_client.user.get(username='string')

Parameters

  • username (string) [REQUE] - Unique idnetifier of the user.

Returns

Return Type: User

User Attributes:

  • username (string) - Unique identifier of newly created user.
  • preferred_username (string) - Preferred username of newly created user.
  • email (string) - Email address of newly created user.
  • first_name (string) - Given name of newly created user.
  • last_name (string) - Family name of newly created user.
  • group_ids (list) - A list of unique identifiers of assigned permission groups.
  • permissions (list) - A list of directly assigned user permissions.
  • is_active (bool) - Specifies whether the user is enabled.

Please check the documentation available here, which contains information on how to use the library, and a complete API reference guide.

Testing

The project has tests that can be run. Simply run:

pytest authena_python_sdk_tests

Contribution

Found a bug? Want to add or suggest a new feature?
Contributions of any kind are gladly welcome. You may contact us directly, create a pull-request or an issue in github platform. Lets modernize the world together.

Release history

0.0.5

  • User filter method updated to include directly assigned user permissions.
  • Redundant integration tests removed.

0.0.4

  • SDK client base updated by introducing basic auth.

0.0.3

  • Fix mismatched environment variable names in the pipeline.

0.0.2

  • Add integration tests.

0.0.1

  • Initial build.

Metadata

Release files for authena-python-sdk 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for authena-python-sdk 0.0.5
File Size Uploaded Provenance
authena_python_sdk-0.0.5.tar.gz 17.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for authena-python-sdk 0.0.5
File Interpreter ABI Platform
authena_python_sdk-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 46.4 kB

Release files / authena_python_sdk-0.0.5.tar.gz

Download URL authena_python_sdk-0.0.5.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d4a5f7c263634e684a14d788a023f97863ceba0e7c81a16121555b7c3c829cc8
BLAKE2b-256 checksum
How to use checksums
161dc6e57b90617784a5537e09c3d906cf0371e419fd9d7d8ab98ce9ee3e8eb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Release files / authena_python_sdk-0.0.5-py3-none-any.whl

Download URL authena_python_sdk-0.0.5-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bce367446410fd883c1d34d8931b66278118065481602f722c31bcb3cd03309e
BLAKE2b-256 checksum
How to use checksums
4205c8e500a81e090bfb157d44a1362fc209dc96aed207ee98f2266af5f053f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Security for authena-python-sdk 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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