/* tslint:disable */ /* eslint-disable */ /** * Sonatype Lifecycle Public REST API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.207.0-01 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import type { ApiReverseProxyAuthenticationConfigurationDTO, } from '../models/index'; import { ApiReverseProxyAuthenticationConfigurationDTOFromJSON, ApiReverseProxyAuthenticationConfigurationDTOToJSON, } from '../models/index'; export interface ConfigReverseProxyAuthenticationApiSetConfiguration5Request { apiReverseProxyAuthenticationConfigurationDTO?: ApiReverseProxyAuthenticationConfigurationDTO; } /** * ConfigReverseProxyAuthenticationApi - interface * * @export * @interface ConfigReverseProxyAuthenticationApiInterface */ export interface ConfigReverseProxyAuthenticationApiInterface { /** * Use this method to remove an existing reverse proxy server configuration. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigReverseProxyAuthenticationApiInterface */ deleteConfiguration5Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to remove an existing reverse proxy server configuration. Permissions required: Edit System Configuration and Users */ deleteConfiguration5(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to inspect an existing reverse proxy server configuration. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigReverseProxyAuthenticationApiInterface */ getConfiguration5Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to inspect an existing reverse proxy server configuration. Permissions required: Edit System Configuration and Users */ getConfiguration5(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to configure the reverse proxy server. Permissions required: Edit System Configuration and Users * @param {ApiReverseProxyAuthenticationConfigurationDTO} [apiReverseProxyAuthenticationConfigurationDTO] The request JSON could include: <ul><li>`enabled` indicates if the configuration is enabled.</li><li>`usernameHeader` is the name of the HTTP request header field that contains the username. The default value is `REMOTE_USER`.</li><li>`csrfProtectionDisabled` indicates if Cross-Site Request Forgery (CSRF) protection is disabled. Used for backward compatibility with old client plugins.</li><li>`logoutUrl` is the redirect URL when a user logs out. If set to `null` the user will not be redirected.</li></ul> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigReverseProxyAuthenticationApiInterface */ setConfiguration5Raw(requestParameters: ConfigReverseProxyAuthenticationApiSetConfiguration5Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to configure the reverse proxy server. Permissions required: Edit System Configuration and Users */ setConfiguration5(requestParameters: ConfigReverseProxyAuthenticationApiSetConfiguration5Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class ConfigReverseProxyAuthenticationApi extends runtime.BaseAPI implements ConfigReverseProxyAuthenticationApiInterface { /** * Use this method to remove an existing reverse proxy server configuration. Permissions required: Edit System Configuration and Users */ async deleteConfiguration5Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("BearerAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v2/config/reverseProxyAuthentication`; const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to remove an existing reverse proxy server configuration. Permissions required: Edit System Configuration and Users */ async deleteConfiguration5(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteConfiguration5Raw(initOverrides); } /** * Use this method to inspect an existing reverse proxy server configuration. Permissions required: Edit System Configuration and Users */ async getConfiguration5Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("BearerAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v2/config/reverseProxyAuthentication`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiReverseProxyAuthenticationConfigurationDTOFromJSON(jsonValue)); } /** * Use this method to inspect an existing reverse proxy server configuration. Permissions required: Edit System Configuration and Users */ async getConfiguration5(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getConfiguration5Raw(initOverrides); return await response.value(); } /** * Use this method to configure the reverse proxy server. Permissions required: Edit System Configuration and Users */ async setConfiguration5Raw(requestParameters: ConfigReverseProxyAuthenticationApiSetConfiguration5Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("BearerAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v2/config/reverseProxyAuthentication`; const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ApiReverseProxyAuthenticationConfigurationDTOToJSON(requestParameters['apiReverseProxyAuthenticationConfigurationDTO']), }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to configure the reverse proxy server. Permissions required: Edit System Configuration and Users */ async setConfiguration5(requestParameters: ConfigReverseProxyAuthenticationApiSetConfiguration5Request = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.setConfiguration5Raw(requestParameters, initOverrides); } }