This is the python SDK for the FINBOURNE Access Management API, part of the LUSID by FINBOURNE platform. To use it you'll need a LUSID account - sign up for free at lusid.com.
Access provides access control for LUSID (in conjunction with Identity) - see https://support.lusid.com/knowledgebase/article/KA-01647/ to learn more.
For more details on other applications in the LUSID platform, see Understanding all the applications in the LUSID platform.
This sdk supports Production
, Early Access
, Beta
and Experimental
API endpoints. For more details on API endpoint categories, see What is the LUSID feature release lifecycle. To find out which category an API endpoint falls into, see the swagger page.
This code is automatically generated by the OpenAPI Generator project.
- API version: 0.0.3942
- SDK version: 2.1.142
- Python 3.7+
If using poetry
poetry add finbourne-access-sdk
If using pip
pip install finbourne-access-sdk
Then import the package in your python file
import finbourne_access
You'll need to provide some configuration to connect to the FINBOURNE Access Management API - see the articles about short-lived access tokens and a long-lived Personal Access Token. This configuration can be provided using a secrets file or environment variables.
Required for a short-lived access token
FBN_TOKEN_URL
FBN_ACCESS_URL
FBN_USERNAME
FBN_PASSWORD
FBN_CLIENT_ID
FBN_CLIENT_SECRET
Required for a long-lived access token
FBN_ACCESS_URL
FBN_ACCESS_TOKEN
You can send your requests to the FINBOURNE Access Management API via a proxy, by setting FBN_PROXY_ADDRESS
. If your proxy has basic auth enabled, you must also set FBN_PROXY_USERNAME
and FBN_PROXY_PASSWORD
.
The secrets file must be in the current working directory.
Required for a short-lived access token
{
"api":
{
"tokenUrl":"<your-token-url>",
"accessUrl":"https://<your-domain>.lusid.com/access",
"username":"<your-username>",
"password":"<your-password>",
"clientId":"<your-client-id>",
"clientSecret":"<your-client-secret>",
}
}
Required for a long-lived access token
{
"api":
{
"accessUrl":"https://<your-domain>.lusid.com/access",
"accessToken":"<your-access-token>"
}
}
You can send your requests to the FINBOURNE Access Management API via a proxy, by adding a proxy section. If your proxy has basic auth enabled, you must also supply a username
and password
in this section.
{
"api":
{
"accessUrl":"https://<your-domain>.lusid.com/access",
"accessToken":"<your-access-token>"
},
"proxy":
{
"address":"<your-proxy-address>",
"username":"<your-proxy-username>",
"password":"<your-proxy-password>"
}
}
import asyncio
from finbourne_access.exceptions import ApiException
from finbourne_access.models import *
from pprint import pprint
from finbourne_access import (
ApiClientFactory,
ApplicationMetadataApi
)
async def main():
with open("secrets.json", "w") as file:
file.write('''
{
"api":
{
"tokenUrl":"<your-token-url>",
"accessUrl":"https://<your-domain>.lusid.com/access",
"username":"<your-username>",
"password":"<your-password>",
"clientId":"<your-client-id>",
"clientSecret":"<your-client-secret>"
}
}''')
# Use the finbourne_access ApiClientFactory to build Api instances with a configured api client
# By default this will read config from environment variables
# Then from a secrets.json file found in the current working directory
api_client_factory = ApiClientFactory()
# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use
async with api_client_factory:
# Create an instance of the API class
api_instance = api_client_factory.build(ApplicationMetadataApi)
try:
# ListAccessControlledResources: Get resources available for access control
api_response = await api_instance.list_access_controlled_resources()
pprint(api_response)
except ApiException as e:
print("Exception when calling ApplicationMetadataApi->list_access_controlled_resources: %s\n" % e)
asyncio.run(main())
- See Documentation for API Endpoints for a description of each endpoint
- See Documentation for Models for descriptions of the models used