codekingpro/portable-devtools
114k
1import typing as t2 3if t.TYPE_CHECKING:4 from gssapi.raw.named_tuples import AcquireCredResult5 from gssapi.raw.names import Name6 from gssapi.raw.oids import OID7 8 9def acquire_cred_with_password(10 name: "Name",11 password: bytes,12 lifetime: t.Optional[int] = None,13 mechs: t.Optional[t.Iterable["OID"]] = None,14 usage: str = 'initiate',15) -> "AcquireCredResult":16 """Acquire credentials through provided password.17 18 This function is originally from Solaris and is not documented by either19 MIT or Heimdal.20 21 In general, it functions similarly to22 :func:`~gssapi.raw.creds.acquire_cred`.23 24 Args:25 name (~gssapi.raw.names.Name): the name to acquire credentials for26 password (bytes): the password used to acquire credentialss with27 lifetime (int): the lifetime for the credentials in seconds (or None28 for indefinite)29 mechs (~gssapi.raw.types.MechType): the desired mechanisms for which30 the credentials should work (or None for the default set)31 usage (str): usage type for credentials. Possible values:32 'initiate' (default), 'accept', 'both' (failsafe).33 34 Returns:35 AcquireCredResult: the resulting credentials, the actual mechanisms36 with which they may be used, and their actual lifetime in seconds (or37 None for indefinite or not supported)38 39 Raises:40 ~gssapi.exceptions.GSSError41 """42 