Authentication

There are two ways to set credential information for ABEJA Platform SDK usage.

Environment Variables

ABEJA Platform SDK reads env vars with keys below and use these as credential information.

Variable Name Description
ABEJA_ORGANIZATION_ID Organization Identifier
ABEJA_PLATFORM_USER_ID User Identifier (which starts with user- )
ABEJA_PLATFORM_PERSONAL_ACCESS_TOKEN User’s Personal Access Token

Client Parameter

ABEJA Platform SDK Client accepts credential information when instantiating. It is required to passing parameters in different way between high level interface and low level interface.

High Level Interface

from abeja.datalake import Client

organization_id = '1234567890123'
credential = {
    'user_id': 'user-1234567890123',
    'personal_access_token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
client = Client(organization_id=organization_id, credential=credential)
channel = client.get_channel(channel_id='9999999999999')

Low Level Interface

from abeja.datalake import APIClient

organization_id = '1234567890123'
credential = {
    'user_id': 'user-1234567890123',
    'personal_access_token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
client = APIClient(credential=credential)
channel = client.get_channel(organization_id=organization_id, channel_id='9999999999999')

Priority

There are multiple ways to pass the credentials that are checked in the following order/priority.

  1. credential passed in client object initialization.
  2. PLATFORM_AUTH_TOKEN in environment variables.
  3. ABEJA_PLATFORM_USER_ID and ABEJA_PLATFORM_PERSONAL_ACCESS_TOKEN in environment variables.

Indices and tables