@sonatype/nexus-iq-api-client 0.196.0 → 0.196.1

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.
@@ -280,6 +280,7 @@ src/models/GetSuggestedRemediationForComponent200Response.ts
280
280
  src/models/GroupingByDTO.ts
281
281
  src/models/ImportSbomRequest.ts
282
282
  src/models/InnerSourceData.ts
283
+ src/models/InsertOrUpdateSamlConfigurationRequest.ts
283
284
  src/models/InstallLicenseRequest.ts
284
285
  src/models/KevData.ts
285
286
  src/models/LabelsByOwner.ts
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { ApiSamlConfigurationResponseDTO } from '../models/index';
13
+ import type { ApiSamlConfigurationDTO, ApiSamlConfigurationResponseDTO } from '../models/index';
14
+ export interface ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest {
15
+ identityProviderXml?: string;
16
+ samlConfiguration?: ApiSamlConfigurationDTO;
17
+ }
14
18
  /**
15
19
  * ConfigSAMLApi - interface
16
20
  *
@@ -51,6 +55,19 @@ export interface ConfigSAMLApiInterface {
51
55
  * Use this method to inspect the SAML configuration. Permissions required: Edit System Configuration and Users
52
56
  */
53
57
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
58
+ /**
59
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
60
+ * @param {string} [identityProviderXml] Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
61
+ * @param {ApiSamlConfigurationDTO} [samlConfiguration]
62
+ * @param {*} [options] Override http request option.
63
+ * @throws {RequiredError}
64
+ * @memberof ConfigSAMLApiInterface
65
+ */
66
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
67
+ /**
68
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
69
+ */
70
+ insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
54
71
  }
55
72
  /**
56
73
  *
@@ -80,4 +97,12 @@ export declare class ConfigSAMLApi extends runtime.BaseAPI implements ConfigSAML
80
97
  * Use this method to inspect the SAML configuration. Permissions required: Edit System Configuration and Users
81
98
  */
82
99
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
100
+ /**
101
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
102
+ */
103
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
104
+ /**
105
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
106
+ */
107
+ insertOrUpdateSamlConfiguration(requestParameters?: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
83
108
  }
@@ -120,5 +120,53 @@ class ConfigSAMLApi extends runtime.BaseAPI {
120
120
  return yield response.value();
121
121
  });
122
122
  }
123
+ /**
124
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
125
+ */
126
+ insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ const queryParameters = {};
129
+ const headerParameters = {};
130
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
131
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
132
+ }
133
+ const consumes = [
134
+ { contentType: 'multipart/form-data' },
135
+ ];
136
+ // @ts-ignore: canConsumeForm may be unused
137
+ const canConsumeForm = runtime.canConsumeForm(consumes);
138
+ let formParams;
139
+ let useForm = false;
140
+ if (useForm) {
141
+ formParams = new FormData();
142
+ }
143
+ else {
144
+ formParams = new URLSearchParams();
145
+ }
146
+ if (requestParameters['identityProviderXml'] != null) {
147
+ formParams.append('identityProviderXml', requestParameters['identityProviderXml']);
148
+ }
149
+ if (requestParameters['samlConfiguration'] != null) {
150
+ formParams.append('samlConfiguration', new Blob([JSON.stringify((0, index_1.ApiSamlConfigurationDTOToJSON)(requestParameters['samlConfiguration']))], { type: "application/json", }));
151
+ }
152
+ let urlPath = `/api/v2/config/saml`;
153
+ const response = yield this.request({
154
+ path: urlPath,
155
+ method: 'PUT',
156
+ headers: headerParameters,
157
+ query: queryParameters,
158
+ body: formParams,
159
+ }, initOverrides);
160
+ return new runtime.VoidApiResponse(response);
161
+ });
162
+ }
163
+ /**
164
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
165
+ */
166
+ insertOrUpdateSamlConfiguration() {
167
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
168
+ yield this.insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides);
169
+ });
170
+ }
123
171
  }
124
172
  exports.ConfigSAMLApi = ConfigSAMLApi;
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { ApiSamlConfigurationResponseDTO } from '../models/index';
13
+ import type { ApiSamlConfigurationDTO, ApiSamlConfigurationResponseDTO } from '../models/index';
14
+ export interface ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest {
15
+ identityProviderXml?: string;
16
+ samlConfiguration?: ApiSamlConfigurationDTO;
17
+ }
14
18
  /**
15
19
  * ConfigSAMLApi - interface
16
20
  *
@@ -51,6 +55,19 @@ export interface ConfigSAMLApiInterface {
51
55
  * Use this method to inspect the SAML configuration. Permissions required: Edit System Configuration and Users
52
56
  */
