Skip to content

Commit

Permalink
fix: SOAP vcSessionCookie value must be from vim25.Client
Browse files Browse the repository at this point in the history
Commit 1918984 refactored how we set vcSessionCookie for pbm and vslm endpoints.
We need to use the value of vim25.Client's vmware_soap_session for vSessionCookie.
Since the first response from pbm/vslm includes a 'Set-Cookie: vmware_soap_session=...',
the value of which is _not_ valid for vcSessionCookie.

Signed-off-by: Doug MacEachern <dougm@broadcom.com>
  • Loading branch information
dougm committed Dec 16, 2024
1 parent 4976002 commit 8adeb8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pbm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Client struct {

func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) {
sc := c.Client.NewServiceClient(Path, Namespace)
sc.Cookie = sc.SessionCookie // vcSessionCookie soap.Header
sc.Cookie = c.SessionCookie // vcSessionCookie soap.Header, value must be from vim25.Client

req := types.PbmRetrieveServiceContent{
This: ServiceInstance,
Expand Down
2 changes: 1 addition & 1 deletion vslm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Client struct {

func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) {
sc := c.Client.NewServiceClient(Path, Namespace)
sc.Cookie = sc.SessionCookie // vcSessionCookie soap.Header
sc.Cookie = c.SessionCookie // vcSessionCookie soap.Header, value must be from vim25.Client

req := types.RetrieveContent{
This: ServiceInstance,
Expand Down

0 comments on commit 8adeb8b

Please sign in to comment.