Skip to main content

A python SDK package for Indykite's system (with protobuf)

Project description

IndyKite Python SDK 🐍

This project serves as a Software Development Kit for developers of Indykite applications. The Python SDK enables you to easily integrate the IndyKite platform gRPC APIs into your Python application. https://console2.indykite.id/ https://www.indykite.com/

codecov

Requirements

  • Python >=3.11

Installation

add to pipfile [packages]:
indykite-sdk-python = {ref = "v1.49.0", git = "https://github.com/indykite/indykite-sdk-python"}

Used terminology

To do anything at all in the IndyKite platform, you must first create an Organization (Customer) in the Hub (https://console2.indykite.id/) — the Web interface used to interact with and do tasks in the IndyKite platform and get your credentials (https://docs.indykite.com/docs/get-started).

Once you have created a Customer, a service account, and you have your service account credentials, you can set up the SDK.

Definition Description
Identity Knowledge Graph The Identity Knowledge Graph is a contextualized data model that constructed entities and their relationships (data entities) using a graph database.
Nodes Data points stored as nodes (identity nodes and resources) and edges (relationships)
Identity node An identity node (node with is_identity=True) is the digital identity of a physical entity on/in a software/identity system
Application Space ID ID of the application space the nodes belong to
Application Agent ID ID of the agent which makes the application available for the different calls
Private Key and Settings The secret which required to reach the system.
JWT JSON Web Tokens
Introspect A process used to validate the token and to retrieve properties assigned to the token

Initial settings

:one: Service account credentials

You need to have a Service Account credentials json file to be able to use the IndyKite Python SDK. You can get it from the IndyKite hub: https://console2.indykite.id/.

Config

To manage its spaces, among other things, the owner of the relevant customer creates a service account.

A service account is a non-person entity which belongs to the owner who created it. It is a node with its own credential which acts only through its owner.

A service account is always created under a customer.

The purpose of a service account is for a non-person entity to manage the platform configuration: creating Projects (AppSpaces), Applications, Agent credentials, other service accounts, configuration nodes or any action through the Graph DB.

The service account is also needed if you want to use Terraform for your configuration.

You have two choices to set up the necessary credentials. You either pass the json to the INDYKITE_SERVICE_ACCOUNT_CREDENTIALS environment variable or set the INDYKITE_SERVICE_ACCOUNT_CREDENTIALS_FILE environment variable to the configuration file's path.

You should use an absolute path for the file.

  • on Linux and OSX

     export INDYKITE_SERVICE_ACCOUNT_CREDENTIALS='{
      "serviceAccountId":"",
      "endpoint":"",
      "privateKeyJWK":{
        "alg":"ES256",
        "crv":"P-256",
        "d":"",
        "kid":"",
        "kty":"EC",
        "use":"sig",
        "x":"",
        "y":""
        },
      "privateKeyPKCS8Base64":"",
      "privateKeyPKCS8":"-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----\n"
      }'
    

    or

    export INDYKITE_SERVICE_ACCOUNT_CREDENTIALS_FILE=/Users/xx/configuration.json

  • on Windows command line

     setex INDYKITE_SERVICE_ACCOUNT_CREDENTIALS='{
      "serviceAccountId":"",
      "endpoint":"",
      "privateKeyJWK":{
        "alg":"ES256",
        "crv":"P-256",
        "d":"",
        "kid":"",
        "kty":"EC",
        "use":"sig",
        "x":"",
        "y":""
        },
      "privateKeyPKCS8Base64":"",
      "privateKeyPKCS8":"-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----\n"
      }'
    

    or

    setex INDYKITE_SERVICE_ACCOUNT_CREDENTIALS_FILE "C:\Users\xx\Documents\configuration.json"

:two: AppAgent Credentials