53
57
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
58
+ /**
59
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
60
+ * @param {string} [identityProviderXml] Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
61
+ * @param {ApiSamlConfigurationDTO} [samlConfiguration]
62
+ * @param {*} [options] Override http request option.
63
+ * @throws {RequiredError}
64
+ * @memberof ConfigSAMLApiInterface
65
+ */
66
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
67
+ /**
68
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
69
+ */
70
+ insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
54
71
  }
55
72
  /**
56
73
  *
@@ -80,4 +97,12 @@ export declare class ConfigSAMLApi extends runtime.BaseAPI implements ConfigSAML
80
97
  * Use this method to inspect the SAML configuration. Permissions required: Edit System Configuration and Users
81
98
  */
82
99
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
100
+ /**
101
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
102
+ */
103
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
104
+ /**
105
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
106
+ */
107
+ insertOrUpdateSamlConfiguration(requestParameters?: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
83
108
  }
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { ApiSamlConfigurationResponseDTOFromJSON, } from '../models/index';
24
+ import { ApiSamlConfigurationDTOToJSON, ApiSamlConfigurationResponseDTOFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
@@ -117,4 +117,52 @@ export class ConfigSAMLApi extends runtime.BaseAPI {
117
117
  return yield response.value();
118
118
  });
119
119
  }
120
+ /**
121
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
122
+ */
123
+ insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides) {
124
+ return __awaiter(this, void 0, void 0, function* () {
125
+ const queryParameters = {};
126
+ const headerParameters = {};
127
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
128
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
129
+ }
130
+ const consumes = [
131
+ { contentType: 'multipart/form-data' },
132
+ ];
133
+ // @ts-ignore: canConsumeForm may be unused
134
+ const canConsumeForm = runtime.canConsumeForm(consumes);
135
+ let formParams;
136
+ let useForm = false;
137
+ if (useForm) {
138
+ formParams = new FormData();
139
+ }
140
+ else {
141
+ formParams = new URLSearchParams();
142
+ }
143
+ if (requestParameters['identityProviderXml'] != null) {
144
+ formParams.append('identityProviderXml', requestParameters['identityProviderXml']);
145
+ }
146
+ if (requestParameters['samlConfiguration'] != null) {
147
+ formParams.append('samlConfiguration', new Blob([JSON.stringify(ApiSamlConfigurationDTOToJSON(requestParameters['samlConfiguration']))], { type: "application/json", }));
148
+ }
149
+ let urlPath = `/api/v2/config/saml`;
150
+ const response = yield this.request({
151
+ path: urlPath,
152
+ method: 'PUT',
153
+ headers: headerParameters,
154
+ query: queryParameters,
155
+ body: formParams,
156
+ }, initOverrides);
157
+ return new runtime.VoidApiResponse(response);
158
+ });
159
+ }
160
+ /**
161
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
162
+ */
163
+ insertOrUpdateSamlConfiguration() {
164
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
165
+ yield this.insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides);
166
+ });
167
+ }
120
168
  }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Sonatype Lifecycle Public REST API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.196.0-01
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { ApiSamlConfigurationDTO } from './ApiSamlConfigurationDTO';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface InsertOrUpdateSamlConfigurationRequest
17
+ */
18
+ export interface InsertOrUpdateSamlConfigurationRequest {
19
+ /**
20
+ * Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
21
+ * @type {string}
22
+ * @memberof InsertOrUpdateSamlConfigurationRequest
23
+ */
24
+ identityProviderXml?: string;
25
+ /**
26
+ *
27
+ * @type {ApiSamlConfigurationDTO}
28
+ * @memberof InsertOrUpdateSamlConfigurationRequest
29
+ */
30
+ samlConfiguration?: ApiSamlConfigurationDTO;
31
+ }
32
+ /**
33
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
34
+ */
35
+ export declare function instanceOfInsertOrUpdateSamlConfigurationRequest(value: object): value is InsertOrUpdateSamlConfigurationRequest;
36
+ export declare function InsertOrUpdateSamlConfigurationRequestFromJSON(json: any): InsertOrUpdateSamlConfigurationRequest;
37
+ export declare function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsertOrUpdateSamlConfigurationRequest;
38
+ export declare function InsertOrUpdateSamlConfigurationRequestToJSON(json: any): InsertOrUpdateSamlConfigurationRequest;
39
+ export declare function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value?: InsertOrUpdateSamlConfigurationRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,44 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sonatype Lifecycle Public REST API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 1.196.0-01
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ import { ApiSamlConfigurationDTOFromJSON, ApiSamlConfigurationDTOToJSON, } from './ApiSamlConfigurationDTO';
15
+ /**
16
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
17
+ */
18
+ export function instanceOfInsertOrUpdateSamlConfigurationRequest(value) {
19
+ return true;
20
+ }
21
+ export function InsertOrUpdateSamlConfigurationRequestFromJSON(json) {
22
+ return InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, false);
23
+ }
24
+ export function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, ignoreDiscriminator) {
25
+ if (json == null) {
26
+ return json;
27
+ }
28
+ return {
29
+ 'identityProviderXml': json['identityProviderXml'] == null ? undefined : json['identityProviderXml'],
30
+ 'samlConfiguration': json['samlConfiguration'] == null ? undefined : ApiSamlConfigurationDTOFromJSON(json['samlConfiguration']),
31
+ };
32
+ }
33
+ export function InsertOrUpdateSamlConfigurationRequestToJSON(json) {
34
+ return InsertOrUpdateSamlConfigurationRequestToJSONTyped(json, false);
35
+ }
36
+ export function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value, ignoreDiscriminator = false) {
37
+ if (value == null) {
38
+ return value;
39
+ }
40
+ return {
41
+ 'identityProviderXml': value['identityProviderXml'],
42
+ 'samlConfiguration': ApiSamlConfigurationDTOToJSON(value['samlConfiguration']),
43
+ };
44
+ }
@@ -218,6 +218,7 @@ export * from './GetSuggestedRemediationForComponent200Response';
218
218
  export * from './GroupingByDTO';
