Tm1Identity
import { Tm1Identity } from "@skipcheck/tm1-client"; 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.
serviceAccount: the pool's own credentials, as they are.impersonating: the pool's credentials, acting as a TM1 user throughTM1-Impersonate.withCredentials: a user's own credentials, such as their CAM passport.
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 Tm1Authenticator for which
authenticators are equal to one another.
Members
serviceAccount static | The pool's own credentials, with no impersonation. |
impersonating static | The pool's credentials, acting as TM1 user user. |
withCredentials static | A user logging in with their own credentials. |
kind | What kind of identity this is. |
name | The user's name, as given; empty for the service account. |
authenticator | The user's own credentials, for OwnCredentials; undefined for the other kinds. |
key | @internal What the pool finds its sessions by. |
applyTo | @internal Applies this identity to session settings copied from the pool's. |
equals | Whether other is the same identity. |
toString | The identity, for logs. |
serviceAccount
staticstatic serviceAccount(): Tm1IdentityThe pool's own credentials, with no impersonation.
impersonating
staticstatic impersonating(user: string): Tm1IdentityThe pool's credentials, acting as TM1 user user. The pool's credentials must be an administrator's or a data administrator's, and administrators can't be impersonated; see Tm1SessionBuilder.impersonate.
Throws
- RangeError if
useris blank or has a control character
withCredentials
staticstatic withCredentials(name: string, authenticator: Tm1Authenticator): Tm1IdentityA user logging in with their own credentials.
Parameters
name- who the credentials belong to, for the pool's key and for logs, such as the user name
authenticator- their credentials. Pass one that is equal each time, or the same object: an authenticator the pool hasn't seen for this name gets a new session
kind
kind(): Tm1Identity.KindWhat kind of identity this is.
name
name(): stringThe user's name, as given; empty for the service account.
authenticator
authenticator(): Tm1Authenticator | undefinedThe user's own credentials, for OwnCredentials; undefined for the other kinds.
key
key(): string@internal What the pool finds its sessions by: the kind and the comparable name. Identities with the same key are the same one only if they're equals: a name may come with different credentials.
applyTo
applyTo(settings: Tm1SessionBuilder): Tm1SessionBuilder@internal Applies this identity to session settings copied from the pool's.
equals
equals(other: unknown): booleanWhether other is the same identity: the same kind and name and, for a user's own credentials, equal credentials (Tm1Authenticator.equals).
toString
toString(): stringThe identity, for logs: its kind and name, never credentials.