@sonatype/nexus-repo-api-client 3.96.0 → 3.96.2

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.
Files changed (32) hide show
  1. package/.openapi-generator/FILES +3 -0
  2. package/dist/apis/SecurityManagementJWTApi.d.ts +25 -0
  3. package/dist/apis/SecurityManagementJWTApi.js +60 -0
  4. package/dist/apis/SecurityOAuth2OIDCApi.d.ts +45 -0
  5. package/dist/apis/SecurityOAuth2OIDCApi.js +123 -0
  6. package/dist/apis/index.d.ts +2 -0
  7. package/dist/apis/index.js +2 -0
  8. package/dist/esm/apis/SecurityManagementJWTApi.d.ts +25 -0
  9. package/dist/esm/apis/SecurityManagementJWTApi.js +56 -0
  10. package/dist/esm/apis/SecurityOAuth2OIDCApi.d.ts +45 -0
  11. package/dist/esm/apis/SecurityOAuth2OIDCApi.js +119 -0
  12. package/dist/esm/apis/index.d.ts +2 -0
  13. package/dist/esm/apis/index.js +2 -0
  14. package/dist/esm/models/OAuth2OidcConfigurationXO.d.ts +134 -0
  15. package/dist/esm/models/OAuth2OidcConfigurationXO.js +77 -0
  16. package/dist/esm/models/RawProxyApiRepository.d.ts +7 -0
  17. package/dist/esm/models/RawProxyApiRepository.js +3 -0
  18. package/dist/esm/models/index.d.ts +1 -0
  19. package/dist/esm/models/index.js +1 -0
  20. package/dist/models/OAuth2OidcConfigurationXO.d.ts +134 -0
  21. package/dist/models/OAuth2OidcConfigurationXO.js +84 -0
  22. package/dist/models/RawProxyApiRepository.d.ts +7 -0
  23. package/dist/models/RawProxyApiRepository.js +3 -0
  24. package/dist/models/index.d.ts +1 -0
  25. package/dist/models/index.js +1 -0
  26. package/package.json +1 -1
  27. package/src/apis/SecurityManagementJWTApi.ts +54 -0
  28. package/src/apis/SecurityOAuth2OIDCApi.ts +138 -0
  29. package/src/apis/index.ts +2 -0
  30. package/src/models/OAuth2OidcConfigurationXO.ts +195 -0
  31. package/src/models/RawProxyApiRepository.ts +15 -0
  32. package/src/models/index.ts +1 -0