219
219
  export * from './ImportSbomRequest';
220
220
  export * from './InnerSourceData';
221
+ export * from './InsertOrUpdateSamlConfigurationRequest';
221
222
  export * from './InstallLicenseRequest';
222
223
  export * from './KevData';
223
224
  export * from './LabelsByOwner';
@@ -220,6 +220,7 @@ export * from './GetSuggestedRemediationForComponent200Response';
220
220
  export * from './GroupingByDTO';
221
221
  export * from './ImportSbomRequest';
222
222
  export * from './InnerSourceData';
223
+ export * from './InsertOrUpdateSamlConfigurationRequest';
223
224
  export * from './InstallLicenseRequest';
224
225
  export * from './KevData';
225
226
  export * from './LabelsByOwner';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Sonatype Lifecycle Public REST API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.196.0-01
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { ApiSamlConfigurationDTO } from './ApiSamlConfigurationDTO';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface InsertOrUpdateSamlConfigurationRequest
17
+ */
18
+ export interface InsertOrUpdateSamlConfigurationRequest {
19
+ /**
20
+ * Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
21
+ * @type {string}
22
+ * @memberof InsertOrUpdateSamlConfigurationRequest
23
+ */
24
+ identityProviderXml?: string;
25
+ /**
26
+ *
27
+ * @type {ApiSamlConfigurationDTO}
28
+ * @memberof InsertOrUpdateSamlConfigurationRequest
29
+ */
30
+ samlConfiguration?: ApiSamlConfigurationDTO;
31
+ }
32
+ /**
33
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
34
+ */
35
+ export declare function instanceOfInsertOrUpdateSamlConfigurationRequest(value: object): value is InsertOrUpdateSamlConfigurationRequest;
36
+ export declare function InsertOrUpdateSamlConfigurationRequestFromJSON(json: any): InsertOrUpdateSamlConfigurationRequest;
37
+ export declare function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsertOrUpdateSamlConfigurationRequest;
38
+ export declare function InsertOrUpdateSamlConfigurationRequestToJSON(json: any): InsertOrUpdateSamlConfigurationRequest;
39
+ export declare function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value?: InsertOrUpdateSamlConfigurationRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Sonatype Lifecycle Public REST API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 1.196.0-01
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfInsertOrUpdateSamlConfigurationRequest = instanceOfInsertOrUpdateSamlConfigurationRequest;
17
+ exports.InsertOrUpdateSamlConfigurationRequestFromJSON = InsertOrUpdateSamlConfigurationRequestFromJSON;
18
+ exports.InsertOrUpdateSamlConfigurationRequestFromJSONTyped = InsertOrUpdateSamlConfigurationRequestFromJSONTyped;
19
+ exports.InsertOrUpdateSamlConfigurationRequestToJSON = InsertOrUpdateSamlConfigurationRequestToJSON;
20
+ exports.InsertOrUpdateSamlConfigurationRequestToJSONTyped = InsertOrUpdateSamlConfigurationRequestToJSONTyped;
21
+ const ApiSamlConfigurationDTO_1 = require("./ApiSamlConfigurationDTO");
22
+ /**
23
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
24
+ */
25
+ function instanceOfInsertOrUpdateSamlConfigurationRequest(value) {
26
+ return true;
27
+ }
28
+ function InsertOrUpdateSamlConfigurationRequestFromJSON(json) {
29
+ return InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, false);
30
+ }
31
+ function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, ignoreDiscriminator) {
32
+ if (json == null) {
33
+ return json;
34
+ }
35
+ return {
36
+ 'identityProviderXml': json['identityProviderXml'] == null ? undefined : json['identityProviderXml'],
37
+ 'samlConfiguration': json['samlConfiguration'] == null ? undefined : (0, ApiSamlConfigurationDTO_1.ApiSamlConfigurationDTOFromJSON)(json['samlConfiguration']),
38
+ };
39
+ }
40
+ function InsertOrUpdateSamlConfigurationRequestToJSON(json) {
41
+ return InsertOrUpdateSamlConfigurationRequestToJSONTyped(json, false);
42
+ }
43
+ function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ 'identityProviderXml': value['identityProviderXml'],
49
+ 'samlConfiguration': (0, ApiSamlConfigurationDTO_1.ApiSamlConfigurationDTOToJSON)(value['samlConfiguration']),
50
+ };
51
+ }
@@ -218,6 +218,7 @@ export * from './GetSuggestedRemediationForComponent200Response';
218
218
  export * from './GroupingByDTO';
