authelio-sdk


Nameauthelio-sdk JSON
Version 3.1.1 PyPI version JSON
download
home_pagehttps://github.com/Biomapas/AuthelioPythonSDK.git
SummaryAuthelio Python SDK
upload_time2022-12-19 15:10:59
maintainer
docs_urlNone
authorGediminas Kazlauskas
requires_python
licenseApache License 2.0
keywords authelio python sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Authelio Python SDK

## Description

**Authelio Python SDK** allows an easy and fast integration with **AUTHELIO** - authentication and authorization API.

#### Remarks

[Biomapas](https://biomapas.com) 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.

#### Related technology

- 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 authelio_sdk
```

Or directly install it through source.

```
pip install .
```

## Usage & Examples

### SDK client

Create **Authelio SDK** client using the given **AUTHELIO PUBLIC API URL**, **API KEY**, and **API SECRET**:

```python
from authelio_sdk.client import Client
from authelio_sdk.config import Config

AUTHELIO_PUBLIC_API_URL = 'http://localhost'
AUTHELIO_API_KEY = 'DFCC345BE3C0DC42DF8A123F7579'
AUTHELIO_API_SECRET = '4AomCEeUG2j7epT87GahHfh2e8YnaDRthx5k0zfgnnY='

sdk_client = Client(
    api_key=AUTHELIO_API_KEY,
    api_secret=AUTHELIO_API_SECRET,
    config=Config(
        public_api_url=AUTHELIO_PUBLIC_API_URL
    )
)
```

### Hosted login page

To get hosted login page URL, use SDK client method - `user.login`.

**Request syntax:**

```python
response = sdk_client.user.login(
    redirect_uri='https://example.com',
    response_type='code'
)
```

**Parameters**

- **redirect_uri** (string) [OPTIONAL] - URI of the resource for which login page is required. 
If omitted default resource URI will be used.
- **response_type** (string) [OPTIONAL] - The response type. Must be either `code` or `token`. 
Indicates whether the client wants an authorization code for the user (authorization code grant flow), 
or directly issues tokens for the user (implicit flow). Default: `code`

**Returns**

Hosted login page URL.

Return Type: String

### Create a user

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

**Request syntax:**

```python
response = sdk_client.user.create(
    email='string',
    username='string',
    first_name='string',
    last_name='string',
    user_id='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:**

```python
response = sdk_client.user.get(user_id='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 authelio_sdk_tests
```

#### Contribution

Found a bug? Want to add or suggest a new feature?<br>
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

### 3.1.1
- User `create` method update:
  - Addition of optional parameters to `user/create` endpoint payload revised.

### 3.1.0

- User `create` method updates:
  - A new optional parameter `auth_type` introduced. Parameter allows to specify user authentication type.
  - Mandatory parameter `username` change into an optional one. The Authelio API does not allowed to 
  specify `username` for the user of `federated_sso` auth type.

### 3.0.1

- Limit urllib3 dependency up to the breaking version.

### 3.0.0

- `user_ids` as arguments for the client `User` method `get` introduced.
- `group_ids` as arguments for the client `Group` methods `get` and `users` introduced. 

### 2.0.0

- New method `users` for the client `Group` added. The method retrieves either user IDs
  for the given group or common user ids for the given groups.
- Client `User` updates:
    - Method `filter` updated. Method accepts optional pagination parameters, `count` and
      next page token `page_id`. Returns chunk of filtered user entities and next page token
      if such exist.
    - Method `get` updated. Retrieval of multiple user entities implemented.
- Client `Group` updates:
    - Method `filter` updated. Method accepts optional pagination parameters, `count` and
      next page token `page_id`. Returns chunk of filtered group entities and next page token
      if such exist.
    - Method `get` updated. Retrieval of multiple group entities implemented.

### 1.1.0

- User login method returning hosted login page URL added.

### 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.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Biomapas/AuthelioPythonSDK.git",
    "name": "authelio-sdk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Authelio Python SDK",
    "author": "Gediminas Kazlauskas",
    "author_email": "gediminas.kazlauskas@biomapas.com",
    "download_url": "https://files.pythonhosted.org/packages/d0/86/5122370a05348fc3a9d85eaafe827473b70b4cda6311cb3ff1b574b419ca/authelio_sdk-3.1.1.tar.gz",
    "platform": null,
    "description": "# Authelio Python SDK\n\n## Description\n\n**Authelio Python SDK** allows an easy and fast integration with **AUTHELIO** - authentication and authorization API.\n\n#### Remarks\n\n[Biomapas](https://biomapas.com) aims to modernize life-science\nindustry by sharing its IT knowledge with other companies and\nthe community. This is an open source library intended to be used\nby anyone. Improvements and pull requests are welcome.\n\n#### Related technology\n\n- Python 3\n\n#### Assumptions\n\nThe project assumes the following:\n\n- You have basic-good knowledge in python programming.\n\n#### Install\n\nThe project is built and uploaded to PyPi. Install it by using pip.\n\n```\npip install authelio_sdk\n```\n\nOr directly install it through source.\n\n```\npip install .\n```\n\n## Usage & Examples\n\n### SDK client\n\nCreate **Authelio SDK** client using the given **AUTHELIO PUBLIC API URL**, **API KEY**, and **API SECRET**:\n\n```python\nfrom authelio_sdk.client import Client\nfrom authelio_sdk.config import Config\n\nAUTHELIO_PUBLIC_API_URL = 'http://localhost'\nAUTHELIO_API_KEY = 'DFCC345BE3C0DC42DF8A123F7579'\nAUTHELIO_API_SECRET = '4AomCEeUG2j7epT87GahHfh2e8YnaDRthx5k0zfgnnY='\n\nsdk_client = Client(\n    api_key=AUTHELIO_API_KEY,\n    api_secret=AUTHELIO_API_SECRET,\n    config=Config(\n        public_api_url=AUTHELIO_PUBLIC_API_URL\n    )\n)\n```\n\n### Hosted login page\n\nTo get hosted login page URL, use SDK client method - `user.login`.\n\n**Request syntax:**\n\n```python\nresponse = sdk_client.user.login(\n    redirect_uri='https://example.com',\n    response_type='code'\n)\n```\n\n**Parameters**\n\n- **redirect_uri** (string) [OPTIONAL] - URI of the resource for which login page is required. \nIf omitted default resource URI will be used.\n- **response_type** (string) [OPTIONAL] - The response type. Must be either `code` or `token`. \nIndicates whether the client wants an authorization code for the user (authorization code grant flow), \nor directly issues tokens for the user (implicit flow). Default: `code`\n\n**Returns**\n\nHosted login page URL.\n\nReturn Type: String\n\n### Create a user\n\nTo create user, use SDK client method - `user.create`.\n\n**Request syntax:**\n\n```python\nresponse = sdk_client.user.create(\n    email='string',\n    username='string',\n    first_name='string',\n    last_name='string',\n    user_id='string',\n    group_ids=['string', 'string', '...'],\n    permissions=['string', 'string', '...']\n)\n```\n\n**Parameters**\n\n- **email** (string) [REQUIRED] - Email address of the user.\n- **preferred_username** (string) [REQUIRED] - Preferred username of the user.\n- **first_name** (string) [REQUIRED] - Given name of the user.\n- **last_name** (string) [REQUIRED] - Family name of the user.\n- **username** (string) [OPTIONAL] - Unique idnetifier of the user.\n- **group_ids** (list) [OPTIONAL] - A list of group unique identifiers.\n- **permissions** (list) [OPTIONAL] - A list of user permissions.\n\n**Returns**\n\nReturn Type: User\n\n**User Attributes**:\n\n- **username** (string) - Unique identifier of newly created user.\n- **preferred_username** (string) - Preferred username of newly created user.\n- **email** (string) - Email address of newly created user.\n- **first_name** (string) - Given name of newly created user.\n- **last_name** (string) - Family name of newly created user.\n- **tmp_password** (string) - Temporary password of newly created user.\n- **group_ids** (list) - A list of unique identifiers of assigned permission groups.\n- **permissions** (list) - A list of directly assigned user permissions.\n\n### Get User\n\nRetrieval of previously created user.\n\n**Request syntax:**\n\n```python\nresponse = sdk_client.user.get(user_id='string')\n```\n\n**Parameters**\n\n- **username** (string) [REQUE] - Unique idnetifier of the user.\n\n**Returns**\n\nReturn Type: User\n\n**User Attributes**:\n\n- **username** (string) - Unique identifier of newly created user.\n- **preferred_username** (string) - Preferred username of newly created user.\n- **email** (string) - Email address of newly created user.\n- **first_name** (string) - Given name of newly created user.\n- **last_name** (string) - Family name of newly created user.\n- **group_ids** (list) - A list of unique identifiers of assigned permission groups.\n- **permissions** (list) - A list of directly assigned user permissions.\n- **is_active** (bool) - Specifies whether the user is enabled.\n\nPlease check the documentation available here, which contains information on how to use the library, \nand a complete API reference guide.\n\n#### Testing\n\nThe project has tests that can be run. Simply run:\n\n```\npytest authelio_sdk_tests\n```\n\n#### Contribution\n\nFound a bug? Want to add or suggest a new feature?<br>\nContributions of any kind are gladly welcome. You may contact us\ndirectly, create a pull-request or an issue in github platform.\nLets modernize the world together.\n\n\n# Release history\n\n### 3.1.1\n- User `create` method update:\n  - Addition of optional parameters to `user/create` endpoint payload revised.\n\n### 3.1.0\n\n- User `create` method updates:\n  - A new optional parameter `auth_type` introduced. Parameter allows to specify user authentication type.\n  - Mandatory parameter `username` change into an optional one. The Authelio API does not allowed to \n  specify `username` for the user of `federated_sso` auth type.\n\n### 3.0.1\n\n- Limit urllib3 dependency up to the breaking version.\n\n### 3.0.0\n\n- `user_ids` as arguments for the client `User` method `get` introduced.\n- `group_ids` as arguments for the client `Group` methods `get` and `users` introduced. \n\n### 2.0.0\n\n- New method `users` for the client `Group` added. The method retrieves either user IDs\n  for the given group or common user ids for the given groups.\n- Client `User` updates:\n    - Method `filter` updated. Method accepts optional pagination parameters, `count` and\n      next page token `page_id`. Returns chunk of filtered user entities and next page token\n      if such exist.\n    - Method `get` updated. Retrieval of multiple user entities implemented.\n- Client `Group` updates:\n    - Method `filter` updated. Method accepts optional pagination parameters, `count` and\n      next page token `page_id`. Returns chunk of filtered group entities and next page token\n      if such exist.\n    - Method `get` updated. Retrieval of multiple group entities implemented.\n\n### 1.1.0\n\n- User login method returning hosted login page URL added.\n\n### 0.0.5\n\n- User filter method updated to include directly assigned user permissions.\n- Redundant integration tests removed.\n\n### 0.0.4\n\n- SDK client base updated by introducing basic auth.\n\n### 0.0.3\n\n- Fix mismatched environment variable names in the pipeline.\n\n### 0.0.2\n\n- Add integration tests.\n\n### 0.0.1\n\n- Initial build.\n\n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Authelio Python SDK",
    "version": "3.1.1",
    "split_keywords": [
        "authelio",
        "python",
        "sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "776e7986e1eceae60d807576364ad1a8",
                "sha256": "b3e1efd089c85730a104f22ee314caddf0a580f87597617bdede03af0bac5a32"
            },
            "downloads": -1,
            "filename": "authelio_sdk-3.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "776e7986e1eceae60d807576364ad1a8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 29962,
            "upload_time": "2022-12-19T15:10:57",
            "upload_time_iso_8601": "2022-12-19T15:10:57.617651Z",
            "url": "https://files.pythonhosted.org/packages/59/58/aa26ee2797a150aaa4c89a1005dd78ad8dce23557c5844595503057c2536/authelio_sdk-3.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "4d644346e6289dabf1f236eb5ac5c736",
                "sha256": "c454eaba7d0851b07ce96be5f5e2b490fb184e707a30d2f36907dfd13efddc02"
            },
            "downloads": -1,
            "filename": "authelio_sdk-3.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4d644346e6289dabf1f236eb5ac5c736",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20069,
            "upload_time": "2022-12-19T15:10:59",
            "upload_time_iso_8601": "2022-12-19T15:10:59.139783Z",
            "url": "https://files.pythonhosted.org/packages/d0/86/5122370a05348fc3a9d85eaafe827473b70b4cda6311cb3ff1b574b419ca/authelio_sdk-3.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-19 15:10:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Biomapas",
    "github_project": "AuthelioPythonSDK.git",
    "lcname": "authelio-sdk"
}
        
Elapsed time: 0.03983s