skipcheck

TM1 client · Docs · Sessions and logins

Tm1Identity

from skipcheck_tm1 import Tm1Identity

Who a session is: the identity a Tm1SessionPool keys its sessions by. In TM1 the identity is fixed when the session logs in, so one identity is one session.

Two identities are equal when they're the same kind and their names match as TM1 matches user names, ignoring case and spaces, so impersonating("Alice") and impersonating("alice") share a session.

For a user's own credentials, the credentials must be equal too. A name is only what the caller says, and it's TM1 that checks credentials, at login: if the name alone found the session, anyone giving a logged-in user's name would get that user's session without TM1 ever seeing what they offered, and a corrected password or a renewed passport would never be used. So different credentials for the same name get a session of their own, and TM1 accepts or refuses them. See Authenticator for which authenticators are equal to one another.

Members

__init__ constructor
service_account staticThe account the session settings log in with.
impersonating staticThe service account, acting as user (TM1-Impersonate).
with_credentials staticA user who logs in with credentials of their own.
kind propertyWhat kind of identity this is.
name propertyThe user's name; empty for the service account.
authenticator propertyThe identity's own credentials, if it has them.
apply_toSession settings for this identity, from the pool's (Java's applyTo).

__init__

constructor
__init__(kind: Tm1Identity.Kind, name: str, authenticator: Authenticator | None)

service_account

static
service_account() -> Tm1Identity

The account the session settings log in with.

impersonating

static
impersonating(user: str) -> Tm1Identity

The service account, acting as user (TM1-Impersonate). Refuses a blank name and one with a control character.

with_credentials

static
with_credentials(name: str, authenticator: Authenticator) -> Tm1Identity

A user who logs in with credentials of their own. name is who they belong to, for the pool's key and for logs. Pass an authenticator that is equal each time, or the same object: one the pool hasn't seen for this name gets a new session.

kind

property
kind: Tm1Identity.Kind

What kind of identity this is.

name

property
name: str

The user's name; empty for the service account.

authenticator

property
authenticator: Authenticator | None

The identity's own credentials, if it has them.

apply_to

apply_to(settings: dict[str, Any]) -> dict[str, Any]

Session settings for this identity, from the pool's (Java's applyTo).