From 06768a6bf1e50c9d9d09694de88546fa97331759 Mon Sep 17 00:00:00 2001 From: Christian Franco Date: Wed, 2 Oct 2024 02:19:49 -0700 Subject: [PATCH] feature(connector): extend authconfig with ibapauth --- connector.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/connector.go b/connector.go index 110d116f..35b42401 100644 --- a/connector.go +++ b/connector.go @@ -22,6 +22,7 @@ import ( type AuthConfig struct { Username string Password string + Ibapauth string ClientCert []byte ClientKey []byte @@ -356,8 +357,15 @@ func (wrb *WapiRequestBuilder) BuildRequest(t RequestType, obj IBObject, ref str return } req.Header.Set("Content-Type", "application/json") + + if wrb.authCfg.Ibapauth != "" { + req.AddCookie(&http.Cookie{Name: "ibapauth", Value: wrb.authCfg.Ibapauth}) + return + } + if wrb.authCfg.Username != "" { req.SetBasicAuth(wrb.authCfg.Username, wrb.authCfg.Password) + return } return