Authenticator
from skipcheck_tm1.auth import Authenticator Supplies the credentials for logging in to TM1: the value of the Authorization
header of a login request.
It's asked once per login, not once per session: a session logs in again when TM1 reports it expired, and credentials that expire themselves (a CAM passport) can be fresh each time. Only the login carries credentials; every other request carries the session cookie.
# TM1's own security
basic = auth.basic("admin", "apple")
# CAM, with a user and password
cam = auth.cam_namespace("alice", "secret", "LDAP")
# CAM, with a passport
passport = auth.cam_passport(passports)
# A passport from Cognos
cognos = auth.cognos_logon("http://cognos:9300", "LDAP", "alice", "secret")
Implementations must not log or otherwise reveal the credentials; describe
is what logs show.
A Tm1SessionPool keeps one session for each set of a user's own credentials,
and tells them apart with __eq__. The authenticators here that hold their
credentials (basic, cam_namespace, cam_passport,
cognos_logon) are equal when the credentials are. One that asks a supplier
(cam_passport, cognos_id_token) is only equal to itself, so
keep it and pass the same one each time; so is your own, unless it defines
__eq__.
Members
authorization | The Authorization header to log in with; called at each login. |
describe | Who logs in, without secrets, for logs and errors. |
authorization
authorization() -> strThe Authorization header to log in with; called at each login. An asyncio session awaits it no longer than its login timeout (Tm1Timeouts.login); a sync session waits until it returns, so give anything it asks a timeout of its own.
describe
describe() -> strWho logs in, without secrets, for logs and errors.