@@ -112,14 +112,14 @@ class _UserCredential(BaseModel):
112112 expiration : datetime
113113 secret_access_key : str = Field (alias = "secretAccessKey" )
114114 session_token : str = Field (alias = "sessionToken" )
115+ endpoint : Optional [str ] = Field (alias = "endpoint" , default = None )
115116 storage_provider : Optional [str ] = Field (alias = "storageProvider" , default = None )
116117
117118
118119class _S3STSToken (BaseModel ):
119120 cloud_path_prefix : str = Field (alias = "cloudpathPrefix" )
120121 cloud_path : str = Field (alias = "cloudpath" )
121122 user_credential : _UserCredential = Field (alias = "userCredentials" )
122- endpoint : Optional [str ] = Field (alias = "endpoint" , default = None )
123123
124124 def get_bucket (self ):
125125 """
@@ -144,8 +144,7 @@ def get_client(self):
144144 """
145145 customize_boto3_config = None
146146 if (
147- self .user_credential is not None
148- and self .user_credential .storage_provider is not None
147+ self .user_credential .storage_provider is not None
149148 and self .user_credential .storage_provider == "OSS"
150149 ):
151150 # OSS does not support aws integrity check
@@ -163,8 +162,8 @@ def get_client(self):
163162 "config" : customize_boto3_config ,
164163 }
165164
166- if self .endpoint is not None :
167- kwargs ["endpoint_url" ] = self .endpoint
165+ if self .user_credential . endpoint is not None :
166+ kwargs ["endpoint_url" ] = self .user_credential . endpoint
168167
169168 if Env .current .s3_endpoint_url is not None :
170169 kwargs ["endpoint_url" ] = Env .current .s3_endpoint_url
0 commit comments