reasoning-deployment-service 0.5.5__py3-none-any.whl → 0.5.6__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 reasoning-deployment-service might be problematic. Click here for more details.
- reasoning_deployment_service/reasoning_deployment_service.py +25 -23
- {reasoning_deployment_service-0.5.5.dist-info → reasoning_deployment_service-0.5.6.dist-info}/METADATA +1 -1
- {reasoning_deployment_service-0.5.5.dist-info → reasoning_deployment_service-0.5.6.dist-info}/RECORD +6 -6
- {reasoning_deployment_service-0.5.5.dist-info → reasoning_deployment_service-0.5.6.dist-info}/WHEEL +0 -0
- {reasoning_deployment_service-0.5.5.dist-info → reasoning_deployment_service-0.5.6.dist-info}/entry_points.txt +0 -0
- {reasoning_deployment_service-0.5.5.dist-info → reasoning_deployment_service-0.5.6.dist-info}/top_level.txt +0 -0
|
@@ -815,6 +815,30 @@ class ReasoningEngineDeploymentService:
|
|
|
815
815
|
def one_githhub_deployment_to_go_with_skip(self):
|
|
816
816
|
return self.one_github_deployment_to_go(skip_engine=True)
|
|
817
817
|
|
|
818
|
+
def update_authorization_scopes(self, auth_id: str, scopes: list, oauth_client_id: str) -> dict:
|
|
819
|
+
"""Patch the scopes for a specific authorization by ID, updating the authorizationUri as well."""
|
|
820
|
+
scopes_str = " ".join(scopes)
|
|
821
|
+
authorization_uri = (
|
|
822
|
+
"https://accounts.google.com/o/oauth2/auth"
|
|
823
|
+
"?response_type=code"
|
|
824
|
+
f"&client_id={oauth_client_id}"
|
|
825
|
+
f"&scope={scopes_str}"
|
|
826
|
+
"&access_type=offline&prompt=consent"
|
|
827
|
+
)
|
|
828
|
+
payload = {
|
|
829
|
+
"serverSideOauth2": {
|
|
830
|
+
"authorizationUri": authorization_uri
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
url = f"{DISCOVERY_ENGINE_URL}/projects/{self._project_id}/locations/global/authorizations/{auth_id}?update_mask=server_side_oauth2.authorization_uri"
|
|
834
|
+
headers = {
|
|
835
|
+
"Authorization": f"Bearer {self._access_token()}",
|
|
836
|
+
"Content-Type": "application/json",
|
|
837
|
+
"X-Goog-User-Project": self.project_id,
|
|
838
|
+
}
|
|
839
|
+
r = self._http.patch(url, headers=headers, json=payload, timeout=60)
|
|
840
|
+
r.raise_for_status()
|
|
841
|
+
return r.json()
|
|
818
842
|
|
|
819
843
|
def one_github_deployment_to_go(self, skip_engine=False):
|
|
820
844
|
"""
|
|
@@ -918,29 +942,7 @@ class ReasoningEngineDeploymentService:
|
|
|
918
942
|
|
|
919
943
|
if existing_scopes != want_scopes:
|
|
920
944
|
self.info("[AUTH] Scopes changed. Patching authorization...")
|
|
921
|
-
|
|
922
|
-
patch_payload = {
|
|
923
|
-
"serverSideOauth2": {
|
|
924
|
-
"clientId": self._oauth_client_id,
|
|
925
|
-
"clientSecret": "***" if self._oauth_client_secret else None,
|
|
926
|
-
"authorizationUri": new_auth_uri,
|
|
927
|
-
"tokenUri": "https://oauth2.googleapis.com/token",
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
if patch_payload["serverSideOauth2"]["clientSecret"] is None:
|
|
931
|
-
patch_payload["serverSideOauth2"].pop("clientSecret", None)
|
|
932
|
-
|
|
933
|
-
hdrs2 = self._get_headers().copy()
|
|
934
|
-
if "Authorization" in hdrs2:
|
|
935
|
-
hdrs2["Authorization"] = "Bearer ***"
|
|
936
|
-
self.info(f"[AUTH] PATCH {auth_url} headers={json.dumps(hdrs2)} payload={json.dumps(patch_payload, indent=2)}")
|
|
937
|
-
pr = self._http.patch(auth_url, headers=self._get_headers(), json=patch_payload, timeout=60)
|
|
938
|
-
self.info(f"[AUTH] PATCH status={pr.status_code} ct={pr.headers.get('content-type','')}")
|
|
939
|
-
try:
|
|
940
|
-
self.info(f"[AUTH] PATCH body={json.dumps(pr.json(), indent=2)[:4000]}")
|
|
941
|
-
except Exception:
|
|
942
|
-
self.info(f"[AUTH] PATCH text={(pr.text or '')[:1000]}")
|
|
943
|
-
pr.raise_for_status()
|
|
945
|
+
self.update_authorization_scopes(self._authorization_id, list(want_scopes), self._oauth_client_id)
|
|
944
946
|
self.info("[AUTH] Authorization updated.")
|
|
945
947
|
else:
|
|
946
948
|
self.info("[AUTH] Scopes unchanged; no update needed.")
|
{reasoning_deployment_service-0.5.5.dist-info → reasoning_deployment_service-0.5.6.dist-info}/RECORD
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
reasoning_deployment_service/__init__.py,sha256=xDuKt9gGviQiTV6vXBdkBvygnlAOIrwnUjVaMGZy0L4,670
|
|
2
|
-
reasoning_deployment_service/reasoning_deployment_service.py,sha256=
|
|
2
|
+
reasoning_deployment_service/reasoning_deployment_service.py,sha256=KGng1H9pXMsBSWsnz3JvIVnQLHADD2YbwgWLeLzldhM,43104
|
|
3
3
|
reasoning_deployment_service/runner.py,sha256=qWN0t66lQ1G4ht48gIHSF2JvedcheHRu8PmUz5TaKTI,5619
|
|
4
4
|
reasoning_deployment_service/cli_editor/__init__.py,sha256=bN8NPkw8riB92pj2lAwJZuEMOQIO_RRuge0ehnJTW1I,118
|
|
5
5
|
reasoning_deployment_service/cli_editor/api_client.py,sha256=Kzx5iYp0MmowggrSmPLE7I2kt1-8xvdGBAgde9a1gCY,33681
|
|
@@ -22,8 +22,8 @@ reasoning_deployment_service/gui_editor/src/ui/authorization_view.py,sha256=BoNc
|
|
|
22
22
|
reasoning_deployment_service/gui_editor/src/ui/reasoning_engine_view.py,sha256=tCvSPEf4dW0NRdAqfs3yT5Pa873gYeLzCMMIt2r2T4o,14644
|
|
23
23
|
reasoning_deployment_service/gui_editor/src/ui/reasoning_engines_view.py,sha256=IRjFlBbY98usAZa0roOonjvWQOsF6NBW4bBg_k8KnKI,7860
|
|
24
24
|
reasoning_deployment_service/gui_editor/src/ui/ui_components.py,sha256=HdQHy-oSZ3GobQ3FNdH7y_w3ANbFiuf2rMoflAmff0A,55366
|
|
25
|
-
reasoning_deployment_service-0.5.
|
|
26
|
-
reasoning_deployment_service-0.5.
|
|
27
|
-
reasoning_deployment_service-0.5.
|
|
28
|
-
reasoning_deployment_service-0.5.
|
|
29
|
-
reasoning_deployment_service-0.5.
|
|
25
|
+
reasoning_deployment_service-0.5.6.dist-info/METADATA,sha256=wAp6aT6gwNUHL-JPZ4xPz3RA9wzFBRbOtqRK6qQENOM,5302
|
|
26
|
+
reasoning_deployment_service-0.5.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
reasoning_deployment_service-0.5.6.dist-info/entry_points.txt,sha256=onGKjR5ONTtRv3aqEtK863iw9Ty1kLcjfZlsplkRZrA,84
|
|
28
|
+
reasoning_deployment_service-0.5.6.dist-info/top_level.txt,sha256=GKuQS1xHUYLZbatw9DmcYdBxxLhWhhGkV4FmFxgKdp0,29
|
|
29
|
+
reasoning_deployment_service-0.5.6.dist-info/RECORD,,
|
{reasoning_deployment_service-0.5.5.dist-info → reasoning_deployment_service-0.5.6.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|