@@ -0,0 +1,138 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sonatype Nexus Repository Manager
5
+ * This documents the available APIs into [Sonatype Nexus Repository Manager](https://www.sonatype.com/products/sonatype-nexus-repository) as of version 3.96.0-09.
6
+ *
7
+ * The version of the OpenAPI document: 3.96.0-09
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ OAuth2OidcConfigurationXO,
19
+ } from '../models/index';
20
+ import {
21
+ OAuth2OidcConfigurationXOFromJSON,
22
+ OAuth2OidcConfigurationXOToJSON,
23
+ } from '../models/index';
24
+
25
+ export interface SecurityOAuth2OIDCApiUpdateSecurityOauth2Request {
26
+ oAuth2OidcConfigurationXO: OAuth2OidcConfigurationXO;
27
+ }
28
+
29
+ /**
30
+ *
31
+ */
32
+ export class SecurityOAuth2OIDCApi extends runtime.BaseAPI {
33
+
34
+ /**
35
+ * Remove OAuth2/OIDC configuration
36
+ */
37
+ async deleteSecurityOauth2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
38
+ const queryParameters: any = {};
39
+
40
+ const headerParameters: runtime.HTTPHeaders = {};
41
+
42
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
43
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
44
+ }
45
+
46
+ let urlPath = `/v1/security/oauth2`;
47
+
48
+ const response = await this.request({
49
+ path: urlPath,
50
+ method: 'DELETE',
51
+ headers: headerParameters,
52
+ query: queryParameters,
53
+ }, initOverrides);
54
+
55
+ return new runtime.VoidApiResponse(response);
56
+ }
57
+
58
+ /**
59
+ * Remove OAuth2/OIDC configuration
60
+ */
61
+ async deleteSecurityOauth2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
62
+ await this.deleteSecurityOauth2Raw(initOverrides);
63
+ }
64
+
65
+ /**
66
+ * Retrieve the current OAuth2/OIDC configuration
67
+ */
68
+ async listSecurityOauth2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OAuth2OidcConfigurationXO>> {
69
+ const queryParameters: any = {};
70
+
71
+ const headerParameters: runtime.HTTPHeaders = {};
72
+
73
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
74
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
75
+ }
76
+
77
+ let urlPath = `/v1/security/oauth2`;
78
+
79
+ const response = await this.request({
80
+ path: urlPath,
81
+ method: 'GET',
82
+ headers: headerParameters,
83
+ query: queryParameters,
84
+ }, initOverrides);
85
+
86
+ return new runtime.JSONApiResponse(response, (jsonValue) => OAuth2OidcConfigurationXOFromJSON(jsonValue));
87
+ }
88
+
89
+ /**
90
+ * Retrieve the current OAuth2/OIDC configuration
91
+ */
92
+ async listSecurityOauth2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuth2OidcConfigurationXO> {
93
+ const response = await this.listSecurityOauth2Raw(initOverrides);
94
+ return await response.value();
95
+ }
96
+
97
+ /**
98
+ * Create or update OAuth2/OIDC configuration
99
+ */
100
+ async updateSecurityOauth2Raw(requestParameters: SecurityOAuth2OIDCApiUpdateSecurityOauth2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
101
+ if (requestParameters['oAuth2OidcConfigurationXO'] == null) {
102
+ throw new runtime.RequiredError(
103
+ 'oAuth2OidcConfigurationXO',
104
+ 'Required parameter "oAuth2OidcConfigurationXO" was null or undefined when calling updateSecurityOauth2().'
105
+ );
106
+ }
107
+
108
+ const queryParameters: any = {};
109
+
110
+ const headerParameters: runtime.HTTPHeaders = {};
111
+
112
+ headerParameters['Content-Type'] = 'application/json';
113
+
114
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
115
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
116
+ }
117
+
118
+ let urlPath = `/v1/security/oauth2`;
119
+
120
+ const response = await this.request({
121
+ path: urlPath,
122
+ method: 'PUT',
123
+ headers: headerParameters,
124
+ query: queryParameters,
125
+ body: OAuth2OidcConfigurationXOToJSON(requestParameters['oAuth2OidcConfigurationXO']),
126
+ }, initOverrides);
127
+
128
+ return new runtime.VoidApiResponse(response);
129
+ }
130
+
131
+ /**
132
+ * Create or update OAuth2/OIDC configuration
133
+ */
134
+ async updateSecurityOauth2(requestParameters: SecurityOAuth2OIDCApiUpdateSecurityOauth2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
135
+ await this.updateSecurityOauth2Raw(requestParameters, initOverrides);
136
+ }
137
+
138
+ }
package/src/apis/index.ts CHANGED
@@ -33,6 +33,7 @@ export * from './SecurityManagementApi';
33
33
  export * from './SecurityManagementAPIAccessApi';
34
34
  export * from './SecurityManagementAnonymousAccessApi';
35
35
  export * from './SecurityManagementApiKeysPrincipalsEncryptionApi';
36
+ export * from './SecurityManagementJWTApi';
36
37
  export * from './SecurityManagementLDAPApi';
37
38
  export * from './SecurityManagementPrivilegesApi';
38
39
  export * from './SecurityManagementRealmsApi';
@@ -44,6 +45,7 @@ export * from './SecurityManagementSSRFProtectionApi';
44
45
  export * from './SecurityManagementSecretsEncryptionApi';
45
46
  export * from './SecurityManagementUserTokensApi';
46
47
  export * from './SecurityManagementUsersApi';
48
+ export * from './SecurityOAuth2OIDCApi';
47
49
  export * from './StagingApi';
48
50
  export * from './StatusApi';
49
51
  export * from './SupportApi';