You will also need to have an Application Agent credentials json file to be able to use the other services like IKG (ingestion) and KBAC (authorization). You can get it from the IndyKite hub (https://console2.indykite.id/) or using the SDK.

Example configuration file:
{
    "baseUrl": "",
    "applicationId": "",
    "appSpaceId": "",
    "appAgentId": "",
    "endpoint": "",
    "privateKeyJWK":
    {
        "alg": "ES256",
        "crv": "P-256",
        "d": "",
        "kid": "",
        "kty": "EC",
        "use": "sig",
        "x": "",
        "y": ""
    },
    "privateKeyPKCS8Base64": "",
    "privateKeyPKCS8": ""
}

A token lifetime is 1h by default. You can change this time (from 2 minutes to 24h) by adding a tokenLifetime parameter.

It will have to be human-readable and Golang-like see -> https://pkg.go.dev/time#ParseDuration

Examples: 30m, 1.5h, 2h45m

Example at the end of the json file:

{
  ...
  "privateKeyPKCS8": "-----BEGIN PRIVATE KEY-----\nM\n-----END PRIVATE KEY-----",
  "tokenLifetime": "30m"
}

Identity

You have two choices to set up the necessary credentials. You either pass the json to the `INDYKITE_APPLICATION_CREDENTIALS`
environment variable or set the `INDYKITE_APPLICATION_CREDENTIALS_FILE` environment variable to the configuration file's path.
  • on Linux and OSX

     export INDYKITE_APPLICATION_CREDENTIALS='{
       "baseUrl": "",
       "applicationId": "",
       "appSpaceId": "",
       "appAgentId": "",
       "endpoint": "",
       "privateKeyJWK":
       {
           "alg": "ES256",
           "crv": "P-256",
           "d": "",
           "kid": "",
           "kty": "EC",
           "use": "sig",
           "x": "",
           "y": ""
       },
       "privateKeyPKCS8Base64":"",
       "privateKeyPKCS8": ""
    }'
    

    or

    export INDYKITE_APPLICATION_CREDENTIALS_FILE=/Users/xx/configuration.json

  • on Windows command line

     setex INDYKITE_APPLICATION_CREDENTIALS='{
         "baseUrl": ""
         "applicationId": "",
         "appSpaceId": "",
         "appAgentId": "",
         "endpoint": "",
         "privateKeyJWK":
         {
             "alg": "ES256",
             "crv": "P-256",
             "d": "",
             "kid": "",
             "kty": "EC",
             "use": "sig",
             "x": "",
             "y": ""
         },
         "privateKeyPKCS8Base64":"",
         "privateKeyPKCS8": ""
     }'
    

    or

    setex INDYKITE_APPLICATION_CREDENTIALS_FILE "C:\Users\xx\Documents\configuration.json"

:three: Initialize a client to establish the connection.

This client instance's self.stub will be used by the other functions.

Note: The client is opening a GRPC channel and the client must close the channel, too! If the client doesn't close the channel after use, it can cause surprises like _InactiveRpcErrors.

from indykite_sdk.identity import IdentityClient
import argparse

    # Create parent parser
    parser = argparse.ArgumentParser(description="Identity client API.")
    parser.add_argument("-l", "--local", action="store_true", help="make the request to localhost")
    subparsers = parser.add_subparsers(dest="command", help="sub-command help")
    
    # Create 
    args = parser.parse_args()
    local = args.local
    client = IdentityClient(local)

:four: Close a GRPC channel You simply call the close() function on the channel (The IdentityClient() function below represents the def in the previous step)

from indykite_sdk.identity import IdentityClient

def open_and_close_channel():
    client = IdentityClient()
    client.channel.close()

Running tests

To run unit tests, simply execute

pytest

To display code coverage, enter

pytest --cov .

Functions details

https://indykite.github.io/indykite-sdk-python/

Examples

https://github.com/indykite/indykite-sdk-python/tree/master/indykite_sdk

SDK Development

Commit message follows commit guidelines

Roadmap

Checkout our roadmap on our issues page

Contributing

Contribution guidelines for this project

Support, Feedback, Connect with other developers

Feel free to file a bug, submit an issue or give us feedback on our issues page

Vulnerability Reporting

Responsible Disclosure

Changelog

Changelog

Contributers / Acknowledgements

Coming Soon!

What is IndyKite

IndyKite is a cloud identity platform built to secure and manage human & non-person (IoT) identities and their data. Based on open source standards, the cloud platform gives developers the ability to secure data and embed identity controls into their Web 3.0 applications. Empowering the world’s 23 million developers without the need to involve security and identity specialists.

License

This project is licensed under the terms of the Apache 2.0 license.

Changelog

1.51.0 (2024-10-21)

Features

  • add entitymatching and delete tags (bc625d2)
  • add entitymatching and delete tags (0aaa9bd)
  • add entitymatching and delete tags (c8f21e7)

1.50.0 (2024-09-13)

Features

1.49.0 (2024-08-05)

Features

  • add field in app space and consent (1bd9501)
  • add field in app space and consent (84ffc81)

1.48.1 (2024-07-15)

Miscellaneous Chores

  • update with the latest proto (e1e28bb)

1.48.0 (2024-07-11)

Features

  • update dependencies and tda data access (a9413ba)

