Skip to main content

Formal SDK

Project description

Formal Admin Python SDK

This is the Python SDK for the Formal Admin API.

Installing

pip install formal-sdk

Example Use

Create and Get a Native Role

import os
import formal_sdk

if __name__ == '__main__':

    dataStoreId = ""
    nativeRoleId = ""
    nativeRoleSecret = ""
    useAsDefault = True
    apiKey = os.environ.get('TEST_API_KEY')
    
    newClient = formal_sdk.Client(apiKey)
    # Create Native Role
    createdRole = newClient.DataStoreClient.CreateNativeRole(dataStoreId=dataStoreId, nativeRoleId=nativeRoleId, nativeRoleSecret=nativeRoleSecret, useAsDefault=useAsDefault)
    
    # Get Native Role    
    previousRole = newClient.DataStoreClient.GetNativeRole(dataStoreId=dataStoreId, nativeRoleId=nativeRoleId)

    print(f'DataStoreId: {previousRole.dataStoreId}')
    print(f'NativeRoleId: {previousRole.nativeRoleId}')
    print(f'NativeRoleSecret: {previousRole.nativeRoleSecret}')
    print(f'UseAsDefault: {previousRole.useAsDefault}')

    # Get sidecar tls certificate and private key
    sidecarId = ""
    certificate, privateKey, fullSecret = newClient.SidecarClient.GetTLSCertificate(sidecarId)

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

formal-sdk-0.10.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

formal_sdk-0.10.0-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

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