-
Notifications
You must be signed in to change notification settings - Fork 10
/
__init__.py
64 lines (55 loc) · 1.44 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
import json
import logging
import logging.config
import os
from spnego._context import (
ContextProxy,
ContextReq,
IOVUnwrapResult,
IOVWrapResult,
UnwrapResult,
WinRMWrapResult,
WrapResult,
)
from spnego._credential import (
Credential,
CredentialCache,
KerberosCCache,
KerberosKeytab,
NTLMHash,
Password,
)
from spnego.auth import client, server
from spnego.exceptions import NegotiateOptions
__all__ = [
"ContextProxy",
"ContextReq",
"Credential",
"CredentialCache",
"IOVUnwrapResult",
"IOVWrapResult",
"KerberosCCache",
"KerberosKeytab",
"NTLMHash",
"Password",
"NegotiateOptions",
"UnwrapResult",
"WinRMWrapResult",
"WrapResult",
"client",
"server",
]
def _setup_logging(logger: logging.Logger) -> None:
log_path = os.environ.get("PYSPNEGO_LOG_CFG", None)
if log_path is not None and os.path.exists(log_path): # pragma: no cover
# log log config from JSON file
with open(log_path, "rt") as f:
config = json.load(f)
logging.config.dictConfig(config)
else:
# no logging was provided
logger.addHandler(logging.NullHandler())
logger = logging.getLogger(__name__)
_setup_logging(logger)