1.47.0 (2024-07-02)

Features

  • remove issuer and update proto files (2c186e8)

1.46.0 (2024-06-28)

Features

  • add token introspect config (60fe53f)

1.45.0 (2024-06-14)

Features

  • update app agent and fix token (df20294)

1.44.0 (2024-06-06)

Features

  • remove outdated authn methods (ca6ade9)
  • remove outdated authn methods (ee71ffa)
  • remove outdated authn methods (49d5523)

1.43.0 (2024-05-30)

Features

  • add batch ingest endpoints (37d8264)

1.42.0 (2024-05-21)

Features

  • add deepsource file (00e53af)
  • update dependencies (f35a699)
  • update dependencies + add some tests (51cc7a0)

Miscellaneous Chores

  • deps: bump idna from 3.6 to 3.7 (3a3bbcb)

1.41.2 (2024-04-26)

Bug Fixes

1.41.1 (2024-04-25)

Bug Fixes

  • add gnostic in ignore-paths (65efe10)

1.41.0 (2024-04-25)

Features

  • add tda and update outdated tests (90ef7d8)

1.40.0 (2024-03-20)

Features

1.39.0 (2024-03-11)

Features

  • remove deprecated functions (9306836)

1.38.0 (2024-03-07)

Features

  • add metadata to knowledge api properties (2db6352)

1.37.0 (2024-02-21)

Features

  • replace ingestv2 by ingestv3 (8e4ba3e)

1.36.0 (2024-02-13)

implement

  • ENG-2778

Features

  • implement knowledge and objects v1beta2 (920e7ad)

1.35.0 (2023-12-20)

Features

  • clean identity deprecated param (62f83b0)

1.34.0 (2023-12-04)

Features

  • add externalId subject in authz (3e5c5d4)

Miscellaneous Chores

  • deps: update google-github-actions/auth action to v2 (0b64774)

1.33.1 (2023-11-28)

Bug Fixes

  • fix tests and scripts broken after type modif (89d8927)
  • update outdated dependencies (f413859)

1.33.0 (2023-10-30)

Features

Miscellaneous Chores

  • deps: update actions/setup-node action to v4 (6bd190e)

1.32.0 (2023-10-23)

Features

  • add delete all nodes and old methods removal (b9c17f2)

1.31.0 (2023-10-17)

Features

  • change resource id with external_id in authz (05bae8f)

1.30.0 (2023-10-10)

Features

  • add authz config node versioning (7565a8a)
  • add identity knowledge methods (9b041e6)
  • change version and add limit in custom token (9579790)
  • update authorization subject (1dbe080)

Miscellaneous Chores

  • deps: update actions/checkout action to v4 (850a833)
  • deps: update codecov/codecov-action action to v4 (2a7a805)
  • master: release 1.29.0 (fd1655a)

1.29.0 (2023-09-14)

Features

  • add authz config node versioning (7565a8a)
  • change version and add limit in custom token (9579790)
  • separate stream from ingest (1e094ee)

Miscellaneous Chores

  • deps: update actions/checkout action to v4 (850a833)
  • master: release 1.29.0 (89281ab)

1.28.0 (2023-08-23)

Features

1.27.0 (2023-08-17)

Features

1.26.0 (2023-08-15)

Features

  • tokenLifetime, common clients and tokenSource (ee8ece2)

1.25.0 (2023-07-27)

Features

  • add spaces config and check deletes (96908c6)
  • custom login token (dc9e77a)
  • update identity methods (cb07b18)

1.24.0 (2023-06-28)

Features

  • add get_schema and refactor some config nodes (20bbf5b)
  • add missing properties (0452cad)
  • change get methods by read (04eb193)
  • update docs (02caa75)

1.23.0 (2023-06-19)

Features

Bug Fixes

Miscellaneous Chores

1.22.0 (2023-06-06)

Features

Bug Fixes

  • update buf generated files (4fd5d32)

1.21.0 (2023-05-30)

Features

  • add backend example for spaces (18fd667)
  • add ingestv2 methods tests and examples (907cb80)
  • change options and add tags (8b42995)
  • remove examples from pipeline (0c7c6d8)
  • remove ingestv1 (a32d9b9)

Bug Fixes

1.20.0 (2023-04-24)

Features

  • add create app with appagent cred (c76bc37)
  • add who authorized (91976f7)
  • change status due to reverse value (cfb6051)
  • change status due to reverse value (17779bb)

1.19.0 (2023-04-18)

Features

  • add authz policy config node (890c762)

