superb-ai-onprem 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of superb-ai-onprem might be problematic. Click here for more details.
- spb_onprem/_version.py +2 -2
- spb_onprem/slices/params/slices.py +1 -1
- spb_onprem/users/entities/auth.py +42 -40
- {superb_ai_onprem-0.1.1.dist-info → superb_ai_onprem-0.1.3.dist-info}/METADATA +1 -1
- {superb_ai_onprem-0.1.1.dist-info → superb_ai_onprem-0.1.3.dist-info}/RECORD +8 -8
- {superb_ai_onprem-0.1.1.dist-info → superb_ai_onprem-0.1.3.dist-info}/WHEEL +0 -0
- {superb_ai_onprem-0.1.1.dist-info → superb_ai_onprem-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {superb_ai_onprem-0.1.1.dist-info → superb_ai_onprem-0.1.3.dist-info}/top_level.txt +0 -0
spb_onprem/_version.py
CHANGED
|
@@ -54,7 +54,7 @@ def slices_params(
|
|
|
54
54
|
"cursor": cursor,
|
|
55
55
|
"length": length,
|
|
56
56
|
}
|
|
57
|
-
if slices_filter is not Undefined:
|
|
57
|
+
if slices_filter is not Undefined and slices_filter is not None:
|
|
58
58
|
params["filter"] = slices_filter.model_dump(
|
|
59
59
|
by_alias=True, exclude_unset=True
|
|
60
60
|
)
|
|
@@ -22,49 +22,51 @@ class AuthUser(CustomBaseModel):
|
|
|
22
22
|
config_file: str = "~/.spb/onprem-config"
|
|
23
23
|
) -> "AuthUser":
|
|
24
24
|
if cls._instance is None:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if os.environ.get("SUNRISE_SERVER_URL"):
|
|
30
|
-
system_sdk_host = os.environ.get("SUNRISE_SERVER_URL")
|
|
31
|
-
else:
|
|
32
|
-
system_sdk_host = os.environ.get("SUPERB_SYSTEM_SDK_HOST")
|
|
33
|
-
|
|
34
|
-
# Skip reading config file when SUPERB_SYSTEM_SDK is true
|
|
35
|
-
cls._instance = cls(
|
|
36
|
-
host=system_sdk_host,
|
|
37
|
-
access_key="",
|
|
38
|
-
access_key_secret="",
|
|
39
|
-
is_system_sdk=True,
|
|
40
|
-
system_sdk_user_email=os.environ.get("SUPERB_SYSTEM_SDK_USER_EMAIL", "")
|
|
41
|
-
)
|
|
25
|
+
config_file_path = os.path.expanduser(config_file)
|
|
26
|
+
|
|
27
|
+
if not os.path.exists(config_file_path):
|
|
28
|
+
cls._instance = cls._create_system_sdk_instance()
|
|
42
29
|
else:
|
|
43
|
-
|
|
44
|
-
config = configparser.ConfigParser()
|
|
45
|
-
try:
|
|
46
|
-
if not config.read(config_file_path):
|
|
47
|
-
raise SDKConfigError(f"Failed to read config file: {config_file_path}")
|
|
48
|
-
|
|
49
|
-
if "default" not in config:
|
|
50
|
-
raise SDKConfigError(f"Missing 'default' section in config file: {config_file_path}")
|
|
51
|
-
|
|
52
|
-
required_keys = ["host", "access_key", "access_key_secret"]
|
|
53
|
-
for key in required_keys:
|
|
54
|
-
if key not in config["default"]:
|
|
55
|
-
raise SDKConfigError(f"Missing required key '{key}' in config file: {config_file_path}")
|
|
56
|
-
|
|
57
|
-
cls._instance = cls(
|
|
58
|
-
host=config["default"]["host"],
|
|
59
|
-
access_key=config["default"]["access_key"],
|
|
60
|
-
access_key_secret=config["default"]["access_key_secret"],
|
|
61
|
-
is_system_sdk=False,
|
|
62
|
-
system_sdk_user_email=None # Not required in normal mode
|
|
63
|
-
)
|
|
64
|
-
except configparser.Error as e:
|
|
65
|
-
raise SDKConfigError(f"Error parsing config file: {str(e)}") from e
|
|
30
|
+
cls._instance = cls._create_config_instance(config_file_path)
|
|
66
31
|
return cls._instance
|
|
67
32
|
|
|
33
|
+
@classmethod
|
|
34
|
+
def _create_system_sdk_instance(cls) -> "AuthUser":
|
|
35
|
+
system_sdk_host = os.environ.get("SUNRISE_SERVER_URL") or os.environ.get("SUPERB_SYSTEM_SDK_HOST") or "http://app-api:8080"
|
|
36
|
+
|
|
37
|
+
return cls(
|
|
38
|
+
host=system_sdk_host,
|
|
39
|
+
access_key="",
|
|
40
|
+
access_key_secret="",
|
|
41
|
+
is_system_sdk=True,
|
|
42
|
+
system_sdk_user_email=os.environ.get("SUPERB_SYSTEM_SDK_USER_EMAIL", "system@superb-ai.com")
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def _create_config_instance(cls, config_file_path: str) -> "AuthUser":
|
|
47
|
+
config = configparser.ConfigParser()
|
|
48
|
+
try:
|
|
49
|
+
if not config.read(config_file_path):
|
|
50
|
+
raise SDKConfigError(f"Failed to read config file: {config_file_path}")
|
|
51
|
+
|
|
52
|
+
if "default" not in config:
|
|
53
|
+
raise SDKConfigError(f"Missing 'default' section in config file: {config_file_path}")
|
|
54
|
+
|
|
55
|
+
required_keys = ["host", "access_key", "access_key_secret"]
|
|
56
|
+
for key in required_keys:
|
|
57
|
+
if key not in config["default"]:
|
|
58
|
+
raise SDKConfigError(f"Missing required key '{key}' in config file: {config_file_path}")
|
|
59
|
+
|
|
60
|
+
return cls(
|
|
61
|
+
host=config["default"]["host"],
|
|
62
|
+
access_key=config["default"]["access_key"],
|
|
63
|
+
access_key_secret=config["default"]["access_key_secret"],
|
|
64
|
+
is_system_sdk=False,
|
|
65
|
+
system_sdk_user_email=None
|
|
66
|
+
)
|
|
67
|
+
except configparser.Error as e:
|
|
68
|
+
raise SDKConfigError(f"Error parsing config file: {str(e)}") from e
|
|
69
|
+
|
|
68
70
|
@property
|
|
69
71
|
def access_token(self):
|
|
70
72
|
if self._access_token:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
spb_onprem/__init__.py,sha256=D9PTLlvRk_aB9DWXMfGrb06dmy5wPYTrxKmNjyfWq1w,1225
|
|
2
|
-
spb_onprem/_version.py,sha256=
|
|
2
|
+
spb_onprem/_version.py,sha256=NIzzV8ZM0W-CSLuEs1weG4zPrn_-8yr1AwwI1iuS6yo,511
|
|
3
3
|
spb_onprem/base_model.py,sha256=f2l5lgu7NYGOpVbE4_gAhMq1jBBRhaLwPf4fwJVrOHM,124
|
|
4
4
|
spb_onprem/base_service.py,sha256=zaZ1rOhSAzi0bNc-y-WpUUYpM_cQl3hLFXpbmmCg73k,5607
|
|
5
5
|
spb_onprem/base_types.py,sha256=5HO6uy6qf08b4KSElwIaGy7UkoQG2KqVO6gcHbsqqSo,269
|
|
@@ -62,13 +62,13 @@ spb_onprem/slices/params/__init__.py,sha256=dEUDlOK-iw3Sx7gpkDMnwMqTFE16-856ZdbY
|
|
|
62
62
|
spb_onprem/slices/params/create_slice.py,sha256=qUpX60A72Uht0SzN7b2-QSKvd_MSEV5T9kYIVk_td8A,1009
|
|
63
63
|
spb_onprem/slices/params/delete_slice.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
64
|
spb_onprem/slices/params/slice.py,sha256=R8U_RadZLWPeQu6ZWGIvXH6Dxi4ikzoHyDKWGewmUjw,1035
|
|
65
|
-
spb_onprem/slices/params/slices.py,sha256=
|
|
65
|
+
spb_onprem/slices/params/slices.py,sha256=leJ6_VmUa5UCyKwspWh1iybeuu5TX4qdgOAVEMUjn0Y,1923
|
|
66
66
|
spb_onprem/slices/params/update_slice.py,sha256=kryOmCnRTQ_OU0qDKgugppLrpeUpuLwmn_87M5zKqIA,1209
|
|
67
67
|
spb_onprem/users/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
68
|
spb_onprem/users/entities/__init__.py,sha256=X8HZsCTlQnuPszok3AwI-i7bsQi0Ehul5L_2jZaol5E,57
|
|
69
|
-
spb_onprem/users/entities/auth.py,sha256=
|
|
70
|
-
superb_ai_onprem-0.1.
|
|
71
|
-
superb_ai_onprem-0.1.
|
|
72
|
-
superb_ai_onprem-0.1.
|
|
73
|
-
superb_ai_onprem-0.1.
|
|
74
|
-
superb_ai_onprem-0.1.
|
|
69
|
+
spb_onprem/users/entities/auth.py,sha256=_KP-7yUErBxhJMm-dE3ObprPEG6e0JI2qNg6g8aK1qM,3371
|
|
70
|
+
superb_ai_onprem-0.1.3.dist-info/licenses/LICENSE,sha256=CdinbFiHKGkGl6cPde6WgXhMuzyUXEG6tzy2-7udZ8o,1066
|
|
71
|
+
superb_ai_onprem-0.1.3.dist-info/METADATA,sha256=tAzoNRqF4pihZDdd0NCvNAGXoewdKjnJ9H0wuquG7fc,5817
|
|
72
|
+
superb_ai_onprem-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
73
|
+
superb_ai_onprem-0.1.3.dist-info/top_level.txt,sha256=AZIJi8aIRJ8vxBL6vvODXVPadF4oetwn0ji2NiAndpM,11
|
|
74
|
+
superb_ai_onprem-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|