219
219
  export * from './ImportSbomRequest';
220
220
  export * from './InnerSourceData';
221
+ export * from './InsertOrUpdateSamlConfigurationRequest';
221
222
  export * from './InstallLicenseRequest';
222
223
  export * from './KevData';
223
224
  export * from './LabelsByOwner';
@@ -236,6 +236,7 @@ __exportStar(require("./GetSuggestedRemediationForComponent200Response"), export
236
236
  __exportStar(require("./GroupingByDTO"), exports);
237
237
  __exportStar(require("./ImportSbomRequest"), exports);
238
238
  __exportStar(require("./InnerSourceData"), exports);
239
+ __exportStar(require("./InsertOrUpdateSamlConfigurationRequest"), exports);
239
240
  __exportStar(require("./InstallLicenseRequest"), exports);
240
241
  __exportStar(require("./KevData"), exports);
241
242
  __exportStar(require("./LabelsByOwner"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonatype/nexus-iq-api-client",
3
- "version": "0.196.0",
3
+ "version": "0.196.1",
4
4
  "description": "OpenAPI client for @sonatype/nexus-iq-api-client",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -15,13 +15,21 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ ApiSamlConfigurationDTO,
18
19
  ApiSamlConfigurationResponseDTO,
19
20
  } from '../models/index';
20
21
  import {
22
+ ApiSamlConfigurationDTOFromJSON,
23
+ ApiSamlConfigurationDTOToJSON,
21
24
  ApiSamlConfigurationResponseDTOFromJSON,
22
25
  ApiSamlConfigurationResponseDTOToJSON,
23
26
  } from '../models/index';
24
27
 
28
+ export interface ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest {
29
+ identityProviderXml?: string;
30
+ samlConfiguration?: ApiSamlConfigurationDTO;
31
+ }
32
+
25
33
  /**
26
34
  * ConfigSAMLApi - interface
27
35
  *
@@ -68,6 +76,21 @@ export interface ConfigSAMLApiInterface {
68
76
  */
69
77
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
70
78
 
79
+ /**
80
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
81
+ * @param {string} [identityProviderXml] Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
82
+ * @param {ApiSamlConfigurationDTO} [samlConfiguration]
83
+ * @param {*} [options] Override http request option.
84
+ * @throws {RequiredError}
85
+ * @memberof ConfigSAMLApiInterface
86
+ */
87
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
88
+
89
+ /**
90
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
91
+ */
92
+ insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
93
+
71
94
  }
72
95
 
73
96
  /**
@@ -174,4 +197,58 @@ export class ConfigSAMLApi extends runtime.BaseAPI implements ConfigSAMLApiInter
174
197
  return await response.value();
175
198
  }
176
199
 
200
+ /**
201
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
202
+ */
203
+ async insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
204
+ const queryParameters: any = {};
205
+
206
+ const headerParameters: runtime.HTTPHeaders = {};
207
+
208
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
209
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
210
+ }
211
+ const consumes: runtime.Consume[] = [
212
+ { contentType: 'multipart/form-data' },
213
+ ];
214
+ // @ts-ignore: canConsumeForm may be unused
215
+ const canConsumeForm = runtime.canConsumeForm(consumes);
216
+
217
+ let formParams: { append(param: string, value: any): any };
218
+ let useForm = false;
219
+ if (useForm) {
220
+ formParams = new FormData();
221
+ } else {
222
+ formParams = new URLSearchParams();
223
+ }
224
+
225
+ if (requestParameters['identityProviderXml'] != null) {
226
+ formParams.append('identityProviderXml', requestParameters['identityProviderXml'] as any);
227
+ }
228
+
229
+ if (requestParameters['samlConfiguration'] != null) {
230
+ formParams.append('samlConfiguration', new Blob([JSON.stringify(ApiSamlConfigurationDTOToJSON(requestParameters['samlConfiguration']))], { type: "application/json", }));
231
+ }
232
+
233
+
234
+ let urlPath = `/api/v2/config/saml`;
235
+
236
+ const response = await this.request({
237
+ path: urlPath,
238
+ method: 'PUT',
239
+ headers: headerParameters,
240
+ query: queryParameters,
241
+ body: formParams,
242
+ }, initOverrides);
243
+
244
+ return new runtime.VoidApiResponse(response);
245
+ }
246
+
247
+ /**
248
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
249
+ */
250
+ async insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
251
+ await this.insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides);
252
+ }
253
+
177
254
  }