1.18.0 (2023-04-17)

Features

  • add what_authorized feature (d70b293)
  • consent challenge (dd8a109)
  • create consent challenge verifier (299d867)

1.17.0 (2023-04-11)

Features

Bug Fixes

  • fixed vulnerabilies from dependabot (d3208ff)
  • remove js vulnerability (e6285fc)

1.16.0 (2023-03-21)

Features

  • add session introspect (75bb9ea)
  • change init returns (c2ce5fc)
  • eng-114 register digital twin without cred (5a0295f)

1.15.0 (2023-03-14)

Features

  • add invitation features (306b26a)
  • add webauthn config node and cn updates (425d031)

1.14.0 (2023-02-21)

Features

  • add forgotten password feature (be97ec1)
  • add forgotten password feature (5420614)

1.13.0 (2023-02-16)

Features

1.12.0 (2023-02-10)

Features

  • add logger in config methods (dbf1b36)
  • add logger in identity and authz methods (f3039bb)
  • add logger in identity and authz methods (5ba11fc)

Bug Fixes

  • corrected is_authorized deserialization and tests (8091e5d)
  • corrected is_authorized deserialization and tests (f273e38)

1.11.0 (2023-02-07)

Features

1.10.1 (2023-01-24)

Bug Fixes

  • remove identifier_value from message_to_value.py (9747d84)

1.10.0 (2023-01-20)

Features

1.9.0 (2023-01-12)

Features

  • add import DT and update tests (ca30bd0)
  • add import DT and update tests (c1c954f)

1.8.0 (2023-01-05)

Features

1.7.0 (2023-01-05)

Features

1.6.0 (2023-01-04)

Features

  • change config after repo name changed (2d9f123)
  • modif with repo name modification (5dbcb77)
  • modif with repo name modification (8db8c97)

1.5.0 (2023-01-03)

Features

  • uuid to gid and files renaming (a4ffd9e)

1.4.0 (2022-12-09)

Features

1.3.0 (2022-11-11)

Features

  • add config application application agent (e2c1174)
  • add config credentials (4eb114a)
  • add config credentials (d7317eb)
  • add config methods (82b7505)
  • add config methods 2798 (3648f19)
  • add config methods appspaces and tenants (bdbfa3c)
  • add config methods appspaces tenants (92b6c14)
  • add ingest api (39576d9)
  • add service account credential (9b73e92)
  • add service_accounts (facf4bd)
  • update documentation (9fe3b71)

Bug Fixes

  • return response in stream_records() (6c4f09d)

1.2.0 (2022-05-25)

Features

  • get digital twin with properties (c515e56)

1.1.0 (2022-05-04)

Features

  • add enrich token method (1298a5e)

1.0.2 (2022-04-29)

Bug Fixes

  • add imports from root package (9ea91f6)
  • do not include tests in build files (5d06b72)

1.0.1 (2022-04-27)

Bug Fixes

  • add encoding when open files (a5406ea)

Miscellaneous Chores

  • add missing init.py files (c2d45b1)

1.0.0 (2022-04-26)

Miscellaneous Chores

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

indykite_sdk_python-1.51.0.tar.gz (146.1 kB view details)

Uploaded Source

Built Distribution

indykite_sdk_python-1.51.0-py3-none-any.whl (182.7 kB view details)

Uploaded Python 3

File details

Details for the file indykite_sdk_python-1.51.0.tar.gz.

File metadata

  • Download URL: indykite_sdk_python-1.51.0.tar.gz
  • Upload date:
  • Size: 146.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for indykite_sdk_python-1.51.0.tar.gz
Algorithm Hash digest
SHA256 41d9c47574c21bcd5ce9dcda18a601d9ad0f16dfd77063dc747ba3a4c9165ff8
MD5 1ee92c6b8df3f75398e7f19ee806528b
BLAKE2b-256 177b9af852de7116a01e29984295af62b1d923332cfd01ec2ccf613b066641b6

See more details on using hashes here.

File details

Details for the file indykite_sdk_python-1.51.0-py3-none-any.whl.

File metadata

File hashes

Hashes for indykite_sdk_python-1.51.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec9499cdf9e200a1cd9dcd0e18d2b31b7d46c714e45dcb73f305000f9d3ecf3b
MD5 31b572cfb0224d56a9ee954776802389
BLAKE2b-256 3e5b697ad2cf3d401532214ba487b35d76eabbcb666ee3c8c90c2b91da4c1d60

See more details on using hashes here.

Supported by

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