mirror of
https://github.com/gravitational/teleport.git
synced 2026-09-24 16:17:11 +08:00
Add WebClientPack.Renew method (#62761)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user