Package: indykite-sdk-python
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://console.indykite.id/https://www.indykite.com/RequirementsPython 3.11Installationpip install indykite-sdk-pythonUsed terminologyDefinitionDescriptionDigital TwinA digital twin is the digital identity of a physical entity on/in a software/identity systemApplication Space IDID of the application space the digital twin belongs toApplication Agent IDID of the agent which makes the application available for the different callsTenant IDID of the tenant the digital twin belongs to. The tenant belongs to an application spacePrivate Key and SettingsThe secret which required to reach the system. Indykite provides the necessary secretsPropertyThe digital twin's property (eg.: email, name)JWTJSON Web TokensIntrospectA process used to validate the token and to retrieve properties assigned to the tokenPatch propertyAdd, change or delete a property of a digital twinInitial settingsYou need to have an AppAgent credentials json file to be able to use the IndyKite Python SDK. You can get it from the
Indykite console:https://console.indykite.id/.Example configuration file:{"baseUrl":"","defaultTenantId":"","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#ParseDurationExamples: 30m, 1.5h, 2h45mExample at the end of the json file:{
  ...
  "privateKeyPKCS8": "-----BEGIN PRIVATE KEY-----\nM\n-----END PRIVATE KEY-----",
  "tokenLifetime": "30m"
}Conditionally optional parameters:,baseUrldefaultTenantIdendpointCredentialsIdentityYou have two choices to set up the necessary credentials. You either pass the json to theINDYKITE_APPLICATION_CREDENTIALSenvironment variable or set theINDYKITE_APPLICATION_CREDENTIALS_FILEenvironment variable to the configuration file's path.on Linux and OSXexport INDYKITE_APPLICATION_CREDENTIALS='{
   "baseUrl": "",
   "defaultTenantId": "",
   "applicationId": "",
   "appSpaceId": "",
   "appAgentId": "",
   "endpoint": "",
   "privateKeyJWK":
   {
       "alg": "ES256",
       "crv": "P-256",
       "d": "",
       "kid": "",
       "kty": "EC",
       "use": "sig",
       "x": "",
       "y": ""
   },
   "privateKeyPKCS8Base64":"",
   "privateKeyPKCS8": ""
}'orexport INDYKITE_APPLICATION_CREDENTIALS_FILE=/Users/xx/configuration.jsonon Windows command linesetex INDYKITE_APPLICATION_CREDENTIALS='{
     "baseUrl": "",
     "defaultTenantId": "",
     "applicationId": "",
     "appSpaceId": "",
     "appAgentId": "",
     "endpoint": "",
     "privateKeyJWK":
     {
         "alg": "ES256",
         "crv": "P-256",
         "d": "",
         "kid": "",
         "kty": "EC",
         "use": "sig",
         "x": "",
         "y": ""
     },
     "privateKeyPKCS8Base64":"",
     "privateKeyPKCS8": ""
 }'orsetex INDYKITE_APPLICATION_CREDENTIALS_FILE "C:\Users\xx\Documents\configuration.json"ConfigTo manage its spaces, among other things, theDigitalTwin (DT)who owns the relevant customer creates aservice account.A service account is a non person entity which belongs to theDTwho created it. It is aDTwith 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 AppSpaces, creating applications, creating agent credentials, creating other service accounts, modify user permissions or any action through theGraph 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 theINDYKITE_SERVICE_ACCOUNT_CREDENTIALSenvironment variable or set theINDYKITE_SERVICE_ACCOUNT_CREDENTIALS_FILEenvironment variable to the configuration file's path.on Linux and OSXexport 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"
  }'orexport INDYKITE_SERVICE_ACCOUNT_CREDENTIALS_FILE=/Users/xx/configuration.jsonon Windows command linesetex 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"
  }'orsetex INDYKITE_SERVICE_ACCOUNT_CREDENTIALS_FILE "C:\Users\xx\Documents\configuration.json"Initialize a client to establish the connection. This client instance'sself.stubwill be used by the other functions.Note:The client is opening a GRPC channel and the clientmustclose the channel, too! If the client doesn't close the channel
