beamlit 0.0.60rc127__py3-none-any.whl → 0.0.60rc128__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.
@@ -96,52 +96,7 @@ class ClientCredentials(Auth):
96
96
  Raises:
97
97
  Exception: If token refresh fails.
98
98
  """
99
- err = self.do_refresh()
100
- if err:
101
- return err
102
-
99
+ self.get_token()
103
100
  request.headers["X-Beamlit-Authorization"] = f"Bearer {self.credentials.access_token}"
104
101
  request.headers["X-Beamlit-Workspace"] = self.workspace_name
105
- yield request
106
-
107
- def do_refresh(self) -> Optional[Exception]:
108
- """
109
- Performs the token refresh using the refresh token.
110
-
111
- Returns:
112
- Optional[Exception]: An exception if refreshing fails, otherwise None.
113
- """
114
- if not self.credentials.refresh_token:
115
- return Exception("No refresh token to refresh")
116
-
117
- url = f"{self.base_url}/oauth/token"
118
- refresh_data = {
119
- "grant_type": "refresh_token",
120
- "refresh_token": self.credentials.refresh_token,
121
- "device_code": self.credentials.device_code,
122
- "client_id": "beamlit",
123
- }
124
-
125
- try:
126
- response = post(url, json=refresh_data, headers={"Content-Type": "application/json"})
127
- response.raise_for_status()
128
- finalize_response = DeviceLoginFinalizeResponse(**response.json())
129
-
130
- if not finalize_response.refresh_token:
131
- finalize_response.refresh_token = self.credentials.refresh_token
132
-
133
- from .credentials import Credentials, save_credentials
134
-
135
- creds = Credentials(
136
- access_token=finalize_response.access_token,
137
- refresh_token=finalize_response.refresh_token,
138
- expires_in=finalize_response.expires_in,
139
- device_code=self.credentials.device_code,
140
- )
141
-
142
- self.credentials = creds
143
- save_credentials(self.workspace_name, creds)
144
- return None
145
-
146
- except Exception as e:
147
- return Exception(f"Failed to refresh token: {str(e)}")
102
+ yield request
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beamlit
3
- Version: 0.0.60rc127
3
+ Version: 0.0.60rc128
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  License-File: LICENSE
@@ -115,7 +115,7 @@ beamlit/api/workspaces/update_workspace_user_role.py,sha256=Yn9iuJ4tKtauzBiJyU4-
115
115
  beamlit/authentication/__init__.py,sha256=wiXqRbc7E-ulrH_ueA9duOGFvXeo7-RvhSD1XbFogMo,1020
116
116
  beamlit/authentication/apikey.py,sha256=Q3Kz4Zbc_Lr6lYwiwiLo6AhggKcdqsd6xJjDi-nERiI,1557
117
117
  beamlit/authentication/authentication.py,sha256=OgqS6YciBnh0MomeEaL2YuZt1fHPOfQUkRhsIu6tcvk,5812
118
- beamlit/authentication/clientcredentials.py,sha256=oKopOql7nugarWwcuJ_2mGaPODuIsixnxyX2I-yRTGM,5191
118
+ beamlit/authentication/clientcredentials.py,sha256=4D918PA8hZWr3_KiT5iEcF8d7E3kKNDb0UVx3S2iTe0,3585
119
119
  beamlit/authentication/credentials.py,sha256=YNMCRpNa2Cs7lN647Sz4-8LxfZtJPhSyyxCVwNzTAxo,8741
120
120
  beamlit/authentication/device_mode.py,sha256=gBJqJpWQXEG8gZbWXhlvQyk8FfHH95-aqURUnudil-4,6526
121
121
  beamlit/common/__init__.py,sha256=saX5X3hRCJ9erSlXuSkZ2VGgquvpgdcofAU_9sM4bCE,354
@@ -254,8 +254,8 @@ beamlit/serve/app.py,sha256=5XZci-R95Zjl97wMtQd1BRtonnkJJ2AeoTVFPKGAOfA,4283
254
254
  beamlit/serve/middlewares/__init__.py,sha256=O7fyfE1DIYmajFY9WWdzxCgeAQWZzJfeUjzHGbpWaAk,309
255
255
  beamlit/serve/middlewares/accesslog.py,sha256=lcu33j4epFSHRBaeTpyt8deNb3kaM3K91-andw4fp80,1112
256
256
  beamlit/serve/middlewares/processtime.py,sha256=3x5w1yQexB0xFNKK6fgLbINxT-eLLunfZ6UDV0bIIF4,944
257
- beamlit-0.0.60rc127.dist-info/METADATA,sha256=zT-Xhd9-_zH7b673L_W6n2mzTwYJBiAr1KV8AWGeLno,3547
258
- beamlit-0.0.60rc127.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
259
- beamlit-0.0.60rc127.dist-info/entry_points.txt,sha256=zxhgdn7SP-Otk4rEv7LMPAAa9w4TUCLbu9TJi9-K3xg,115
260
- beamlit-0.0.60rc127.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
261
- beamlit-0.0.60rc127.dist-info/RECORD,,
257
+ beamlit-0.0.60rc128.dist-info/METADATA,sha256=B3MFxSnd094ye9cY7XsjIi7NU_k-jrm9fwgRYPPGL7E,3547
258
+ beamlit-0.0.60rc128.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
259
+ beamlit-0.0.60rc128.dist-info/entry_points.txt,sha256=zxhgdn7SP-Otk4rEv7LMPAAa9w4TUCLbu9TJi9-K3xg,115
260
+ beamlit-0.0.60rc128.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
261
+ beamlit-0.0.60rc128.dist-info/RECORD,,