@@ -0,0 +1,81 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sonatype Lifecycle Public REST API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 1.196.0-01
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ApiSamlConfigurationDTO } from './ApiSamlConfigurationDTO';
17
+ import {
18
+ ApiSamlConfigurationDTOFromJSON,
19
+ ApiSamlConfigurationDTOFromJSONTyped,
20
+ ApiSamlConfigurationDTOToJSON,
21
+ ApiSamlConfigurationDTOToJSONTyped,
22
+ } from './ApiSamlConfigurationDTO';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface InsertOrUpdateSamlConfigurationRequest
28
+ */
29
+ export interface InsertOrUpdateSamlConfigurationRequest {
30
+ /**
31
+ * Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
32
+ * @type {string}
33
+ * @memberof InsertOrUpdateSamlConfigurationRequest
34
+ */
35
+ identityProviderXml?: string;
36
+ /**
37
+ *
38
+ * @type {ApiSamlConfigurationDTO}
39
+ * @memberof InsertOrUpdateSamlConfigurationRequest
40
+ */
41
+ samlConfiguration?: ApiSamlConfigurationDTO;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
46
+ */
47
+ export function instanceOfInsertOrUpdateSamlConfigurationRequest(value: object): value is InsertOrUpdateSamlConfigurationRequest {
48
+ return true;
49
+ }
50
+
51
+ export function InsertOrUpdateSamlConfigurationRequestFromJSON(json: any): InsertOrUpdateSamlConfigurationRequest {
52
+ return InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, false);
53
+ }
54
+
55
+ export function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsertOrUpdateSamlConfigurationRequest {
56
+ if (json == null) {
57
+ return json;
58
+ }
59
+ return {
60
+
61
+ 'identityProviderXml': json['identityProviderXml'] == null ? undefined : json['identityProviderXml'],
62
+ 'samlConfiguration': json['samlConfiguration'] == null ? undefined : ApiSamlConfigurationDTOFromJSON(json['samlConfiguration']),
63
+ };
64
+ }
65
+
66
+ export function InsertOrUpdateSamlConfigurationRequestToJSON(json: any): InsertOrUpdateSamlConfigurationRequest {
67
+ return InsertOrUpdateSamlConfigurationRequestToJSONTyped(json, false);
68
+ }
69
+
70
+ export function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value?: InsertOrUpdateSamlConfigurationRequest | null, ignoreDiscriminator: boolean = false): any {
71
+ if (value == null) {
72
+ return value;
73
+ }
74
+
75
+ return {
76
+
77
+ 'identityProviderXml': value['identityProviderXml'],
78
+ 'samlConfiguration': ApiSamlConfigurationDTOToJSON(value['samlConfiguration']),
79
+ };
80
+ }
81
+
@@ -220,6 +220,7 @@ export * from './GetSuggestedRemediationForComponent200Response';
220
220
  export * from './GroupingByDTO';
221
221
  export * from './ImportSbomRequest';
222
222
  export * from './InnerSourceData';
223
+ export * from './InsertOrUpdateSamlConfigurationRequest';
223
224
  export * from './InstallLicenseRequest';
224
225
  export * from './KevData';
225
226
  export * from './LabelsByOwner';