skyplatform-iam 1.2.4__py3-none-any.whl → 1.2.5__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.
@@ -17,7 +17,7 @@ from .exceptions import (
17
17
  NetworkError
18
18
  )
19
19
 
20
- __version__ = "1.2.4"
20
+ __version__ = "1.2.5"
21
21
  __author__ = "x9"
22
22
  __description__ = "SkyPlatform IAM认证SDK,提供FastAPI中间件和IAM服务连接功能"
23
23
 
@@ -814,6 +814,51 @@ class ConnectAgenterraIam(object):
814
814
  self.logger.error(f"[{method_name}] 异常堆栈: {traceback.format_exc()}")
815
815
  return False
816
816
 
817
+ def get_credential_ids(self, cred_type, cred_value):
818
+ """
819
+ 机机接口:通过凭证获取cred_id和user_id
820
+ """
821
+ method_name = "get_credential_ids"
822
+ self.logger.info(
823
+ f"[{method_name}] 开始获取凭证ID和用户ID - cred_type: {cred_type}, cred_value: {self._mask_sensitive(cred_value)}")
824
+
825
+ try:
826
+ if isinstance(cred_type, str):
827
+ cred_type = CredentialTypeEnum(cred_type)
828
+
829
+ body = {
830
+ "server_name": self.server_name,
831
+ "access_key": self.access_key,
832
+ "cred_type": cred_type.value,
833
+ "cred_value": cred_value
834
+ }
835
+
836
+ uri = "/api/v2/service/get_credential_ids"
837
+ url = self.agenterra_iam_host + uri
838
+
839
+ self._log_request(method_name, url, self.headers, body)
840
+
841
+ response = requests.post(
842
+ url=url,
843
+ headers=self.headers,
844
+ json=body,
845
+ verify=False
846
+ )
847
+
848
+ self._log_response(method_name, response)
849
+
850
+ if response.status_code == 200:
851
+ self.logger.info(f"[{method_name}] 获取凭证ID和用户ID成功")
852
+ return response
853
+ else:
854
+ self.logger.warning(f"[{method_name}] 获取凭证ID和用户ID失败 - 状态码: {response.status_code}")
855
+
856
+ return False
857
+ except Exception as e:
858
+ self.logger.error(f"[{method_name}] 获取凭证ID和用户ID请求异常: {str(e)}")
859
+ self.logger.error(f"[{method_name}] 异常堆栈: {traceback.format_exc()}")
860
+ return False
861
+
817
862
  def add_custom_config(self, user_id, config_name, config_value=None):
818
863
  """
819
864
  机机接口:添加用户自定义配置
@@ -1105,4 +1150,4 @@ class ConnectAgenterraIam(object):
1105
1150
  except Exception as e:
1106
1151
  self.logger.error(f"[{method_name}] 获取用户信息请求异常: {str(e)}")
1107
1152
  self.logger.error(f"[{method_name}] 异常堆栈: {traceback.format_exc()}")
1108
- return False
1153
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skyplatform-iam
3
- Version: 1.2.4
3
+ Version: 1.2.5
4
4
  Summary: SkyPlatform IAM认证SDK,提供FastAPI中间件和认证路由
5
5
  Project-URL: Homepage, https://github.com/xinmayoujiang12621/agenterra_iam
6
6
  Project-URL: Documentation, https://skyplatform-iam.readthedocs.io/
@@ -0,0 +1,8 @@
1
+ skyplatform_iam/__init__.py,sha256=AB9MM12WKhrwWvIOFVF_36yuQLjXnUnfZfSSb5IIW-E,5591
2
+ skyplatform_iam/config.py,sha256=x3GBikMkC8-0og0Vhs6h5_nTcBXeEd8euDgVDd7IsK4,4607
3
+ skyplatform_iam/connect_agenterra_iam.py,sha256=8zq08dyymESQnekOFmnTxVChgfaQ4FVYopoT3OvWRKs,44033
4
+ skyplatform_iam/exceptions.py,sha256=Rt55QIzVK1F_kn6yzKQKKakD6PZDFdPLCGaCphKKms8,2166
5
+ skyplatform_iam/middleware.py,sha256=iTrog2D6PgLE4LVnNr2h6s39bX7ybnG5BnAWaQpqI0Y,17927
6
+ skyplatform_iam-1.2.5.dist-info/METADATA,sha256=w-we72btfIOOg2dQLPQ1cbmzZfGNqYLOx20iOUV8zwE,12687
7
+ skyplatform_iam-1.2.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8
+ skyplatform_iam-1.2.5.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- skyplatform_iam/__init__.py,sha256=XwFr1dn6ywlk5ayELT1fnoXOMmGkG7ZxQsoTu0c-JwA,5591
2
- skyplatform_iam/config.py,sha256=x3GBikMkC8-0og0Vhs6h5_nTcBXeEd8euDgVDd7IsK4,4607
3
- skyplatform_iam/connect_agenterra_iam.py,sha256=qbtzxdwbHBQM6LSiD7HqC-AK7FOpic-SMVjX4VpHkeU,42332
4
- skyplatform_iam/exceptions.py,sha256=Rt55QIzVK1F_kn6yzKQKKakD6PZDFdPLCGaCphKKms8,2166
5
- skyplatform_iam/middleware.py,sha256=iTrog2D6PgLE4LVnNr2h6s39bX7ybnG5BnAWaQpqI0Y,17927
6
- skyplatform_iam-1.2.4.dist-info/METADATA,sha256=PKoPzhhIbBBfFYsmme79wado1zTpOlroTGwbibQrkMA,12687
7
- skyplatform_iam-1.2.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8
- skyplatform_iam-1.2.4.dist-info/RECORD,,