ST转AT Args: st: Session Token Returns: { "access_token": "AT", "expires": "2025-11-15T04:46:04.000Z", "user": {...} }
(self, st: str)
| 1186 | # ========== 认证相关 (使用ST) ========== |
| 1187 | |
| 1188 | async def st_to_at(self, st: str) -> dict: |
| 1189 | """ST转AT |
| 1190 | |
| 1191 | Args: |
| 1192 | st: Session Token |
| 1193 | |
| 1194 | Returns: |
| 1195 | { |
| 1196 | "access_token": "AT", |
| 1197 | "expires": "2025-11-15T04:46:04.000Z", |
| 1198 | "user": {...} |
| 1199 | } |
| 1200 | """ |
| 1201 | url = f"{self.labs_base_url}/auth/session" |
| 1202 | try: |
| 1203 | return await self._make_request( |
| 1204 | method="GET", |
| 1205 | url=url, |
| 1206 | use_st=True, |
| 1207 | st_token=st, |
| 1208 | timeout=self._get_control_plane_timeout(), |
| 1209 | ) |
| 1210 | except Exception as e: |
| 1211 | if not self._is_proxy_connection_error(e): |
| 1212 | raise |
| 1213 | |
| 1214 | debug_logger.log_warning( |
| 1215 | f"[AUTH] ST->AT failed via configured proxy, retrying direct connection: {e}" |
| 1216 | ) |
| 1217 | return await self._make_request( |
| 1218 | method="GET", |
| 1219 | url=url, |
| 1220 | use_st=True, |
| 1221 | st_token=st, |
| 1222 | timeout=self._get_control_plane_timeout(), |
| 1223 | force_no_proxy=True, |
| 1224 | ) |
| 1225 | |
| 1226 | # ========== 项目管理 (使用ST) ========== |
| 1227 |
no test coverage detected