From 94897a4e02fc7e18d0505f858f87b5ddfa9caa47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Smoli=C5=84ski?= Date: Tue, 13 Jan 2026 10:25:51 +0100 Subject: [PATCH] Add WebClientPack.Renew method (#62761) --- integration/helpers/web.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/integration/helpers/web.go b/integration/helpers/web.go index d74d05297b8..be9dec2d54b 100644 --- a/integration/helpers/web.go +++ b/integration/helpers/web.go @@ -50,6 +50,19 @@ type WebClientPack struct { clusterName string } +// Renew Creates a copy of WebClient with renewed credentials. +// This can be used to assume a particular web session, like in +// the case of JIT Access Request role assumption. +func (w *WebClientPack) WithNewCredentials(token, cookie string) *WebClientPack { + return &WebClientPack{ + webCookie: cookie, + bearerToken: token, + clt: w.clt, + host: w.host, + clusterName: w.clusterName, + } +} + // LoginWebClient receives the host url, the username and a password. // It will login into that host and return a WebClientPack. func LoginWebClient(t *testing.T, host, username, password string) *WebClientPack {