-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path__init__.py
50 lines (39 loc) · 1.34 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
# -*- coding: utf-8 -*-
import os
from os import environ
from yoti_python_sdk.client import Client
DEFAULTS = {
"YOTI_API_URL": "https://api.yoti.com",
"YOTI_API_PORT": 443,
"YOTI_API_VERSION": "v1",
"YOTI_API_VERIFY_SSL": "true",
}
main_ns = {}
directory_name = os.path.dirname(__file__)
version_path = os.path.join(directory_name, "version.py")
ver_path = os.path.normcase(version_path)
with open(ver_path) as ver_file:
exec(ver_file.read(), main_ns)
__version__ = main_ns["__version__"]
YOTI_API_URL = environ.get("YOTI_API_URL", DEFAULTS["YOTI_API_URL"])
YOTI_PROFILE_ENDPOINT = "/api/v1"
YOTI_DOC_SCAN_ENDPOINT = "/idverify/v1"
YOTI_API_PORT = environ.get("YOTI_API_PORT", DEFAULTS["YOTI_API_PORT"])
YOTI_API_VERSION = environ.get("YOTI_API_VERSION", DEFAULTS["YOTI_API_VERSION"])
# Fully formatted API URLs
YOTI_API_ENDPOINT = environ.get(
"YOTI_API_ENDPOINT",
"{0}:{1}{2}".format(YOTI_API_URL, YOTI_API_PORT, YOTI_PROFILE_ENDPOINT),
)
YOTI_DOC_SCAN_API_URL = environ.get(
"YOTI_DOC_SCAN_API_URL",
"{0}:{1}{2}".format(YOTI_API_URL, YOTI_API_PORT, YOTI_DOC_SCAN_ENDPOINT),
)
YOTI_API_VERIFY_SSL = environ.get(
"YOTI_API_VERIFY_SSL", DEFAULTS["YOTI_API_VERIFY_SSL"]
)
if YOTI_API_VERIFY_SSL.lower() == "false":
YOTI_API_VERIFY_SSL = False
else:
YOTI_API_VERIFY_SSL = True
__all__ = ["Client", __version__]