@vcd/sdk 15.0.6 → 15.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -491,6 +491,9 @@ class RequestHeadersInterceptor {
491
491
  set actAs(_actAs) {
492
492
  this._actAs = _actAs;
493
493
  }
494
+ set actAsOrgName(_actAsOrgName) {
495
+ this._actAsOrgName = _actAsOrgName;
496
+ }
494
497
  get version() {
495
498
  return this._version;
496
499
  }
@@ -519,6 +522,12 @@ class RequestHeadersInterceptor {
519
522
  if (!headers.has('X-VMWARE-VCLOUD-TENANT-CONTEXT') && this._actAs) {
520
523
  headers = headers.set('X-VMWARE-VCLOUD-TENANT-CONTEXT', this._actAs);
521
524
  }
525
+ /**
526
+ * Covers the case where the User set the ActAs token himself
527
+ */
528
+ if (!headers.has('X-VMWARE-VCLOUD-AUTH-CONTEXT') && this._actAsOrgName) {
529
+ headers = headers.set('X-VMWARE-VCLOUD-AUTH-CONTEXT', this._actAsOrgName);
530
+ }
522
531
  const customReq = req.clone({
523
532
  headers
524
533
  });
@@ -1035,6 +1044,7 @@ class VcdApiClient {
1035
1044
  */
1036
1045
  actAs(actAs = null) {
1037
1046
  this.http.requestHeadersInterceptor.actAs = !actAs ? null : actAs.id;
1047
+ this.http.requestHeadersInterceptor.actAsOrgName = !actAs ? null : actAs.name;
1038
1048
  return this;
1039
1049
  }
1040
1050
  /**