@@ -0,0 +1,195 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sonatype Nexus Repository Manager
5
+ * This documents the available APIs into [Sonatype Nexus Repository Manager](https://www.sonatype.com/products/sonatype-nexus-repository) as of version 3.96.0-09.
6
+ *
7
+ * The version of the OpenAPI document: 3.96.0-09
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
+ /**
17
+ *
18
+ * @export
19
+ * @interface OAuth2OidcConfigurationXO
20
+ */
21
+ export interface OAuth2OidcConfigurationXO {
22
+ /**
23
+ *
24
+ * @type {{ [key: string]: string; }}
25
+ * @memberof OAuth2OidcConfigurationXO
26
+ */
27
+ authorizationCustomParams?: { [key: string]: string; };
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof OAuth2OidcConfigurationXO
32
+ */
33
+ clientId?: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof OAuth2OidcConfigurationXO
38
+ */
39
+ clientSecret?: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof OAuth2OidcConfigurationXO
44
+ */
45
+ emailClaim?: string;
46
+ /**
47
+ *
48
+ * @type {{ [key: string]: string; }}
49
+ * @memberof OAuth2OidcConfigurationXO
50
+ */
51
+ exactMatchClaims?: { [key: string]: string; };
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof OAuth2OidcConfigurationXO
56
+ */
57
+ firstNameClaim?: string;
58
+ /**
59
+ *
60
+ * @type {string}
61
+ * @memberof OAuth2OidcConfigurationXO
62
+ */
63
+ groupsClaim?: string;
64
+ /**
65
+ *
66
+ * @type {string}
67
+ * @memberof OAuth2OidcConfigurationXO
68
+ */
69
+ idpAuthorizationUrl?: string;
70
+ /**
71
+ *
72
+ * @type {string}
73
+ * @memberof OAuth2OidcConfigurationXO
74
+ */
75
+ idpJwks?: string;
76
+ /**
77
+ *
78
+ * @type {string}
79
+ * @memberof OAuth2OidcConfigurationXO
80
+ */
81
+ idpJwksUrl?: string;
82
+ /**
83
+ *
84
+ * @type {string}
85
+ * @memberof OAuth2OidcConfigurationXO
86
+ */
87
+ idpJwsAlgorithm: string;
88
+ /**
89
+ *
90
+ * @type {string}
91
+ * @memberof OAuth2OidcConfigurationXO
92
+ */
93
+ idpLogoutUrl?: string;
94
+ /**
95
+ *
96
+ * @type {string}
97
+ * @memberof OAuth2OidcConfigurationXO
98
+ */
99
+ idpTokenUrl?: string;
100
+ /**
101
+ *
102
+ * @type {string}
103
+ * @memberof OAuth2OidcConfigurationXO
104
+ */
105
+ lastNameClaim?: string;
106
+ /**
107
+ *
108
+ * @type {{ [key: string]: string; }}
109
+ * @memberof OAuth2OidcConfigurationXO
110
+ */
111
+ tokenRequestCustomParams?: { [key: string]: string; };
112
+ /**
113
+ *
114
+ * @type {boolean}
115
+ * @memberof OAuth2OidcConfigurationXO
116
+ */
117
+ useTrustStore?: boolean;
118
+ /**
119
+ *
120
+ * @type {string}
121
+ * @memberof OAuth2OidcConfigurationXO
122
+ */
123
+ usernameClaim: string;
124
+ }
125
+
126
+ /**
127
+ * Check if a given object implements the OAuth2OidcConfigurationXO interface.
128
+ */
129
+ export function instanceOfOAuth2OidcConfigurationXO(value: object): value is OAuth2OidcConfigurationXO {
130
+ if (!('idpJwsAlgorithm' in value) || value['idpJwsAlgorithm'] === undefined) return false;
131
+ if (!('usernameClaim' in value) || value['usernameClaim'] === undefined) return false;
132
+ return true;
133
+ }
134
+
135
+ export function OAuth2OidcConfigurationXOFromJSON(json: any): OAuth2OidcConfigurationXO {
136
+ return OAuth2OidcConfigurationXOFromJSONTyped(json, false);
137
+ }
138
+
139
+ export function OAuth2OidcConfigurationXOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OAuth2OidcConfigurationXO {
140
+ if (json == null) {
141
+ return json;
142
+ }
143
+ return {
144
+
145
+ 'authorizationCustomParams': json['authorizationCustomParams'] == null ? undefined : json['authorizationCustomParams'],
146
+ 'clientId': json['clientId'] == null ? undefined : json['clientId'],
147
+ 'clientSecret': json['clientSecret'] == null ? undefined : json['clientSecret'],
148
+ 'emailClaim': json['emailClaim'] == null ? undefined : json['emailClaim'],
149
+ 'exactMatchClaims': json['exactMatchClaims'] == null ? undefined : json['exactMatchClaims'],
150
+ 'firstNameClaim': json['firstNameClaim'] == null ? undefined : json['firstNameClaim'],
151
+ 'groupsClaim': json['groupsClaim'] == null ? undefined : json['groupsClaim'],
152
+ 'idpAuthorizationUrl': json['idpAuthorizationUrl'] == null ? undefined : json['idpAuthorizationUrl'],
153
+ 'idpJwks': json['idpJwks'] == null ? undefined : json['idpJwks'],
154
+ 'idpJwksUrl': json['idpJwksUrl'] == null ? undefined : json['idpJwksUrl'],
155
+ 'idpJwsAlgorithm': json['idpJwsAlgorithm'],
156
+ 'idpLogoutUrl': json['idpLogoutUrl'] == null ? undefined : json['idpLogoutUrl'],
157
+ 'idpTokenUrl': json['idpTokenUrl'] == null ? undefined : json['idpTokenUrl'],
158
+ 'lastNameClaim': json['lastNameClaim'] == null ? undefined : json['lastNameClaim'],
159
+ 'tokenRequestCustomParams': json['tokenRequestCustomParams'] == null ? undefined : json['tokenRequestCustomParams'],
160
+ 'useTrustStore': json['useTrustStore'] == null ? undefined : json['useTrustStore'],
161
+ 'usernameClaim': json['usernameClaim'],
162
+ };
163
+ }
164
+
165
+ export function OAuth2OidcConfigurationXOToJSON(json: any): OAuth2OidcConfigurationXO {
166
+ return OAuth2OidcConfigurationXOToJSONTyped(json, false);
167
+ }
168
+
169
+ export function OAuth2OidcConfigurationXOToJSONTyped(value?: OAuth2OidcConfigurationXO | null, ignoreDiscriminator: boolean = false): any {
170
+ if (value == null) {
171
+ return value;
172
+ }
173
+
174
+ return {
175
+
176
+ 'authorizationCustomParams': value['authorizationCustomParams'],
177
+ 'clientId': value['clientId'],
178
+ 'clientSecret': value['clientSecret'],
179
+ 'emailClaim': value['emailClaim'],
180
+ 'exactMatchClaims': value['exactMatchClaims'],
181
+ 'firstNameClaim': value['firstNameClaim'],
182
+ 'groupsClaim': value['groupsClaim'],
183
+ 'idpAuthorizationUrl': value['idpAuthorizationUrl'],
184
+ 'idpJwks': value['idpJwks'],
185
+ 'idpJwksUrl': value['idpJwksUrl'],
186
+ 'idpJwsAlgorithm': value['idpJwsAlgorithm'],
187
+ 'idpLogoutUrl': value['idpLogoutUrl'],
188
+ 'idpTokenUrl': value['idpTokenUrl'],
189
+ 'lastNameClaim': value['lastNameClaim'],
190
+ 'tokenRequestCustomParams': value['tokenRequestCustomParams'],
191
+ 'useTrustStore': value['useTrustStore'],
192
+ 'usernameClaim': value['usernameClaim'],
193
+ };
194
+ }
195
+
@@ -20,6 +20,13 @@ import {
20
20
  NegativeCacheAttributesToJSON,
21
21
  NegativeCacheAttributesToJSONTyped,
22
22
  } from './NegativeCacheAttributes';
23
+ import type { FirewallAttributes } from './FirewallAttributes';
24
+ import {
25
+ FirewallAttributesFromJSON,
26
+ FirewallAttributesFromJSONTyped,
27
+ FirewallAttributesToJSON,
28
+ FirewallAttributesToJSONTyped,
29
+ } from './FirewallAttributes';
23
30
  import type { ProxyAttributes } from './ProxyAttributes';
24
31
  import {
25
32
  ProxyAttributesFromJSON,
@@ -75,6 +82,12 @@ export interface RawProxyApiRepository {
75
82
  * @memberof RawProxyApiRepository
76
83
  */
77
84
  cleanup?: CleanupPolicyAttributes;
85
+ /**
86
+ *
87
+ * @type {FirewallAttributes}
88
+ * @memberof RawProxyApiRepository
89
+ */
90
+ firewall?: FirewallAttributes;
78
91
  /**
79
92
  *
80
93
  * @type {string}
@@ -177,6 +190,7 @@ export function RawProxyApiRepositoryFromJSONTyped(json: any, ignoreDiscriminato
177
190
  return {
178
191
 
179
192
  'cleanup': json['cleanup'] == null ? undefined : CleanupPolicyAttributesFromJSON(json['cleanup']),
193
+ 'firewall': json['firewall'] == null ? undefined : FirewallAttributesFromJSON(json['firewall']),
180
194
  'format': json['format'],
181
195
  'httpClient': HttpClientAttributesFromJSON(json['httpClient']),
182
196
  'name': json['name'],
@@ -204,6 +218,7 @@ export function RawProxyApiRepositoryToJSONTyped(value?: RawProxyApiRepository |
204
218
  return {
205
219
 
206
220
  'cleanup': CleanupPolicyAttributesToJSON(value['cleanup']),
221
+ 'firewall': FirewallAttributesToJSON(value['firewall']),
207
222
  'format': value['format'],
208
223
  'httpClient': HttpClientAttributesToJSON(value['httpClient']),
209
224
  'name': value['name'],
@@ -203,6 +203,7 @@ export * from './NugetHostedApiRepository';
203
203
  export * from './NugetHostedRepositoryApiRequest';
204
204
  export * from './NugetProxyApiRepository';
205
205
  export * from './NugetProxyRepositoryApiRequest';
206
+ export * from './OAuth2OidcConfigurationXO';
206
207
  export * from './OciAttributes';
207
208
  export * from './OciCosignConfiguration';
208
209
  export * from './OciGroupApiRepository';