File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
1111 "net/http/cookiejar"
1212 "net/url"
1313 "strconv"
14+ "strings"
1415 "time"
1516
1617 "github.com/SAP/jenkins-library/pkg/abaputils"
@@ -72,6 +73,16 @@ func (conn *Connector) GetToken(appendum string) error {
7273 defer response .Body .Close ()
7374 token := response .Header .Get ("X-CSRF-Token" )
7475 conn .Header ["X-CSRF-Token" ] = []string {token }
76+ log .RegisterSecret (token )
77+
78+ for _ , cookie := range response .Header .Values ("Set-Cookie" ) {
79+ if strings .HasPrefix (cookie , "SAP_SESSIONID_" ) {
80+ // SAP_SESSIONID_SID_123=YiWizhmMljBNOkKxJkG-flmT9wWfetHwifb6Fj5zqUI%3d; path=/; secure; HttpOnly
81+ id := cookie [strings .Index (cookie , "=" )+ 1 : strings .Index (cookie , "; " )]
82+ log .RegisterSecret (id )
83+ }
84+ }
85+
7586 return nil
7687}
7788
You can’t perform that action at this time.
0 commit comments