after use, it can cause surprises like_InactiveRpcErrors.fromindykite_sdk.identityimportIdentityClientimportargparse# Create parent parserparser=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")# Createargs=parser.parse_args()local=args.localclient=IdentityClient(local)Close a GRPC channel
You simple call theclose()function on the channel (TheIdentityClient()function below represents the def in the previous step)fromindykite_sdk.identityimportIdentityClientdefopen_and_close_channel():client=IdentityClient()client.channel.close()Running testsTo run unit tests, simply executepytestTo display code coverage, enterpytest --cov .Functions detailshttps://indykite.github.io/indykite-sdk-python/Exampleshttps://github.com/indykite/indykite-sdk-python/tree/master/indykite_sdkSDK DevelopmentCommit message followscommit guidelinesRoadmapCheckout our roadmap on ourissues pageContributingContribution guidelines for this projectSupport, Feedback, Connect with other developersFeel free to file a bug, submit an issue or give us feedback on ourissues pageVulnerability ReportingResponsible DisclosureChangelogChangelogContributers / AcknowledgementsComing Soon!What is IndyKiteIndyKite 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.LicenseThis project is licensed under the terms of the Apache 2.0 license.Changelog1.37.0(2024-02-21)Featuresreplace ingestv2 by ingestv3 (8e4ba3e)1.36.0(2024-02-13)implementENG-2778Featuresimplement knowledge and objects v1beta2 (920e7ad)1.35.0(2023-12-20)Featuresclean identity deprecated param (62f83b0)1.34.0(2023-12-04)Featuresadd externalId subject in authz (3e5c5d4)Miscellaneous Choresdeps:update google-github-actions/auth action to v2 (0b64774)1.33.1(2023-11-28)Bug Fixesfix tests and scripts broken after type modif (89d8927)update outdated dependencies (f413859)1.33.0(2023-10-30)Featuresremove readid config node (c4cc60c)update dependencies (c974826)Miscellaneous Choresdeps:update actions/setup-node action to v4 (6bd190e)1.32.0(2023-10-23)Featuresadd delete all nodes and old methods removal (b9c17f2)1.31.0(2023-10-17)Featureschange resource id with external_id in authz (05bae8f)1.30.0(2023-10-10)Featuresadd authz config node versioning (7565a8a)add identity knowledge methods (9b041e6)change version and add limit in custom token (9579790)update authorization subject (1dbe080)Miscellaneous Choresdeps: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)Featuresadd authz config node versioning (7565a8a)change version and add limit in custom token (9579790)separate stream from ingest (1e094ee)Miscellaneous Choresdeps:update actions/checkout action to v4 (850a833)master:release 1.29.0 (89281ab)1.28.0(2023-08-23)Featuresupdate ingest methods (1b02eff)1.27.0(2023-08-17)Featuresremove local argument (c0d67ee)1.26.0(2023-08-15)FeaturestokenLifetime, common clients and tokenSource (ee8ece2)1.25.0(2023-07-27)Featuresadd spaces config and check deletes (96908c6)custom login token (dc9e77a)update identity methods (cb07b18)1.24.0(2023-06-28)Featuresadd 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)Featuresadd info in ingest (f2e2a0c)add readid and kg schema config nodes (cb47dbf)change spaces example (4c47fc8)change spaces example (058f251)update spaces (b66ed2c)Bug Fixesrepair release files (7bcb8f2)Miscellaneous Choresmaster:release 1.23.0 (a436146)1.22.0(2023-06-06)Featuresdelete dt by property (fc76ec9)get DT by property (49c4a7b)Bug Fixesupdate buf generated files (4fd5d32)1.21.0(2023-05-30)Featuresadd 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 Fixesfix dependencies (e7dc548)update failing tests (82880bc)1.20.0(2023-04-24)Featuresadd 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)Featuresadd authz policy config node (890c762)1.18.0(2023-04-17)Featuresadd what_authorized feature (d70b293)consent challenge (dd8a109)create consent challenge verifier (299d867)1.17.0(2023-04-11)Featuresadd http client (d558a02)remove is_authorized (cc4d9ed)update api.py (8d5ea54)update is_authorized method (1c13102)update is_authorized method (fd18e91)Bug Fixesfixed vulnerabilies from dependabot (d3208ff)remove js vulnerability (e6285fc)1.16.0(2023-03-21)Featuresadd session introspect (75bb9ea)change init returns (c2ce5fc)eng-114 register digital twin without cred (5a0295f)1.15.0(2023-03-14)Featuresadd invitation features (306b26a)add webauthn config node and cn updates (425d031)1.14.0(2023-02-21)Featuresadd forgotten password feature (be97ec1)add forgotten password feature (5420614)1.13.0(2023-02-16)Featuresreinit test data (2c7ab8a)update documentation (f333e47)1.12.0(2023-02-10)Featuresadd logger in config methods (dbf1b36)add logger in identity and authz methods (f3039bb)add logger in identity and authz methods (5ba11fc)Bug Fixescorrected is_authorized deserialization and tests (8091e5d)corrected is_authorized deserialization and tests (f273e38)1.11.0(2023-02-07)Featuresadd generated doc (d5581a4)add generated documentation (2eefbd8)add generated documentation (332f02a)add generated documentation (e736152)add oauth2 consent (833f7ac)add oauth2 consent (a83d83c)remove build in documentation (10850c9)1.10.1(2023-01-24)Bug Fixesremove identifier_value from message_to_value.py (9747d84)1.10.0(2023-01-20)Featuresadd authorization (961701d)add authorization (2982050)add authorization (c6d6b6e)add authorization (2d922d7)add authorization with token (15544e2)1.9.0(2023-01-12)Featuresadd import DT and update tests (ca30bd0)add import DT and update tests (c1c954f)1.8.0(2023-01-05)Featuresadd missing init files (cf0d5dd)1.7.0(2023-01-05)Featureschange python version (00ebbff)change python version (f4effed)1.6.0(2023-01-04)Featureschange config after repo name changed (2d9f123)modif with repo name modification (5dbcb77)modif with repo name modification (8db8c97)1.5.0(2023-01-03)Featuresuuid to gid and files renaming (a4ffd9e)1.4.0(2022-12-09)Featuresconfig nodes and oauth2 (5c3147f)config nodes and oauth2 (0d90b42)update documentation (0ba7528)1.3.0(2022-11-11)Featuresadd 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 Fixesreturn response in stream_records() (6c4f09d)1.2.0(2022-05-25)Featuresget digital twin with properties (c515e56)1.1.0(2022-05-04)Featuresadd enrich token method (1298a5e)1.0.2(2022-04-29)Bug Fixesadd imports from root package (9ea91f6)do not include tests in build files (5d06b72)1.0.1(2022-04-27)Bug Fixesadd encoding when open files (a5406ea)Miscellaneous Choresadd missinginit.py files (c2d45b1)1.0.0(2022-04-26)Miscellaneous Choresrelease 1.0.0 (23325c5)