fix(gcp): test connection by verifying token (#7882)

This commit is contained in:
Sergio Garcia
2025-05-29 13:20:53 +02:00
committed by GitHub
parent 5d043cc929
commit a89e3598f2
+3 -3
View File
@@ -515,9 +515,9 @@ class GcpProvider(Provider):
credentials=session,
)
# Test the connection using the Service Usage API since it is enabled by default
client = discovery.build("serviceusage", "v1", credentials=session)
request = client.services().list(parent=f"projects/{project_id}")
# Test the connection using OAuth2 API to verify token validity
client = discovery.build("oauth2", "v2", credentials=session)
request = client.tokeninfo()
request.execute()
return Connection(is_connected=True)