[英]Remote Chrome WebDriver on gcp
I run remote chrome webdriver in GCP Cloud Run.我在 GCP Cloud Run 中运行远程 chrome webdriver。 It works well if I use unathenicated service call and i can connect from my java code to this Chrome Webdriver.
如果我使用 unathenicated 服务调用,它工作得很好,我可以从我的 java 代码连接到这个 Chrome Webdriver。 However, once i enable gcp authentication service-to-service , it stops working.
但是,一旦我启用 gcp authentication service-to-service ,它就会停止工作。 I wasn't able to find a way to provide google token to Selenium Remote Webdriver.
我无法找到向 Selenium 远程 Webdriver 提供 google 令牌的方法。 I understand that I need to extend one of existing Selenium java classes, like RemoteWebDriver or HttpCommandExecutor, but it's not clear which class exactly.
我了解我需要扩展现有的 Selenium java 类之一,例如 RemoteWebDriver 或 HttpCommandExecutor,但尚不清楚究竟是哪个 class。 Please advice.
请指教。
I was trying to modify the RemoteWebDriver object or use the RemoteWebDriverBuilder to add a custom request filter where I add the auth header with a bearer token but no luck.我试图修改 RemoteWebDriver object 或使用 RemoteWebDriverBuilder 添加自定义请求过滤器,在其中添加带有不记名令牌的身份验证 header 但没有运气。
However, I was able to access the selenium/standalone-chrome docker image running as the Cloud Run service from another Cloud Run service via a custom VPC connector, I left the auth option "Allow unauthenticated invocations" but ingress option - "Allow internal traffic only" so my selenium service URL respond with 403 for the whole world but accessible from within the project infrastructure.但是,我能够通过自定义 VPC 连接器从另一个 Cloud Run 服务访问作为 Cloud Run 服务运行的selenium/standalone-chrome docker 映像,我留下了身份验证选项“允许未经身份验证的调用”但入口选项 - “允许内部流量只有” ,所以我的 selenium 服务 URL 响应全世界的 403,但可以从项目基础设施中访问。
One more thing - when you specify the VPC connector for the selenium Cloud Run service - select "Route only requests to private IPs through the VPC connector" since "Route all traffic through the VPC connector" would make not possible for selenium to access the world wide web.还有一件事 - 当您为 selenium Cloud Run 服务指定 VPC 连接器时 - select “仅通过 VPC 连接器将请求路由到私有 IP” ,因为“通过 VPC 连接器路由所有流量”将使 Z8E00596AD8DE22236FFC 无法访问世界宽 web。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.