mirror of https://github.com/halo-dev/halo
feat: support the expansion of other authentication methods (#3520)
#### What type of PR is this? /kind feature /milestone 2.4.0 /area core #### What this PR does / why we need it: 支持扩展其他登录方式: 1. 增加 AdditionalWebFilter 扩展点,插件只需要实现此扩展点完成 Filter 逻辑 2. 增加 DynamicMatcherSecurityWebFilterChain 用于将 `apiFilterChain` 的 `SecurityWebFilterChain` 委托给此类,需要认证的请求都会 DynamicMatcherSecurityWebFilterChain 的过滤器进行处理,所以 `AdditionalWebFilter` 可以通过 order 将扩展的过滤器放到这条链上的任何位置。 3. 将表单登录改为实现扩展点的实现 4. 增加 ExtensionPointDefinition 和 ExtensionDefinition 自定义模型用于对扩展点和扩展进行描述 5. 提供 AuthProvider 自定义模型用于记录支持的登录方式提供商 6. 提供 UserConnection 自定义模型用于将第三方登录账号信息与当前系统账户进行绑定 how to test it? 1. 测试表单登录功能是否正常 2. 测试插件的 plugin-oauth-github 的 PR https://github.com/halo-sigs/plugin-oauth-github/pull/3 功能是否正常 #### Which issue(s) this PR fixes: Fixes #3423 #### Does this PR introduce a user-facing change? ```release-note 支持扩展其他的认证方式 ```pull/3550/head
parent
f7eb0cd522
commit
7ca5270238
|
@ -65,6 +65,7 @@ dependencies {
|
|||
// Spring Security
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.security:spring-security-oauth2-jose'
|
||||
implementation 'org.springframework.security:spring-security-oauth2-client'
|
||||
implementation 'org.springframework.security:spring-security-oauth2-resource-server'
|
||||
|
||||
implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$springDocOpenAPI"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
.npmignore
|
||||
api.ts
|
||||
api/api-console-halo-run-v1alpha1-attachment-api.ts
|
||||
api/api-console-halo-run-v1alpha1-auth-provider-api.ts
|
||||
api/api-console-halo-run-v1alpha1-comment-api.ts
|
||||
api/api-console-halo-run-v1alpha1-indices-api.ts
|
||||
api/api-console-halo-run-v1alpha1-plugin-api.ts
|
||||
|
@ -14,6 +15,8 @@ api/api-console-halo-run-v1alpha1-user-api.ts
|
|||
api/api-halo-run-v1alpha1-comment-api.ts
|
||||
api/api-halo-run-v1alpha1-post-api.ts
|
||||
api/api-halo-run-v1alpha1-tracker-api.ts
|
||||
api/auth-halo-run-v1alpha1-auth-provider-api.ts
|
||||
api/auth-halo-run-v1alpha1-user-connection-api.ts
|
||||
api/content-halo-run-v1alpha1-category-api.ts
|
||||
api/content-halo-run-v1alpha1-comment-api.ts
|
||||
api/content-halo-run-v1alpha1-post-api.ts
|
||||
|
@ -23,6 +26,8 @@ api/content-halo-run-v1alpha1-snapshot-api.ts
|
|||
api/content-halo-run-v1alpha1-tag-api.ts
|
||||
api/login-api.ts
|
||||
api/metrics-halo-run-v1alpha1-counter-api.ts
|
||||
api/plugin-halo-run-v1alpha1-extension-definition-api.ts
|
||||
api/plugin-halo-run-v1alpha1-extension-point-definition-api.ts
|
||||
api/plugin-halo-run-v1alpha1-plugin-api.ts
|
||||
api/plugin-halo-run-v1alpha1-reverse-proxy-api.ts
|
||||
api/plugin-halo-run-v1alpha1-search-engine-api.ts
|
||||
|
@ -52,6 +57,9 @@ models/attachment-list.ts
|
|||
models/attachment-spec.ts
|
||||
models/attachment-status.ts
|
||||
models/attachment.ts
|
||||
models/auth-provider-list.ts
|
||||
models/auth-provider-spec.ts
|
||||
models/auth-provider.ts
|
||||
models/author.ts
|
||||
models/category-list.ts
|
||||
models/category-spec.ts
|
||||
|
@ -71,6 +79,7 @@ models/comment-vo.ts
|
|||
models/comment.ts
|
||||
models/condition.ts
|
||||
models/config-map-list.ts
|
||||
models/config-map-ref.ts
|
||||
models/config-map.ts
|
||||
models/content-wrapper.ts
|
||||
models/content.ts
|
||||
|
@ -82,6 +91,12 @@ models/custom-templates.ts
|
|||
models/dashboard-stats.ts
|
||||
models/detailed-user.ts
|
||||
models/excerpt.ts
|
||||
models/extension-definition-list.ts
|
||||
models/extension-definition.ts
|
||||
models/extension-point-definition-list.ts
|
||||
models/extension-point-definition.ts
|
||||
models/extension-point-spec.ts
|
||||
models/extension-spec.ts
|
||||
models/extension.ts
|
||||
models/file-reverse-proxy-provider.ts
|
||||
models/grant-request.ts
|
||||
|
@ -92,6 +107,7 @@ models/group-status.ts
|
|||
models/group.ts
|
||||
models/index.ts
|
||||
models/license.ts
|
||||
models/listed-auth-provider.ts
|
||||
models/listed-comment-list.ts
|
||||
models/listed-comment.ts
|
||||
models/listed-post-list.ts
|
||||
|
@ -155,6 +171,7 @@ models/search-engine-spec.ts
|
|||
models/search-engine.ts
|
||||
models/setting-form.ts
|
||||
models/setting-list.ts
|
||||
models/setting-ref.ts
|
||||
models/setting-spec.ts
|
||||
models/setting.ts
|
||||
models/single-page-list.ts
|
||||
|
@ -176,6 +193,9 @@ models/theme-list.ts
|
|||
models/theme-spec.ts
|
||||
models/theme-status.ts
|
||||
models/theme.ts
|
||||
models/user-connection-list.ts
|
||||
models/user-connection-spec.ts
|
||||
models/user-connection.ts
|
||||
models/user-list.ts
|
||||
models/user-permission.ts
|
||||
models/user-spec.ts
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
|
||||
export * from "./api/api-console-halo-run-v1alpha1-attachment-api";
|
||||
export * from "./api/api-console-halo-run-v1alpha1-auth-provider-api";
|
||||
export * from "./api/api-console-halo-run-v1alpha1-comment-api";
|
||||
export * from "./api/api-console-halo-run-v1alpha1-indices-api";
|
||||
export * from "./api/api-console-halo-run-v1alpha1-plugin-api";
|
||||
|
@ -25,6 +26,8 @@ export * from "./api/api-console-halo-run-v1alpha1-user-api";
|
|||
export * from "./api/api-halo-run-v1alpha1-comment-api";
|
||||
export * from "./api/api-halo-run-v1alpha1-post-api";
|
||||
export * from "./api/api-halo-run-v1alpha1-tracker-api";
|
||||
export * from "./api/auth-halo-run-v1alpha1-auth-provider-api";
|
||||
export * from "./api/auth-halo-run-v1alpha1-user-connection-api";
|
||||
export * from "./api/content-halo-run-v1alpha1-category-api";
|
||||
export * from "./api/content-halo-run-v1alpha1-comment-api";
|
||||
export * from "./api/content-halo-run-v1alpha1-post-api";
|
||||
|
@ -34,6 +37,8 @@ export * from "./api/content-halo-run-v1alpha1-snapshot-api";
|
|||
export * from "./api/content-halo-run-v1alpha1-tag-api";
|
||||
export * from "./api/login-api";
|
||||
export * from "./api/metrics-halo-run-v1alpha1-counter-api";
|
||||
export * from "./api/plugin-halo-run-v1alpha1-extension-definition-api";
|
||||
export * from "./api/plugin-halo-run-v1alpha1-extension-point-definition-api";
|
||||
export * from "./api/plugin-halo-run-v1alpha1-plugin-api";
|
||||
export * from "./api/plugin-halo-run-v1alpha1-reverse-proxy-api";
|
||||
export * from "./api/plugin-halo-run-v1alpha1-search-engine-api";
|
||||
|
|
|
@ -0,0 +1,417 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import type { Configuration } from "../configuration";
|
||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios";
|
||||
import globalAxios from "axios";
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import {
|
||||
DUMMY_BASE_URL,
|
||||
assertParamExists,
|
||||
setApiKeyToObject,
|
||||
setBasicAuthToObject,
|
||||
setBearerAuthToObject,
|
||||
setOAuthToObject,
|
||||
setSearchParams,
|
||||
serializeDataIfNeeded,
|
||||
toPathString,
|
||||
createRequestFunction,
|
||||
} from "../common";
|
||||
// @ts-ignore
|
||||
import {
|
||||
BASE_PATH,
|
||||
COLLECTION_FORMATS,
|
||||
RequestArgs,
|
||||
BaseAPI,
|
||||
RequiredError,
|
||||
} from "../base";
|
||||
// @ts-ignore
|
||||
import { AuthProvider } from "../models";
|
||||
// @ts-ignore
|
||||
import { ListedAuthProvider } from "../models";
|
||||
/**
|
||||
* ApiConsoleHaloRunV1alpha1AuthProviderApi - axios parameter creator
|
||||
* @export
|
||||
*/
|
||||
export const ApiConsoleHaloRunV1alpha1AuthProviderApiAxiosParamCreator =
|
||||
function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
* Disables an auth provider
|
||||
* @param {string} name
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
disableAuthProvider: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists("disableAuthProvider", "name", name);
|
||||
const localVarPath =
|
||||
`/apis/api.console.halo.run/v1alpha1/auth-providers/{name}/disable`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "PUT",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Enables an auth provider
|
||||
* @param {string} name
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
enableAuthProvider: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists("enableAuthProvider", "name", name);
|
||||
const localVarPath =
|
||||
`/apis/api.console.halo.run/v1alpha1/auth-providers/{name}/enable`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "PUT",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Lists all auth providers
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listAuthProviders: async (
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/apis/api.console.halo.run/v1alpha1/auth-providers`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "GET",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* ApiConsoleHaloRunV1alpha1AuthProviderApi - functional programming interface
|
||||
* @export
|
||||
*/
|
||||
export const ApiConsoleHaloRunV1alpha1AuthProviderApiFp = function (
|
||||
configuration?: Configuration
|
||||
) {
|
||||
const localVarAxiosParamCreator =
|
||||
ApiConsoleHaloRunV1alpha1AuthProviderApiAxiosParamCreator(configuration);
|
||||
return {
|
||||
/**
|
||||
* Disables an auth provider
|
||||
* @param {string} name
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async disableAuthProvider(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthProvider>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.disableAuthProvider(name, options);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Enables an auth provider
|
||||
* @param {string} name
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async enableAuthProvider(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthProvider>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.enableAuthProvider(name, options);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Lists all auth providers
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async listAuthProviders(
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<Array<ListedAuthProvider>>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.listAuthProviders(options);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* ApiConsoleHaloRunV1alpha1AuthProviderApi - factory interface
|
||||
* @export
|
||||
*/
|
||||
export const ApiConsoleHaloRunV1alpha1AuthProviderApiFactory = function (
|
||||
configuration?: Configuration,
|
||||
basePath?: string,
|
||||
axios?: AxiosInstance
|
||||
) {
|
||||
const localVarFp = ApiConsoleHaloRunV1alpha1AuthProviderApiFp(configuration);
|
||||
return {
|
||||
/**
|
||||
* Disables an auth provider
|
||||
* @param {ApiConsoleHaloRunV1alpha1AuthProviderApiDisableAuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
disableAuthProvider(
|
||||
requestParameters: ApiConsoleHaloRunV1alpha1AuthProviderApiDisableAuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<AuthProvider> {
|
||||
return localVarFp
|
||||
.disableAuthProvider(requestParameters.name, options)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Enables an auth provider
|
||||
* @param {ApiConsoleHaloRunV1alpha1AuthProviderApiEnableAuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
enableAuthProvider(
|
||||
requestParameters: ApiConsoleHaloRunV1alpha1AuthProviderApiEnableAuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<AuthProvider> {
|
||||
return localVarFp
|
||||
.enableAuthProvider(requestParameters.name, options)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Lists all auth providers
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listAuthProviders(
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<Array<ListedAuthProvider>> {
|
||||
return localVarFp
|
||||
.listAuthProviders(options)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Request parameters for disableAuthProvider operation in ApiConsoleHaloRunV1alpha1AuthProviderApi.
|
||||
* @export
|
||||
* @interface ApiConsoleHaloRunV1alpha1AuthProviderApiDisableAuthProviderRequest
|
||||
*/
|
||||
export interface ApiConsoleHaloRunV1alpha1AuthProviderApiDisableAuthProviderRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiConsoleHaloRunV1alpha1AuthProviderApiDisableAuthProvider
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for enableAuthProvider operation in ApiConsoleHaloRunV1alpha1AuthProviderApi.
|
||||
* @export
|
||||
* @interface ApiConsoleHaloRunV1alpha1AuthProviderApiEnableAuthProviderRequest
|
||||
*/
|
||||
export interface ApiConsoleHaloRunV1alpha1AuthProviderApiEnableAuthProviderRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiConsoleHaloRunV1alpha1AuthProviderApiEnableAuthProvider
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* ApiConsoleHaloRunV1alpha1AuthProviderApi - object-oriented interface
|
||||
* @export
|
||||
* @class ApiConsoleHaloRunV1alpha1AuthProviderApi
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class ApiConsoleHaloRunV1alpha1AuthProviderApi extends BaseAPI {
|
||||
/**
|
||||
* Disables an auth provider
|
||||
* @param {ApiConsoleHaloRunV1alpha1AuthProviderApiDisableAuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof ApiConsoleHaloRunV1alpha1AuthProviderApi
|
||||
*/
|
||||
public disableAuthProvider(
|
||||
requestParameters: ApiConsoleHaloRunV1alpha1AuthProviderApiDisableAuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return ApiConsoleHaloRunV1alpha1AuthProviderApiFp(this.configuration)
|
||||
.disableAuthProvider(requestParameters.name, options)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables an auth provider
|
||||
* @param {ApiConsoleHaloRunV1alpha1AuthProviderApiEnableAuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof ApiConsoleHaloRunV1alpha1AuthProviderApi
|
||||
*/
|
||||
public enableAuthProvider(
|
||||
requestParameters: ApiConsoleHaloRunV1alpha1AuthProviderApiEnableAuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return ApiConsoleHaloRunV1alpha1AuthProviderApiFp(this.configuration)
|
||||
.enableAuthProvider(requestParameters.name, options)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all auth providers
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof ApiConsoleHaloRunV1alpha1AuthProviderApi
|
||||
*/
|
||||
public listAuthProviders(options?: AxiosRequestConfig) {
|
||||
return ApiConsoleHaloRunV1alpha1AuthProviderApiFp(this.configuration)
|
||||
.listAuthProviders(options)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,793 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import type { Configuration } from "../configuration";
|
||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios";
|
||||
import globalAxios from "axios";
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import {
|
||||
DUMMY_BASE_URL,
|
||||
assertParamExists,
|
||||
setApiKeyToObject,
|
||||
setBasicAuthToObject,
|
||||
setBearerAuthToObject,
|
||||
setOAuthToObject,
|
||||
setSearchParams,
|
||||
serializeDataIfNeeded,
|
||||
toPathString,
|
||||
createRequestFunction,
|
||||
} from "../common";
|
||||
// @ts-ignore
|
||||
import {
|
||||
BASE_PATH,
|
||||
COLLECTION_FORMATS,
|
||||
RequestArgs,
|
||||
BaseAPI,
|
||||
RequiredError,
|
||||
} from "../base";
|
||||
// @ts-ignore
|
||||
import { AuthProvider } from "../models";
|
||||
// @ts-ignore
|
||||
import { AuthProviderList } from "../models";
|
||||
/**
|
||||
* AuthHaloRunV1alpha1AuthProviderApi - axios parameter creator
|
||||
* @export
|
||||
*/
|
||||
export const AuthHaloRunV1alpha1AuthProviderApiAxiosParamCreator = function (
|
||||
configuration?: Configuration
|
||||
) {
|
||||
return {
|
||||
/**
|
||||
* Create auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthProvider} [authProvider] Fresh authprovider
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
createauthHaloRunV1alpha1AuthProvider: async (
|
||||
authProvider?: AuthProvider,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/apis/auth.halo.run/v1alpha1/authproviders`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "POST",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
localVarHeaderParameter["Content-Type"] = "application/json";
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(
|
||||
authProvider,
|
||||
localVarRequestOptions,
|
||||
configuration
|
||||
);
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Delete auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {string} name Name of authprovider
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
deleteauthHaloRunV1alpha1AuthProvider: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists("deleteauthHaloRunV1alpha1AuthProvider", "name", name);
|
||||
const localVarPath =
|
||||
`/apis/auth.halo.run/v1alpha1/authproviders/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "DELETE",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Get auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {string} name Name of authprovider
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getauthHaloRunV1alpha1AuthProvider: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists("getauthHaloRunV1alpha1AuthProvider", "name", name);
|
||||
const localVarPath =
|
||||
`/apis/auth.halo.run/v1alpha1/authproviders/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "GET",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* List auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {number} [page] The page number. Zero indicates no page.
|
||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listauthHaloRunV1alpha1AuthProvider: async (
|
||||
page?: number,
|
||||
size?: number,
|
||||
labelSelector?: Array<string>,
|
||||
fieldSelector?: Array<string>,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/apis/auth.halo.run/v1alpha1/authproviders`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "GET",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
if (page !== undefined) {
|
||||
localVarQueryParameter["page"] = page;
|
||||
}
|
||||
|
||||
if (size !== undefined) {
|
||||
localVarQueryParameter["size"] = size;
|
||||
}
|
||||
|
||||
if (labelSelector) {
|
||||
localVarQueryParameter["labelSelector"] = labelSelector;
|
||||
}
|
||||
|
||||
if (fieldSelector) {
|
||||
localVarQueryParameter["fieldSelector"] = fieldSelector;
|
||||
}
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Update auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {string} name Name of authprovider
|
||||
* @param {AuthProvider} [authProvider] Updated authprovider
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
updateauthHaloRunV1alpha1AuthProvider: async (
|
||||
name: string,
|
||||
authProvider?: AuthProvider,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists("updateauthHaloRunV1alpha1AuthProvider", "name", name);
|
||||
const localVarPath =
|
||||
`/apis/auth.halo.run/v1alpha1/authproviders/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "PUT",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
localVarHeaderParameter["Content-Type"] = "application/json";
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(
|
||||
authProvider,
|
||||
localVarRequestOptions,
|
||||
configuration
|
||||
);
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* AuthHaloRunV1alpha1AuthProviderApi - functional programming interface
|
||||
* @export
|
||||
*/
|
||||
export const AuthHaloRunV1alpha1AuthProviderApiFp = function (
|
||||
configuration?: Configuration
|
||||
) {
|
||||
const localVarAxiosParamCreator =
|
||||
AuthHaloRunV1alpha1AuthProviderApiAxiosParamCreator(configuration);
|
||||
return {
|
||||
/**
|
||||
* Create auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthProvider} [authProvider] Fresh authprovider
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async createauthHaloRunV1alpha1AuthProvider(
|
||||
authProvider?: AuthProvider,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthProvider>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.createauthHaloRunV1alpha1AuthProvider(
|
||||
authProvider,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Delete auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {string} name Name of authprovider
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async deleteauthHaloRunV1alpha1AuthProvider(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.deleteauthHaloRunV1alpha1AuthProvider(
|
||||
name,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Get auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {string} name Name of authprovider
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async getauthHaloRunV1alpha1AuthProvider(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthProvider>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.getauthHaloRunV1alpha1AuthProvider(
|
||||
name,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* List auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {number} [page] The page number. Zero indicates no page.
|
||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async listauthHaloRunV1alpha1AuthProvider(
|
||||
page?: number,
|
||||
size?: number,
|
||||
labelSelector?: Array<string>,
|
||||
fieldSelector?: Array<string>,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<AuthProviderList>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.listauthHaloRunV1alpha1AuthProvider(
|
||||
page,
|
||||
size,
|
||||
labelSelector,
|
||||
fieldSelector,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Update auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {string} name Name of authprovider
|
||||
* @param {AuthProvider} [authProvider] Updated authprovider
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async updateauthHaloRunV1alpha1AuthProvider(
|
||||
name: string,
|
||||
authProvider?: AuthProvider,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthProvider>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.updateauthHaloRunV1alpha1AuthProvider(
|
||||
name,
|
||||
authProvider,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* AuthHaloRunV1alpha1AuthProviderApi - factory interface
|
||||
* @export
|
||||
*/
|
||||
export const AuthHaloRunV1alpha1AuthProviderApiFactory = function (
|
||||
configuration?: Configuration,
|
||||
basePath?: string,
|
||||
axios?: AxiosInstance
|
||||
) {
|
||||
const localVarFp = AuthHaloRunV1alpha1AuthProviderApiFp(configuration);
|
||||
return {
|
||||
/**
|
||||
* Create auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiCreateauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
createauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiCreateauthHaloRunV1alpha1AuthProviderRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<AuthProvider> {
|
||||
return localVarFp
|
||||
.createauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters.authProvider,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Delete auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiDeleteauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
deleteauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiDeleteauthHaloRunV1alpha1AuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<void> {
|
||||
return localVarFp
|
||||
.deleteauthHaloRunV1alpha1AuthProvider(requestParameters.name, options)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Get auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiGetauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiGetauthHaloRunV1alpha1AuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<AuthProvider> {
|
||||
return localVarFp
|
||||
.getauthHaloRunV1alpha1AuthProvider(requestParameters.name, options)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* List auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProviderRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<AuthProviderList> {
|
||||
return localVarFp
|
||||
.listauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters.page,
|
||||
requestParameters.size,
|
||||
requestParameters.labelSelector,
|
||||
requestParameters.fieldSelector,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Update auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiUpdateauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
updateauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiUpdateauthHaloRunV1alpha1AuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<AuthProvider> {
|
||||
return localVarFp
|
||||
.updateauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters.name,
|
||||
requestParameters.authProvider,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Request parameters for createauthHaloRunV1alpha1AuthProvider operation in AuthHaloRunV1alpha1AuthProviderApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1AuthProviderApiCreateauthHaloRunV1alpha1AuthProviderRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1AuthProviderApiCreateauthHaloRunV1alpha1AuthProviderRequest {
|
||||
/**
|
||||
* Fresh authprovider
|
||||
* @type {AuthProvider}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApiCreateauthHaloRunV1alpha1AuthProvider
|
||||
*/
|
||||
readonly authProvider?: AuthProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for deleteauthHaloRunV1alpha1AuthProvider operation in AuthHaloRunV1alpha1AuthProviderApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1AuthProviderApiDeleteauthHaloRunV1alpha1AuthProviderRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1AuthProviderApiDeleteauthHaloRunV1alpha1AuthProviderRequest {
|
||||
/**
|
||||
* Name of authprovider
|
||||
* @type {string}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApiDeleteauthHaloRunV1alpha1AuthProvider
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for getauthHaloRunV1alpha1AuthProvider operation in AuthHaloRunV1alpha1AuthProviderApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1AuthProviderApiGetauthHaloRunV1alpha1AuthProviderRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1AuthProviderApiGetauthHaloRunV1alpha1AuthProviderRequest {
|
||||
/**
|
||||
* Name of authprovider
|
||||
* @type {string}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApiGetauthHaloRunV1alpha1AuthProvider
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for listauthHaloRunV1alpha1AuthProvider operation in AuthHaloRunV1alpha1AuthProviderApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProviderRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProviderRequest {
|
||||
/**
|
||||
* The page number. Zero indicates no page.
|
||||
* @type {number}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProvider
|
||||
*/
|
||||
readonly page?: number;
|
||||
|
||||
/**
|
||||
* Size of one page. Zero indicates no limit.
|
||||
* @type {number}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProvider
|
||||
*/
|
||||
readonly size?: number;
|
||||
|
||||
/**
|
||||
* Label selector for filtering.
|
||||
* @type {Array<string>}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProvider
|
||||
*/
|
||||
readonly labelSelector?: Array<string>;
|
||||
|
||||
/**
|
||||
* Field selector for filtering.
|
||||
* @type {Array<string>}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProvider
|
||||
*/
|
||||
readonly fieldSelector?: Array<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for updateauthHaloRunV1alpha1AuthProvider operation in AuthHaloRunV1alpha1AuthProviderApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1AuthProviderApiUpdateauthHaloRunV1alpha1AuthProviderRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1AuthProviderApiUpdateauthHaloRunV1alpha1AuthProviderRequest {
|
||||
/**
|
||||
* Name of authprovider
|
||||
* @type {string}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApiUpdateauthHaloRunV1alpha1AuthProvider
|
||||
*/
|
||||
readonly name: string;
|
||||
|
||||
/**
|
||||
* Updated authprovider
|
||||
* @type {AuthProvider}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApiUpdateauthHaloRunV1alpha1AuthProvider
|
||||
*/
|
||||
readonly authProvider?: AuthProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* AuthHaloRunV1alpha1AuthProviderApi - object-oriented interface
|
||||
* @export
|
||||
* @class AuthHaloRunV1alpha1AuthProviderApi
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class AuthHaloRunV1alpha1AuthProviderApi extends BaseAPI {
|
||||
/**
|
||||
* Create auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiCreateauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApi
|
||||
*/
|
||||
public createauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiCreateauthHaloRunV1alpha1AuthProviderRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1AuthProviderApiFp(this.configuration)
|
||||
.createauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters.authProvider,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiDeleteauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApi
|
||||
*/
|
||||
public deleteauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiDeleteauthHaloRunV1alpha1AuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1AuthProviderApiFp(this.configuration)
|
||||
.deleteauthHaloRunV1alpha1AuthProvider(requestParameters.name, options)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiGetauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApi
|
||||
*/
|
||||
public getauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiGetauthHaloRunV1alpha1AuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1AuthProviderApiFp(this.configuration)
|
||||
.getauthHaloRunV1alpha1AuthProvider(requestParameters.name, options)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* List auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApi
|
||||
*/
|
||||
public listauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiListauthHaloRunV1alpha1AuthProviderRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1AuthProviderApiFp(this.configuration)
|
||||
.listauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters.page,
|
||||
requestParameters.size,
|
||||
requestParameters.labelSelector,
|
||||
requestParameters.fieldSelector,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update auth.halo.run/v1alpha1/AuthProvider
|
||||
* @param {AuthHaloRunV1alpha1AuthProviderApiUpdateauthHaloRunV1alpha1AuthProviderRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1AuthProviderApi
|
||||
*/
|
||||
public updateauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters: AuthHaloRunV1alpha1AuthProviderApiUpdateauthHaloRunV1alpha1AuthProviderRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1AuthProviderApiFp(this.configuration)
|
||||
.updateauthHaloRunV1alpha1AuthProvider(
|
||||
requestParameters.name,
|
||||
requestParameters.authProvider,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,804 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import type { Configuration } from "../configuration";
|
||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios";
|
||||
import globalAxios from "axios";
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import {
|
||||
DUMMY_BASE_URL,
|
||||
assertParamExists,
|
||||
setApiKeyToObject,
|
||||
setBasicAuthToObject,
|
||||
setBearerAuthToObject,
|
||||
setOAuthToObject,
|
||||
setSearchParams,
|
||||
serializeDataIfNeeded,
|
||||
toPathString,
|
||||
createRequestFunction,
|
||||
} from "../common";
|
||||
// @ts-ignore
|
||||
import {
|
||||
BASE_PATH,
|
||||
COLLECTION_FORMATS,
|
||||
RequestArgs,
|
||||
BaseAPI,
|
||||
RequiredError,
|
||||
} from "../base";
|
||||
// @ts-ignore
|
||||
import { UserConnection } from "../models";
|
||||
// @ts-ignore
|
||||
import { UserConnectionList } from "../models";
|
||||
/**
|
||||
* AuthHaloRunV1alpha1UserConnectionApi - axios parameter creator
|
||||
* @export
|
||||
*/
|
||||
export const AuthHaloRunV1alpha1UserConnectionApiAxiosParamCreator = function (
|
||||
configuration?: Configuration
|
||||
) {
|
||||
return {
|
||||
/**
|
||||
* Create auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {UserConnection} [userConnection] Fresh userconnection
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
createauthHaloRunV1alpha1UserConnection: async (
|
||||
userConnection?: UserConnection,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/apis/auth.halo.run/v1alpha1/userconnections`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "POST",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
localVarHeaderParameter["Content-Type"] = "application/json";
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(
|
||||
userConnection,
|
||||
localVarRequestOptions,
|
||||
configuration
|
||||
);
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Delete auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {string} name Name of userconnection
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
deleteauthHaloRunV1alpha1UserConnection: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists(
|
||||
"deleteauthHaloRunV1alpha1UserConnection",
|
||||
"name",
|
||||
name
|
||||
);
|
||||
const localVarPath =
|
||||
`/apis/auth.halo.run/v1alpha1/userconnections/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "DELETE",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Get auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {string} name Name of userconnection
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getauthHaloRunV1alpha1UserConnection: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists("getauthHaloRunV1alpha1UserConnection", "name", name);
|
||||
const localVarPath =
|
||||
`/apis/auth.halo.run/v1alpha1/userconnections/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "GET",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* List auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {number} [page] The page number. Zero indicates no page.
|
||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listauthHaloRunV1alpha1UserConnection: async (
|
||||
page?: number,
|
||||
size?: number,
|
||||
labelSelector?: Array<string>,
|
||||
fieldSelector?: Array<string>,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/apis/auth.halo.run/v1alpha1/userconnections`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "GET",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
if (page !== undefined) {
|
||||
localVarQueryParameter["page"] = page;
|
||||
}
|
||||
|
||||
if (size !== undefined) {
|
||||
localVarQueryParameter["size"] = size;
|
||||
}
|
||||
|
||||
if (labelSelector) {
|
||||
localVarQueryParameter["labelSelector"] = labelSelector;
|
||||
}
|
||||
|
||||
if (fieldSelector) {
|
||||
localVarQueryParameter["fieldSelector"] = fieldSelector;
|
||||
}
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Update auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {string} name Name of userconnection
|
||||
* @param {UserConnection} [userConnection] Updated userconnection
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
updateauthHaloRunV1alpha1UserConnection: async (
|
||||
name: string,
|
||||
userConnection?: UserConnection,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists(
|
||||
"updateauthHaloRunV1alpha1UserConnection",
|
||||
"name",
|
||||
name
|
||||
);
|
||||
const localVarPath =
|
||||
`/apis/auth.halo.run/v1alpha1/userconnections/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "PUT",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
localVarHeaderParameter["Content-Type"] = "application/json";
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(
|
||||
userConnection,
|
||||
localVarRequestOptions,
|
||||
configuration
|
||||
);
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* AuthHaloRunV1alpha1UserConnectionApi - functional programming interface
|
||||
* @export
|
||||
*/
|
||||
export const AuthHaloRunV1alpha1UserConnectionApiFp = function (
|
||||
configuration?: Configuration
|
||||
) {
|
||||
const localVarAxiosParamCreator =
|
||||
AuthHaloRunV1alpha1UserConnectionApiAxiosParamCreator(configuration);
|
||||
return {
|
||||
/**
|
||||
* Create auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {UserConnection} [userConnection] Fresh userconnection
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async createauthHaloRunV1alpha1UserConnection(
|
||||
userConnection?: UserConnection,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserConnection>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.createauthHaloRunV1alpha1UserConnection(
|
||||
userConnection,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Delete auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {string} name Name of userconnection
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async deleteauthHaloRunV1alpha1UserConnection(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.deleteauthHaloRunV1alpha1UserConnection(
|
||||
name,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Get auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {string} name Name of userconnection
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async getauthHaloRunV1alpha1UserConnection(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserConnection>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.getauthHaloRunV1alpha1UserConnection(
|
||||
name,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* List auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {number} [page] The page number. Zero indicates no page.
|
||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async listauthHaloRunV1alpha1UserConnection(
|
||||
page?: number,
|
||||
size?: number,
|
||||
labelSelector?: Array<string>,
|
||||
fieldSelector?: Array<string>,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<UserConnectionList>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.listauthHaloRunV1alpha1UserConnection(
|
||||
page,
|
||||
size,
|
||||
labelSelector,
|
||||
fieldSelector,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Update auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {string} name Name of userconnection
|
||||
* @param {UserConnection} [userConnection] Updated userconnection
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async updateauthHaloRunV1alpha1UserConnection(
|
||||
name: string,
|
||||
userConnection?: UserConnection,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserConnection>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.updateauthHaloRunV1alpha1UserConnection(
|
||||
name,
|
||||
userConnection,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* AuthHaloRunV1alpha1UserConnectionApi - factory interface
|
||||
* @export
|
||||
*/
|
||||
export const AuthHaloRunV1alpha1UserConnectionApiFactory = function (
|
||||
configuration?: Configuration,
|
||||
basePath?: string,
|
||||
axios?: AxiosInstance
|
||||
) {
|
||||
const localVarFp = AuthHaloRunV1alpha1UserConnectionApiFp(configuration);
|
||||
return {
|
||||
/**
|
||||
* Create auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiCreateauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
createauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiCreateauthHaloRunV1alpha1UserConnectionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<UserConnection> {
|
||||
return localVarFp
|
||||
.createauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters.userConnection,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Delete auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiDeleteauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
deleteauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiDeleteauthHaloRunV1alpha1UserConnectionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<void> {
|
||||
return localVarFp
|
||||
.deleteauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters.name,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Get auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiGetauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiGetauthHaloRunV1alpha1UserConnectionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<UserConnection> {
|
||||
return localVarFp
|
||||
.getauthHaloRunV1alpha1UserConnection(requestParameters.name, options)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* List auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnectionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<UserConnectionList> {
|
||||
return localVarFp
|
||||
.listauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters.page,
|
||||
requestParameters.size,
|
||||
requestParameters.labelSelector,
|
||||
requestParameters.fieldSelector,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Update auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiUpdateauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
updateauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiUpdateauthHaloRunV1alpha1UserConnectionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<UserConnection> {
|
||||
return localVarFp
|
||||
.updateauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters.name,
|
||||
requestParameters.userConnection,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Request parameters for createauthHaloRunV1alpha1UserConnection operation in AuthHaloRunV1alpha1UserConnectionApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1UserConnectionApiCreateauthHaloRunV1alpha1UserConnectionRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1UserConnectionApiCreateauthHaloRunV1alpha1UserConnectionRequest {
|
||||
/**
|
||||
* Fresh userconnection
|
||||
* @type {UserConnection}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApiCreateauthHaloRunV1alpha1UserConnection
|
||||
*/
|
||||
readonly userConnection?: UserConnection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for deleteauthHaloRunV1alpha1UserConnection operation in AuthHaloRunV1alpha1UserConnectionApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1UserConnectionApiDeleteauthHaloRunV1alpha1UserConnectionRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1UserConnectionApiDeleteauthHaloRunV1alpha1UserConnectionRequest {
|
||||
/**
|
||||
* Name of userconnection
|
||||
* @type {string}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApiDeleteauthHaloRunV1alpha1UserConnection
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for getauthHaloRunV1alpha1UserConnection operation in AuthHaloRunV1alpha1UserConnectionApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1UserConnectionApiGetauthHaloRunV1alpha1UserConnectionRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1UserConnectionApiGetauthHaloRunV1alpha1UserConnectionRequest {
|
||||
/**
|
||||
* Name of userconnection
|
||||
* @type {string}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApiGetauthHaloRunV1alpha1UserConnection
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for listauthHaloRunV1alpha1UserConnection operation in AuthHaloRunV1alpha1UserConnectionApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnectionRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnectionRequest {
|
||||
/**
|
||||
* The page number. Zero indicates no page.
|
||||
* @type {number}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnection
|
||||
*/
|
||||
readonly page?: number;
|
||||
|
||||
/**
|
||||
* Size of one page. Zero indicates no limit.
|
||||
* @type {number}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnection
|
||||
*/
|
||||
readonly size?: number;
|
||||
|
||||
/**
|
||||
* Label selector for filtering.
|
||||
* @type {Array<string>}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnection
|
||||
*/
|
||||
readonly labelSelector?: Array<string>;
|
||||
|
||||
/**
|
||||
* Field selector for filtering.
|
||||
* @type {Array<string>}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnection
|
||||
*/
|
||||
readonly fieldSelector?: Array<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for updateauthHaloRunV1alpha1UserConnection operation in AuthHaloRunV1alpha1UserConnectionApi.
|
||||
* @export
|
||||
* @interface AuthHaloRunV1alpha1UserConnectionApiUpdateauthHaloRunV1alpha1UserConnectionRequest
|
||||
*/
|
||||
export interface AuthHaloRunV1alpha1UserConnectionApiUpdateauthHaloRunV1alpha1UserConnectionRequest {
|
||||
/**
|
||||
* Name of userconnection
|
||||
* @type {string}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApiUpdateauthHaloRunV1alpha1UserConnection
|
||||
*/
|
||||
readonly name: string;
|
||||
|
||||
/**
|
||||
* Updated userconnection
|
||||
* @type {UserConnection}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApiUpdateauthHaloRunV1alpha1UserConnection
|
||||
*/
|
||||
readonly userConnection?: UserConnection;
|
||||
}
|
||||
|
||||
/**
|
||||
* AuthHaloRunV1alpha1UserConnectionApi - object-oriented interface
|
||||
* @export
|
||||
* @class AuthHaloRunV1alpha1UserConnectionApi
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class AuthHaloRunV1alpha1UserConnectionApi extends BaseAPI {
|
||||
/**
|
||||
* Create auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiCreateauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApi
|
||||
*/
|
||||
public createauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiCreateauthHaloRunV1alpha1UserConnectionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1UserConnectionApiFp(this.configuration)
|
||||
.createauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters.userConnection,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiDeleteauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApi
|
||||
*/
|
||||
public deleteauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiDeleteauthHaloRunV1alpha1UserConnectionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1UserConnectionApiFp(this.configuration)
|
||||
.deleteauthHaloRunV1alpha1UserConnection(requestParameters.name, options)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiGetauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApi
|
||||
*/
|
||||
public getauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiGetauthHaloRunV1alpha1UserConnectionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1UserConnectionApiFp(this.configuration)
|
||||
.getauthHaloRunV1alpha1UserConnection(requestParameters.name, options)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* List auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApi
|
||||
*/
|
||||
public listauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiListauthHaloRunV1alpha1UserConnectionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1UserConnectionApiFp(this.configuration)
|
||||
.listauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters.page,
|
||||
requestParameters.size,
|
||||
requestParameters.labelSelector,
|
||||
requestParameters.fieldSelector,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update auth.halo.run/v1alpha1/UserConnection
|
||||
* @param {AuthHaloRunV1alpha1UserConnectionApiUpdateauthHaloRunV1alpha1UserConnectionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AuthHaloRunV1alpha1UserConnectionApi
|
||||
*/
|
||||
public updateauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters: AuthHaloRunV1alpha1UserConnectionApiUpdateauthHaloRunV1alpha1UserConnectionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return AuthHaloRunV1alpha1UserConnectionApiFp(this.configuration)
|
||||
.updateauthHaloRunV1alpha1UserConnection(
|
||||
requestParameters.name,
|
||||
requestParameters.userConnection,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,826 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import type { Configuration } from "../configuration";
|
||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios";
|
||||
import globalAxios from "axios";
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import {
|
||||
DUMMY_BASE_URL,
|
||||
assertParamExists,
|
||||
setApiKeyToObject,
|
||||
setBasicAuthToObject,
|
||||
setBearerAuthToObject,
|
||||
setOAuthToObject,
|
||||
setSearchParams,
|
||||
serializeDataIfNeeded,
|
||||
toPathString,
|
||||
createRequestFunction,
|
||||
} from "../common";
|
||||
// @ts-ignore
|
||||
import {
|
||||
BASE_PATH,
|
||||
COLLECTION_FORMATS,
|
||||
RequestArgs,
|
||||
BaseAPI,
|
||||
RequiredError,
|
||||
} from "../base";
|
||||
// @ts-ignore
|
||||
import { ExtensionDefinition } from "../models";
|
||||
// @ts-ignore
|
||||
import { ExtensionDefinitionList } from "../models";
|
||||
/**
|
||||
* PluginHaloRunV1alpha1ExtensionDefinitionApi - axios parameter creator
|
||||
* @export
|
||||
*/
|
||||
export const PluginHaloRunV1alpha1ExtensionDefinitionApiAxiosParamCreator =
|
||||
function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
* Create plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {ExtensionDefinition} [extensionDefinition] Fresh extensiondefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
createpluginHaloRunV1alpha1ExtensionDefinition: async (
|
||||
extensionDefinition?: ExtensionDefinition,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/apis/plugin.halo.run/v1alpha1/extensiondefinitions`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "POST",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
localVarHeaderParameter["Content-Type"] = "application/json";
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(
|
||||
extensionDefinition,
|
||||
localVarRequestOptions,
|
||||
configuration
|
||||
);
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Delete plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {string} name Name of extensiondefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
deletepluginHaloRunV1alpha1ExtensionDefinition: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists(
|
||||
"deletepluginHaloRunV1alpha1ExtensionDefinition",
|
||||
"name",
|
||||
name
|
||||
);
|
||||
const localVarPath =
|
||||
`/apis/plugin.halo.run/v1alpha1/extensiondefinitions/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "DELETE",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Get plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {string} name Name of extensiondefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getpluginHaloRunV1alpha1ExtensionDefinition: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists(
|
||||
"getpluginHaloRunV1alpha1ExtensionDefinition",
|
||||
"name",
|
||||
name
|
||||
);
|
||||
const localVarPath =
|
||||
`/apis/plugin.halo.run/v1alpha1/extensiondefinitions/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "GET",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* List plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {number} [page] The page number. Zero indicates no page.
|
||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listpluginHaloRunV1alpha1ExtensionDefinition: async (
|
||||
page?: number,
|
||||
size?: number,
|
||||
labelSelector?: Array<string>,
|
||||
fieldSelector?: Array<string>,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/apis/plugin.halo.run/v1alpha1/extensiondefinitions`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "GET",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
if (page !== undefined) {
|
||||
localVarQueryParameter["page"] = page;
|
||||
}
|
||||
|
||||
if (size !== undefined) {
|
||||
localVarQueryParameter["size"] = size;
|
||||
}
|
||||
|
||||
if (labelSelector) {
|
||||
localVarQueryParameter["labelSelector"] = labelSelector;
|
||||
}
|
||||
|
||||
if (fieldSelector) {
|
||||
localVarQueryParameter["fieldSelector"] = fieldSelector;
|
||||
}
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Update plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {string} name Name of extensiondefinition
|
||||
* @param {ExtensionDefinition} [extensionDefinition] Updated extensiondefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
updatepluginHaloRunV1alpha1ExtensionDefinition: async (
|
||||
name: string,
|
||||
extensionDefinition?: ExtensionDefinition,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists(
|
||||
"updatepluginHaloRunV1alpha1ExtensionDefinition",
|
||||
"name",
|
||||
name
|
||||
);
|
||||
const localVarPath =
|
||||
`/apis/plugin.halo.run/v1alpha1/extensiondefinitions/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "PUT",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
localVarHeaderParameter["Content-Type"] = "application/json";
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(
|
||||
extensionDefinition,
|
||||
localVarRequestOptions,
|
||||
configuration
|
||||
);
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* PluginHaloRunV1alpha1ExtensionDefinitionApi - functional programming interface
|
||||
* @export
|
||||
*/
|
||||
export const PluginHaloRunV1alpha1ExtensionDefinitionApiFp = function (
|
||||
configuration?: Configuration
|
||||
) {
|
||||
const localVarAxiosParamCreator =
|
||||
PluginHaloRunV1alpha1ExtensionDefinitionApiAxiosParamCreator(configuration);
|
||||
return {
|
||||
/**
|
||||
* Create plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {ExtensionDefinition} [extensionDefinition] Fresh extensiondefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async createpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
extensionDefinition?: ExtensionDefinition,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<ExtensionDefinition>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.createpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
extensionDefinition,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Delete plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {string} name Name of extensiondefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async deletepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.deletepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
name,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Get plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {string} name Name of extensiondefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async getpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<ExtensionDefinition>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.getpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
name,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* List plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {number} [page] The page number. Zero indicates no page.
|
||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async listpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
page?: number,
|
||||
size?: number,
|
||||
labelSelector?: Array<string>,
|
||||
fieldSelector?: Array<string>,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<ExtensionDefinitionList>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.listpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
page,
|
||||
size,
|
||||
labelSelector,
|
||||
fieldSelector,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Update plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {string} name Name of extensiondefinition
|
||||
* @param {ExtensionDefinition} [extensionDefinition] Updated extensiondefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async updatepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
name: string,
|
||||
extensionDefinition?: ExtensionDefinition,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<ExtensionDefinition>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.updatepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
name,
|
||||
extensionDefinition,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* PluginHaloRunV1alpha1ExtensionDefinitionApi - factory interface
|
||||
* @export
|
||||
*/
|
||||
export const PluginHaloRunV1alpha1ExtensionDefinitionApiFactory = function (
|
||||
configuration?: Configuration,
|
||||
basePath?: string,
|
||||
axios?: AxiosInstance
|
||||
) {
|
||||
const localVarFp =
|
||||
PluginHaloRunV1alpha1ExtensionDefinitionApiFp(configuration);
|
||||
return {
|
||||
/**
|
||||
* Create plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiCreatepluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
createpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiCreatepluginHaloRunV1alpha1ExtensionDefinitionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<ExtensionDefinition> {
|
||||
return localVarFp
|
||||
.createpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.extensionDefinition,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Delete plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiDeletepluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
deletepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiDeletepluginHaloRunV1alpha1ExtensionDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<void> {
|
||||
return localVarFp
|
||||
.deletepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.name,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Get plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiGetpluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiGetpluginHaloRunV1alpha1ExtensionDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<ExtensionDefinition> {
|
||||
return localVarFp
|
||||
.getpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.name,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* List plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinitionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<ExtensionDefinitionList> {
|
||||
return localVarFp
|
||||
.listpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.page,
|
||||
requestParameters.size,
|
||||
requestParameters.labelSelector,
|
||||
requestParameters.fieldSelector,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Update plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
updatepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<ExtensionDefinition> {
|
||||
return localVarFp
|
||||
.updatepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.name,
|
||||
requestParameters.extensionDefinition,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Request parameters for createpluginHaloRunV1alpha1ExtensionDefinition operation in PluginHaloRunV1alpha1ExtensionDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionDefinitionApiCreatepluginHaloRunV1alpha1ExtensionDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionDefinitionApiCreatepluginHaloRunV1alpha1ExtensionDefinitionRequest {
|
||||
/**
|
||||
* Fresh extensiondefinition
|
||||
* @type {ExtensionDefinition}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApiCreatepluginHaloRunV1alpha1ExtensionDefinition
|
||||
*/
|
||||
readonly extensionDefinition?: ExtensionDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for deletepluginHaloRunV1alpha1ExtensionDefinition operation in PluginHaloRunV1alpha1ExtensionDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionDefinitionApiDeletepluginHaloRunV1alpha1ExtensionDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionDefinitionApiDeletepluginHaloRunV1alpha1ExtensionDefinitionRequest {
|
||||
/**
|
||||
* Name of extensiondefinition
|
||||
* @type {string}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApiDeletepluginHaloRunV1alpha1ExtensionDefinition
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for getpluginHaloRunV1alpha1ExtensionDefinition operation in PluginHaloRunV1alpha1ExtensionDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionDefinitionApiGetpluginHaloRunV1alpha1ExtensionDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionDefinitionApiGetpluginHaloRunV1alpha1ExtensionDefinitionRequest {
|
||||
/**
|
||||
* Name of extensiondefinition
|
||||
* @type {string}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApiGetpluginHaloRunV1alpha1ExtensionDefinition
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for listpluginHaloRunV1alpha1ExtensionDefinition operation in PluginHaloRunV1alpha1ExtensionDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinitionRequest {
|
||||
/**
|
||||
* The page number. Zero indicates no page.
|
||||
* @type {number}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinition
|
||||
*/
|
||||
readonly page?: number;
|
||||
|
||||
/**
|
||||
* Size of one page. Zero indicates no limit.
|
||||
* @type {number}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinition
|
||||
*/
|
||||
readonly size?: number;
|
||||
|
||||
/**
|
||||
* Label selector for filtering.
|
||||
* @type {Array<string>}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinition
|
||||
*/
|
||||
readonly labelSelector?: Array<string>;
|
||||
|
||||
/**
|
||||
* Field selector for filtering.
|
||||
* @type {Array<string>}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinition
|
||||
*/
|
||||
readonly fieldSelector?: Array<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for updatepluginHaloRunV1alpha1ExtensionDefinition operation in PluginHaloRunV1alpha1ExtensionDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionDefinitionRequest {
|
||||
/**
|
||||
* Name of extensiondefinition
|
||||
* @type {string}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionDefinition
|
||||
*/
|
||||
readonly name: string;
|
||||
|
||||
/**
|
||||
* Updated extensiondefinition
|
||||
* @type {ExtensionDefinition}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionDefinition
|
||||
*/
|
||||
readonly extensionDefinition?: ExtensionDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* PluginHaloRunV1alpha1ExtensionDefinitionApi - object-oriented interface
|
||||
* @export
|
||||
* @class PluginHaloRunV1alpha1ExtensionDefinitionApi
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class PluginHaloRunV1alpha1ExtensionDefinitionApi extends BaseAPI {
|
||||
/**
|
||||
* Create plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiCreatepluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApi
|
||||
*/
|
||||
public createpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiCreatepluginHaloRunV1alpha1ExtensionDefinitionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionDefinitionApiFp(this.configuration)
|
||||
.createpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.extensionDefinition,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiDeletepluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApi
|
||||
*/
|
||||
public deletepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiDeletepluginHaloRunV1alpha1ExtensionDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionDefinitionApiFp(this.configuration)
|
||||
.deletepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.name,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiGetpluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApi
|
||||
*/
|
||||
public getpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiGetpluginHaloRunV1alpha1ExtensionDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionDefinitionApiFp(this.configuration)
|
||||
.getpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.name,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* List plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApi
|
||||
*/
|
||||
public listpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiListpluginHaloRunV1alpha1ExtensionDefinitionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionDefinitionApiFp(this.configuration)
|
||||
.listpluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.page,
|
||||
requestParameters.size,
|
||||
requestParameters.labelSelector,
|
||||
requestParameters.fieldSelector,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update plugin.halo.run/v1alpha1/ExtensionDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionDefinitionApi
|
||||
*/
|
||||
public updatepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionDefinitionApiFp(this.configuration)
|
||||
.updatepluginHaloRunV1alpha1ExtensionDefinition(
|
||||
requestParameters.name,
|
||||
requestParameters.extensionDefinition,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,839 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import type { Configuration } from "../configuration";
|
||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios";
|
||||
import globalAxios from "axios";
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import {
|
||||
DUMMY_BASE_URL,
|
||||
assertParamExists,
|
||||
setApiKeyToObject,
|
||||
setBasicAuthToObject,
|
||||
setBearerAuthToObject,
|
||||
setOAuthToObject,
|
||||
setSearchParams,
|
||||
serializeDataIfNeeded,
|
||||
toPathString,
|
||||
createRequestFunction,
|
||||
} from "../common";
|
||||
// @ts-ignore
|
||||
import {
|
||||
BASE_PATH,
|
||||
COLLECTION_FORMATS,
|
||||
RequestArgs,
|
||||
BaseAPI,
|
||||
RequiredError,
|
||||
} from "../base";
|
||||
// @ts-ignore
|
||||
import { ExtensionPointDefinition } from "../models";
|
||||
// @ts-ignore
|
||||
import { ExtensionPointDefinitionList } from "../models";
|
||||
/**
|
||||
* PluginHaloRunV1alpha1ExtensionPointDefinitionApi - axios parameter creator
|
||||
* @export
|
||||
*/
|
||||
export const PluginHaloRunV1alpha1ExtensionPointDefinitionApiAxiosParamCreator =
|
||||
function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
* Create plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {ExtensionPointDefinition} [extensionPointDefinition] Fresh extensionpointdefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
createpluginHaloRunV1alpha1ExtensionPointDefinition: async (
|
||||
extensionPointDefinition?: ExtensionPointDefinition,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/apis/plugin.halo.run/v1alpha1/extensionpointdefinitions`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "POST",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
localVarHeaderParameter["Content-Type"] = "application/json";
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(
|
||||
extensionPointDefinition,
|
||||
localVarRequestOptions,
|
||||
configuration
|
||||
);
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Delete plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {string} name Name of extensionpointdefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
deletepluginHaloRunV1alpha1ExtensionPointDefinition: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists(
|
||||
"deletepluginHaloRunV1alpha1ExtensionPointDefinition",
|
||||
"name",
|
||||
name
|
||||
);
|
||||
const localVarPath =
|
||||
`/apis/plugin.halo.run/v1alpha1/extensionpointdefinitions/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "DELETE",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Get plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {string} name Name of extensionpointdefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getpluginHaloRunV1alpha1ExtensionPointDefinition: async (
|
||||
name: string,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists(
|
||||
"getpluginHaloRunV1alpha1ExtensionPointDefinition",
|
||||
"name",
|
||||
name
|
||||
);
|
||||
const localVarPath =
|
||||
`/apis/plugin.halo.run/v1alpha1/extensionpointdefinitions/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "GET",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* List plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {number} [page] The page number. Zero indicates no page.
|
||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listpluginHaloRunV1alpha1ExtensionPointDefinition: async (
|
||||
page?: number,
|
||||
size?: number,
|
||||
labelSelector?: Array<string>,
|
||||
fieldSelector?: Array<string>,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/apis/plugin.halo.run/v1alpha1/extensionpointdefinitions`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "GET",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
if (page !== undefined) {
|
||||
localVarQueryParameter["page"] = page;
|
||||
}
|
||||
|
||||
if (size !== undefined) {
|
||||
localVarQueryParameter["size"] = size;
|
||||
}
|
||||
|
||||
if (labelSelector) {
|
||||
localVarQueryParameter["labelSelector"] = labelSelector;
|
||||
}
|
||||
|
||||
if (fieldSelector) {
|
||||
localVarQueryParameter["fieldSelector"] = fieldSelector;
|
||||
}
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Update plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {string} name Name of extensionpointdefinition
|
||||
* @param {ExtensionPointDefinition} [extensionPointDefinition] Updated extensionpointdefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
updatepluginHaloRunV1alpha1ExtensionPointDefinition: async (
|
||||
name: string,
|
||||
extensionPointDefinition?: ExtensionPointDefinition,
|
||||
options: AxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
assertParamExists(
|
||||
"updatepluginHaloRunV1alpha1ExtensionPointDefinition",
|
||||
"name",
|
||||
name
|
||||
);
|
||||
const localVarPath =
|
||||
`/apis/plugin.halo.run/v1alpha1/extensionpointdefinitions/{name}`.replace(
|
||||
`{${"name"}}`,
|
||||
encodeURIComponent(String(name))
|
||||
);
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: "PUT",
|
||||
...baseOptions,
|
||||
...options,
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication BasicAuth required
|
||||
// http basic authentication required
|
||||
setBasicAuthToObject(localVarRequestOptions, configuration);
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
||||
|
||||
localVarHeaderParameter["Content-Type"] = "application/json";
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers,
|
||||
};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(
|
||||
extensionPointDefinition,
|
||||
localVarRequestOptions,
|
||||
configuration
|
||||
);
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* PluginHaloRunV1alpha1ExtensionPointDefinitionApi - functional programming interface
|
||||
* @export
|
||||
*/
|
||||
export const PluginHaloRunV1alpha1ExtensionPointDefinitionApiFp = function (
|
||||
configuration?: Configuration
|
||||
) {
|
||||
const localVarAxiosParamCreator =
|
||||
PluginHaloRunV1alpha1ExtensionPointDefinitionApiAxiosParamCreator(
|
||||
configuration
|
||||
);
|
||||
return {
|
||||
/**
|
||||
* Create plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {ExtensionPointDefinition} [extensionPointDefinition] Fresh extensionpointdefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async createpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
extensionPointDefinition?: ExtensionPointDefinition,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<ExtensionPointDefinition>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.createpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
extensionPointDefinition,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Delete plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {string} name Name of extensionpointdefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async deletepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.deletepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
name,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Get plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {string} name Name of extensionpointdefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async getpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
name: string,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<ExtensionPointDefinition>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.getpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
name,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* List plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {number} [page] The page number. Zero indicates no page.
|
||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async listpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
page?: number,
|
||||
size?: number,
|
||||
labelSelector?: Array<string>,
|
||||
fieldSelector?: Array<string>,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<ExtensionPointDefinitionList>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.listpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
page,
|
||||
size,
|
||||
labelSelector,
|
||||
fieldSelector,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Update plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {string} name Name of extensionpointdefinition
|
||||
* @param {ExtensionPointDefinition} [extensionPointDefinition] Updated extensionpointdefinition
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async updatepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
name: string,
|
||||
extensionPointDefinition?: ExtensionPointDefinition,
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<ExtensionPointDefinition>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.updatepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
name,
|
||||
extensionPointDefinition,
|
||||
options
|
||||
);
|
||||
return createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* PluginHaloRunV1alpha1ExtensionPointDefinitionApi - factory interface
|
||||
* @export
|
||||
*/
|
||||
export const PluginHaloRunV1alpha1ExtensionPointDefinitionApiFactory =
|
||||
function (
|
||||
configuration?: Configuration,
|
||||
basePath?: string,
|
||||
axios?: AxiosInstance
|
||||
) {
|
||||
const localVarFp =
|
||||
PluginHaloRunV1alpha1ExtensionPointDefinitionApiFp(configuration);
|
||||
return {
|
||||
/**
|
||||
* Create plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiCreatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
createpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiCreatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<ExtensionPointDefinition> {
|
||||
return localVarFp
|
||||
.createpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.extensionPointDefinition,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Delete plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiDeletepluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
deletepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiDeletepluginHaloRunV1alpha1ExtensionPointDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<void> {
|
||||
return localVarFp
|
||||
.deletepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.name,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Get plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiGetpluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiGetpluginHaloRunV1alpha1ExtensionPointDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<ExtensionPointDefinition> {
|
||||
return localVarFp
|
||||
.getpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.name,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* List plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
listpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinitionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<ExtensionPointDefinitionList> {
|
||||
return localVarFp
|
||||
.listpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.page,
|
||||
requestParameters.size,
|
||||
requestParameters.labelSelector,
|
||||
requestParameters.fieldSelector,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Update plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
updatepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
): AxiosPromise<ExtensionPointDefinition> {
|
||||
return localVarFp
|
||||
.updatepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.name,
|
||||
requestParameters.extensionPointDefinition,
|
||||
options
|
||||
)
|
||||
.then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Request parameters for createpluginHaloRunV1alpha1ExtensionPointDefinition operation in PluginHaloRunV1alpha1ExtensionPointDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiCreatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiCreatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest {
|
||||
/**
|
||||
* Fresh extensionpointdefinition
|
||||
* @type {ExtensionPointDefinition}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApiCreatepluginHaloRunV1alpha1ExtensionPointDefinition
|
||||
*/
|
||||
readonly extensionPointDefinition?: ExtensionPointDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for deletepluginHaloRunV1alpha1ExtensionPointDefinition operation in PluginHaloRunV1alpha1ExtensionPointDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiDeletepluginHaloRunV1alpha1ExtensionPointDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiDeletepluginHaloRunV1alpha1ExtensionPointDefinitionRequest {
|
||||
/**
|
||||
* Name of extensionpointdefinition
|
||||
* @type {string}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApiDeletepluginHaloRunV1alpha1ExtensionPointDefinition
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for getpluginHaloRunV1alpha1ExtensionPointDefinition operation in PluginHaloRunV1alpha1ExtensionPointDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiGetpluginHaloRunV1alpha1ExtensionPointDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiGetpluginHaloRunV1alpha1ExtensionPointDefinitionRequest {
|
||||
/**
|
||||
* Name of extensionpointdefinition
|
||||
* @type {string}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApiGetpluginHaloRunV1alpha1ExtensionPointDefinition
|
||||
*/
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for listpluginHaloRunV1alpha1ExtensionPointDefinition operation in PluginHaloRunV1alpha1ExtensionPointDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinitionRequest {
|
||||
/**
|
||||
* The page number. Zero indicates no page.
|
||||
* @type {number}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinition
|
||||
*/
|
||||
readonly page?: number;
|
||||
|
||||
/**
|
||||
* Size of one page. Zero indicates no limit.
|
||||
* @type {number}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinition
|
||||
*/
|
||||
readonly size?: number;
|
||||
|
||||
/**
|
||||
* Label selector for filtering.
|
||||
* @type {Array<string>}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinition
|
||||
*/
|
||||
readonly labelSelector?: Array<string>;
|
||||
|
||||
/**
|
||||
* Field selector for filtering.
|
||||
* @type {Array<string>}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinition
|
||||
*/
|
||||
readonly fieldSelector?: Array<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for updatepluginHaloRunV1alpha1ExtensionPointDefinition operation in PluginHaloRunV1alpha1ExtensionPointDefinitionApi.
|
||||
* @export
|
||||
* @interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest
|
||||
*/
|
||||
export interface PluginHaloRunV1alpha1ExtensionPointDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest {
|
||||
/**
|
||||
* Name of extensionpointdefinition
|
||||
* @type {string}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionPointDefinition
|
||||
*/
|
||||
readonly name: string;
|
||||
|
||||
/**
|
||||
* Updated extensionpointdefinition
|
||||
* @type {ExtensionPointDefinition}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionPointDefinition
|
||||
*/
|
||||
readonly extensionPointDefinition?: ExtensionPointDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* PluginHaloRunV1alpha1ExtensionPointDefinitionApi - object-oriented interface
|
||||
* @export
|
||||
* @class PluginHaloRunV1alpha1ExtensionPointDefinitionApi
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class PluginHaloRunV1alpha1ExtensionPointDefinitionApi extends BaseAPI {
|
||||
/**
|
||||
* Create plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiCreatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApi
|
||||
*/
|
||||
public createpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiCreatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionPointDefinitionApiFp(
|
||||
this.configuration
|
||||
)
|
||||
.createpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.extensionPointDefinition,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiDeletepluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApi
|
||||
*/
|
||||
public deletepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiDeletepluginHaloRunV1alpha1ExtensionPointDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionPointDefinitionApiFp(
|
||||
this.configuration
|
||||
)
|
||||
.deletepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.name,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiGetpluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApi
|
||||
*/
|
||||
public getpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiGetpluginHaloRunV1alpha1ExtensionPointDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionPointDefinitionApiFp(
|
||||
this.configuration
|
||||
)
|
||||
.getpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.name,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* List plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApi
|
||||
*/
|
||||
public listpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiListpluginHaloRunV1alpha1ExtensionPointDefinitionRequest = {},
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionPointDefinitionApiFp(
|
||||
this.configuration
|
||||
)
|
||||
.listpluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.page,
|
||||
requestParameters.size,
|
||||
requestParameters.labelSelector,
|
||||
requestParameters.fieldSelector,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update plugin.halo.run/v1alpha1/ExtensionPointDefinition
|
||||
* @param {PluginHaloRunV1alpha1ExtensionPointDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof PluginHaloRunV1alpha1ExtensionPointDefinitionApi
|
||||
*/
|
||||
public updatepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters: PluginHaloRunV1alpha1ExtensionPointDefinitionApiUpdatepluginHaloRunV1alpha1ExtensionPointDefinitionRequest,
|
||||
options?: AxiosRequestConfig
|
||||
) {
|
||||
return PluginHaloRunV1alpha1ExtensionPointDefinitionApiFp(
|
||||
this.configuration
|
||||
)
|
||||
.updatepluginHaloRunV1alpha1ExtensionPointDefinition(
|
||||
requestParameters.name,
|
||||
requestParameters.extensionPointDefinition,
|
||||
options
|
||||
)
|
||||
.then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { AuthProvider } from "./auth-provider";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AuthProviderList
|
||||
*/
|
||||
export interface AuthProviderList {
|
||||
/**
|
||||
* Indicates whether current page is the first page.
|
||||
* @type {boolean}
|
||||
* @memberof AuthProviderList
|
||||
*/
|
||||
first: boolean;
|
||||
/**
|
||||
* Indicates whether current page has previous page.
|
||||
* @type {boolean}
|
||||
* @memberof AuthProviderList
|
||||
*/
|
||||
hasNext: boolean;
|
||||
/**
|
||||
* Indicates whether current page has previous page.
|
||||
* @type {boolean}
|
||||
* @memberof AuthProviderList
|
||||
*/
|
||||
hasPrevious: boolean;
|
||||
/**
|
||||
* A chunk of items.
|
||||
* @type {Array<AuthProvider>}
|
||||
* @memberof AuthProviderList
|
||||
*/
|
||||
items: Array<AuthProvider>;
|
||||
/**
|
||||
* Indicates whether current page is the last page.
|
||||
* @type {boolean}
|
||||
* @memberof AuthProviderList
|
||||
*/
|
||||
last: boolean;
|
||||
/**
|
||||
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
|
||||
* @type {number}
|
||||
* @memberof AuthProviderList
|
||||
*/
|
||||
page: number;
|
||||
/**
|
||||
* Size of each page. If not set or equal to 0, it means no pagination.
|
||||
* @type {number}
|
||||
* @memberof AuthProviderList
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Total elements.
|
||||
* @type {number}
|
||||
* @memberof AuthProviderList
|
||||
*/
|
||||
total: number;
|
||||
/**
|
||||
* Indicates total pages.
|
||||
* @type {number}
|
||||
* @memberof AuthProviderList
|
||||
*/
|
||||
totalPages: number;
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { ConfigMapRef } from "./config-map-ref";
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { SettingRef } from "./setting-ref";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AuthProviderSpec
|
||||
*/
|
||||
export interface AuthProviderSpec {
|
||||
/**
|
||||
* Authentication url of the auth provider
|
||||
* @type {string}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
authenticationUrl: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
bindingUrl?: string;
|
||||
/**
|
||||
*
|
||||
* @type {ConfigMapRef}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
configMapRef?: ConfigMapRef;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* Display name of the auth provider
|
||||
* @type {string}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
displayName: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
helpPage?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
logo?: string;
|
||||
/**
|
||||
*
|
||||
* @type {SettingRef}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
settingRef?: SettingRef;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
unbindUrl?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AuthProviderSpec
|
||||
*/
|
||||
website?: string;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { AuthProviderSpec } from "./auth-provider-spec";
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { Metadata } from "./metadata";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AuthProvider
|
||||
*/
|
||||
export interface AuthProvider {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AuthProvider
|
||||
*/
|
||||
apiVersion: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AuthProvider
|
||||
*/
|
||||
kind: string;
|
||||
/**
|
||||
*
|
||||
* @type {Metadata}
|
||||
* @memberof AuthProvider
|
||||
*/
|
||||
metadata: Metadata;
|
||||
/**
|
||||
*
|
||||
* @type {AuthProviderSpec}
|
||||
* @memberof AuthProvider
|
||||
*/
|
||||
spec: AuthProviderSpec;
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ClientRegistration
|
||||
*/
|
||||
export interface ClientRegistration {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
authorizationGrantType?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
authorizationUri?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
clientAuthenticationMethod?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
clientName?: string;
|
||||
/**
|
||||
*
|
||||
* @type {{ [key: string]: object; }}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
configurationMetadata?: { [key: string]: object };
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
issuerUri?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
jwkSetUri?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
redirectUri?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
scopes?: Array<string>;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
tokenUri: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
userInfoAuthenticationMethod?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
userInfoUri?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ClientRegistration
|
||||
*/
|
||||
userNameAttributeName?: string;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ConfigMapKeyRef
|
||||
*/
|
||||
export interface ConfigMapKeyRef {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ConfigMapKeyRef
|
||||
*/
|
||||
key: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ConfigMapKeyRef
|
||||
*/
|
||||
name: string;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ConfigMapRef
|
||||
*/
|
||||
export interface ConfigMapRef {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ConfigMapRef
|
||||
*/
|
||||
name: string;
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { ExtensionDefinition } from "./extension-definition";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ExtensionDefinitionList
|
||||
*/
|
||||
export interface ExtensionDefinitionList {
|
||||
/**
|
||||
* Indicates whether current page is the first page.
|
||||
* @type {boolean}
|
||||
* @memberof ExtensionDefinitionList
|
||||
*/
|
||||
first: boolean;
|
||||
/**
|
||||
* Indicates whether current page has previous page.
|
||||
* @type {boolean}
|
||||
* @memberof ExtensionDefinitionList
|
||||
*/
|
||||
hasNext: boolean;
|
||||
/**
|
||||
* Indicates whether current page has previous page.
|
||||
* @type {boolean}
|
||||
* @memberof ExtensionDefinitionList
|
||||
*/
|
||||
hasPrevious: boolean;
|
||||
/**
|
||||
* A chunk of items.
|
||||
* @type {Array<ExtensionDefinition>}
|
||||
* @memberof ExtensionDefinitionList
|
||||
*/
|
||||
items: Array<ExtensionDefinition>;
|
||||
/**
|
||||
* Indicates whether current page is the last page.
|
||||
* @type {boolean}
|
||||
* @memberof ExtensionDefinitionList
|
||||
*/
|
||||
last: boolean;
|
||||
/**
|
||||
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
|
||||
* @type {number}
|
||||
* @memberof ExtensionDefinitionList
|
||||
*/
|
||||
page: number;
|
||||
/**
|
||||
* Size of each page. If not set or equal to 0, it means no pagination.
|
||||
* @type {number}
|
||||
* @memberof ExtensionDefinitionList
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Total elements.
|
||||
* @type {number}
|
||||
* @memberof ExtensionDefinitionList
|
||||
*/
|
||||
total: number;
|
||||
/**
|
||||
* Indicates total pages.
|
||||
* @type {number}
|
||||
* @memberof ExtensionDefinitionList
|
||||
*/
|
||||
totalPages: number;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { ExtensionSpec } from "./extension-spec";
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { Metadata } from "./metadata";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ExtensionDefinition
|
||||
*/
|
||||
export interface ExtensionDefinition {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionDefinition
|
||||
*/
|
||||
apiVersion: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionDefinition
|
||||
*/
|
||||
kind: string;
|
||||
/**
|
||||
*
|
||||
* @type {Metadata}
|
||||
* @memberof ExtensionDefinition
|
||||
*/
|
||||
metadata: Metadata;
|
||||
/**
|
||||
*
|
||||
* @type {ExtensionSpec}
|
||||
* @memberof ExtensionDefinition
|
||||
*/
|
||||
spec: ExtensionSpec;
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { ExtensionPointDefinition } from "./extension-point-definition";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ExtensionPointDefinitionList
|
||||
*/
|
||||
export interface ExtensionPointDefinitionList {
|
||||
/**
|
||||
* Indicates whether current page is the first page.
|
||||
* @type {boolean}
|
||||
* @memberof ExtensionPointDefinitionList
|
||||
*/
|
||||
first: boolean;
|
||||
/**
|
||||
* Indicates whether current page has previous page.
|
||||
* @type {boolean}
|
||||
* @memberof ExtensionPointDefinitionList
|
||||
*/
|
||||
hasNext: boolean;
|
||||
/**
|
||||
* Indicates whether current page has previous page.
|
||||
* @type {boolean}
|
||||
* @memberof ExtensionPointDefinitionList
|
||||
*/
|
||||
hasPrevious: boolean;
|
||||
/**
|
||||
* A chunk of items.
|
||||
* @type {Array<ExtensionPointDefinition>}
|
||||
* @memberof ExtensionPointDefinitionList
|
||||
*/
|
||||
items: Array<ExtensionPointDefinition>;
|
||||
/**
|
||||
* Indicates whether current page is the last page.
|
||||
* @type {boolean}
|
||||
* @memberof ExtensionPointDefinitionList
|
||||
*/
|
||||
last: boolean;
|
||||
/**
|
||||
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
|
||||
* @type {number}
|
||||
* @memberof ExtensionPointDefinitionList
|
||||
*/
|
||||
page: number;
|
||||
/**
|
||||
* Size of each page. If not set or equal to 0, it means no pagination.
|
||||
* @type {number}
|
||||
* @memberof ExtensionPointDefinitionList
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Total elements.
|
||||
* @type {number}
|
||||
* @memberof ExtensionPointDefinitionList
|
||||
*/
|
||||
total: number;
|
||||
/**
|
||||
* Indicates total pages.
|
||||
* @type {number}
|
||||
* @memberof ExtensionPointDefinitionList
|
||||
*/
|
||||
totalPages: number;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { ExtensionPointSpec } from "./extension-point-spec";
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { Metadata } from "./metadata";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ExtensionPointDefinition
|
||||
*/
|
||||
export interface ExtensionPointDefinition {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionPointDefinition
|
||||
*/
|
||||
apiVersion: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionPointDefinition
|
||||
*/
|
||||
kind: string;
|
||||
/**
|
||||
*
|
||||
* @type {Metadata}
|
||||
* @memberof ExtensionPointDefinition
|
||||
*/
|
||||
metadata: Metadata;
|
||||
/**
|
||||
*
|
||||
* @type {ExtensionPointSpec}
|
||||
* @memberof ExtensionPointDefinition
|
||||
*/
|
||||
spec: ExtensionPointSpec;
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ExtensionPointSpec
|
||||
*/
|
||||
export interface ExtensionPointSpec {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionPointSpec
|
||||
*/
|
||||
className: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionPointSpec
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionPointSpec
|
||||
*/
|
||||
displayName: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionPointSpec
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionPointSpec
|
||||
*/
|
||||
type: ExtensionPointSpecTypeEnum;
|
||||
}
|
||||
|
||||
export const ExtensionPointSpecTypeEnum = {
|
||||
Singleton: "SINGLETON",
|
||||
MultiInstance: "MULTI_INSTANCE",
|
||||
} as const;
|
||||
|
||||
export type ExtensionPointSpecTypeEnum =
|
||||
typeof ExtensionPointSpecTypeEnum[keyof typeof ExtensionPointSpecTypeEnum];
|
|
@ -0,0 +1,51 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ExtensionSpec
|
||||
*/
|
||||
export interface ExtensionSpec {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionSpec
|
||||
*/
|
||||
className: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionSpec
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionSpec
|
||||
*/
|
||||
displayName: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionSpec
|
||||
*/
|
||||
extensionPointName: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ExtensionSpec
|
||||
*/
|
||||
icon?: string;
|
||||
}
|
|
@ -5,6 +5,9 @@ export * from "./attachment";
|
|||
export * from "./attachment-list";
|
||||
export * from "./attachment-spec";
|
||||
export * from "./attachment-status";
|
||||
export * from "./auth-provider";
|
||||
export * from "./auth-provider-list";
|
||||
export * from "./auth-provider-spec";
|
||||
export * from "./author";
|
||||
export * from "./category";
|
||||
export * from "./category-list";
|
||||
|
@ -25,6 +28,7 @@ export * from "./comment-vo-list";
|
|||
export * from "./condition";
|
||||
export * from "./config-map";
|
||||
export * from "./config-map-list";
|
||||
export * from "./config-map-ref";
|
||||
export * from "./content";
|
||||
export * from "./content-wrapper";
|
||||
export * from "./contributor";
|
||||
|
@ -36,6 +40,12 @@ export * from "./dashboard-stats";
|
|||
export * from "./detailed-user";
|
||||
export * from "./excerpt";
|
||||
export * from "./extension";
|
||||
export * from "./extension-definition";
|
||||
export * from "./extension-definition-list";
|
||||
export * from "./extension-point-definition";
|
||||
export * from "./extension-point-definition-list";
|
||||
export * from "./extension-point-spec";
|
||||
export * from "./extension-spec";
|
||||
export * from "./file-reverse-proxy-provider";
|
||||
export * from "./grant-request";
|
||||
export * from "./group";
|
||||
|
@ -44,6 +54,7 @@ export * from "./group-list";
|
|||
export * from "./group-spec";
|
||||
export * from "./group-status";
|
||||
export * from "./license";
|
||||
export * from "./listed-auth-provider";
|
||||
export * from "./listed-comment";
|
||||
export * from "./listed-comment-list";
|
||||
export * from "./listed-post";
|
||||
|
@ -108,6 +119,7 @@ export * from "./search-engine-spec";
|
|||
export * from "./setting";
|
||||
export * from "./setting-form";
|
||||
export * from "./setting-list";
|
||||
export * from "./setting-ref";
|
||||
export * from "./setting-spec";
|
||||
export * from "./single-page";
|
||||
export * from "./single-page-list";
|
||||
|
@ -129,6 +141,9 @@ export * from "./theme-list";
|
|||
export * from "./theme-spec";
|
||||
export * from "./theme-status";
|
||||
export * from "./user";
|
||||
export * from "./user-connection";
|
||||
export * from "./user-connection-list";
|
||||
export * from "./user-connection-spec";
|
||||
export * from "./user-list";
|
||||
export * from "./user-permission";
|
||||
export * from "./user-spec";
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ListedAuthProvider
|
||||
*/
|
||||
export interface ListedAuthProvider {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
authenticationUrl?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
bindingUrl?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
displayName: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
enabled?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
helpPage?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
isBound?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
logo?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
unbindingUrl?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ListedAuthProvider
|
||||
*/
|
||||
website?: string;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface SettingRef
|
||||
*/
|
||||
export interface SettingRef {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SettingRef
|
||||
*/
|
||||
group: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SettingRef
|
||||
*/
|
||||
name: string;
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { UserConnection } from "./user-connection";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UserConnectionList
|
||||
*/
|
||||
export interface UserConnectionList {
|
||||
/**
|
||||
* Indicates whether current page is the first page.
|
||||
* @type {boolean}
|
||||
* @memberof UserConnectionList
|
||||
*/
|
||||
first: boolean;
|
||||
/**
|
||||
* Indicates whether current page has previous page.
|
||||
* @type {boolean}
|
||||
* @memberof UserConnectionList
|
||||
*/
|
||||
hasNext: boolean;
|
||||
/**
|
||||
* Indicates whether current page has previous page.
|
||||
* @type {boolean}
|
||||
* @memberof UserConnectionList
|
||||
*/
|
||||
hasPrevious: boolean;
|
||||
/**
|
||||
* A chunk of items.
|
||||
* @type {Array<UserConnection>}
|
||||
* @memberof UserConnectionList
|
||||
*/
|
||||
items: Array<UserConnection>;
|
||||
/**
|
||||
* Indicates whether current page is the last page.
|
||||
* @type {boolean}
|
||||
* @memberof UserConnectionList
|
||||
*/
|
||||
last: boolean;
|
||||
/**
|
||||
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
|
||||
* @type {number}
|
||||
* @memberof UserConnectionList
|
||||
*/
|
||||
page: number;
|
||||
/**
|
||||
* Size of each page. If not set or equal to 0, it means no pagination.
|
||||
* @type {number}
|
||||
* @memberof UserConnectionList
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Total elements.
|
||||
* @type {number}
|
||||
* @memberof UserConnectionList
|
||||
*/
|
||||
total: number;
|
||||
/**
|
||||
* Indicates total pages.
|
||||
* @type {number}
|
||||
* @memberof UserConnectionList
|
||||
*/
|
||||
totalPages: number;
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UserConnectionSpec
|
||||
*/
|
||||
export interface UserConnectionSpec {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
accessToken: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
avatarUrl?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
displayName: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
expiresAt?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
profileUrl?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
providerUserId: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
refreshToken?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
registrationId: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
updatedAt?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnectionSpec
|
||||
*/
|
||||
username: string;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Halo Next API
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 2.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { Metadata } from "./metadata";
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import { UserConnectionSpec } from "./user-connection-spec";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UserConnection
|
||||
*/
|
||||
export interface UserConnection {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnection
|
||||
*/
|
||||
apiVersion: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UserConnection
|
||||
*/
|
||||
kind: string;
|
||||
/**
|
||||
*
|
||||
* @type {Metadata}
|
||||
* @memberof UserConnection
|
||||
*/
|
||||
metadata: Metadata;
|
||||
/**
|
||||
*
|
||||
* @type {UserConnectionSpec}
|
||||
* @memberof UserConnection
|
||||
*/
|
||||
spec: UserConnectionSpec;
|
||||
}
|
|
@ -58,6 +58,7 @@ import IconArrowUpCircleLine from "~icons/ri/arrow-up-circle-line";
|
|||
import IconArrowDownCircleLine from "~icons/ri/arrow-down-circle-line";
|
||||
import IconTerminalBoxLine from "~icons/ri/terminal-box-line";
|
||||
import IconClipboardLine from "~icons/ri/clipboard-line";
|
||||
import IconLockPasswordLine from "~icons/ri/lock-password-line";
|
||||
|
||||
export {
|
||||
IconDashboard,
|
||||
|
@ -120,4 +121,5 @@ export {
|
|||
IconArrowDownCircleLine,
|
||||
IconTerminalBoxLine,
|
||||
IconClipboardLine,
|
||||
IconLockPasswordLine,
|
||||
};
|
||||
|
|
|
@ -10,6 +10,11 @@ import qs from "qs";
|
|||
import { submitForm } from "@formkit/core";
|
||||
import { JSEncrypt } from "jsencrypt";
|
||||
import { apiClient } from "@/utils/api-client";
|
||||
import { useQuery } from "@tanstack/vue-query";
|
||||
import type {
|
||||
GlobalInfo,
|
||||
SocialAuthProvider,
|
||||
} from "@/modules/system/actuator/types";
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: "succeed"): void;
|
||||
|
@ -95,6 +100,23 @@ const handleLogin = async () => {
|
|||
onMounted(() => {
|
||||
handleGenerateToken();
|
||||
});
|
||||
|
||||
// auth providers
|
||||
// fixme: Needs to be saved in Pinia.
|
||||
const { data: socialAuthProviders } = useQuery<SocialAuthProvider[]>({
|
||||
queryKey: ["social-auth-providers"],
|
||||
queryFn: async () => {
|
||||
const { data } = await axios.get<GlobalInfo>(
|
||||
`${import.meta.env.VITE_API_URL}/actuator/globalinfo`,
|
||||
{
|
||||
withCredentials: true,
|
||||
}
|
||||
);
|
||||
|
||||
return data.socialAuthProviders;
|
||||
},
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -140,4 +162,21 @@ onMounted(() => {
|
|||
>
|
||||
登录
|
||||
</VButton>
|
||||
|
||||
<div v-if="socialAuthProviders?.length" class="mt-3 flex items-center">
|
||||
<span class="text-sm text-slate-600">其他登录:</span>
|
||||
<ul class="flex items-center">
|
||||
<li
|
||||
v-for="(socialAuthProvider, index) in socialAuthProviders"
|
||||
:key="index"
|
||||
>
|
||||
<a
|
||||
:href="socialAuthProvider.authenticationUrl"
|
||||
class="block h-6 w-6 rounded-full bg-gray-200 p-1"
|
||||
>
|
||||
<img class="rounded-full" :src="socialAuthProvider.logo" />
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -216,6 +216,9 @@ export function useSettingFormConvert(
|
|||
configMap.value?.data?.[form.group] || "{}"
|
||||
);
|
||||
});
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import userModule from "./system/users/module";
|
|||
import roleModule from "./system/roles/module";
|
||||
import settingModule from "./system/settings/module";
|
||||
import actuatorModule from "./system/actuator/module";
|
||||
import authProviderModule from "./system/auth-providers/module";
|
||||
|
||||
// const coreModules = [
|
||||
// dashboardModule,
|
||||
|
@ -38,6 +39,7 @@ const coreModules = [
|
|||
themeModule,
|
||||
userModule,
|
||||
roleModule,
|
||||
authProviderModule,
|
||||
];
|
||||
|
||||
export { coreModules };
|
||||
|
|
|
@ -5,6 +5,7 @@ export interface GlobalInfo {
|
|||
allowComments: boolean;
|
||||
allowAnonymousComments: boolean;
|
||||
allowRegistration: boolean;
|
||||
socialAuthProviders: SocialAuthProvider[];
|
||||
}
|
||||
|
||||
export interface Info {
|
||||
|
@ -95,3 +96,12 @@ export interface Startup {
|
|||
springBootVersion: string;
|
||||
timeline: Timeline;
|
||||
}
|
||||
|
||||
export interface SocialAuthProvider {
|
||||
name: string;
|
||||
displayName: string;
|
||||
description: string;
|
||||
logo: string;
|
||||
website: string;
|
||||
authenticationUrl: string;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,258 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { apiClient } from "@/utils/api-client";
|
||||
import { useQuery } from "@tanstack/vue-query";
|
||||
import type { AuthProvider, Setting } from "@halo-dev/api-client";
|
||||
import { useRoute } from "vue-router";
|
||||
import {
|
||||
Toast,
|
||||
VAvatar,
|
||||
VButton,
|
||||
VCard,
|
||||
VPageHeader,
|
||||
VTabbar,
|
||||
} from "@halo-dev/components";
|
||||
import { useSettingFormConvert } from "@/composables/use-setting-form";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const tabs = ref<{ id: string; label: string }[]>([
|
||||
{
|
||||
id: "detail",
|
||||
label: "详情",
|
||||
},
|
||||
]);
|
||||
|
||||
const activeTab = ref<string>("detail");
|
||||
|
||||
const { data: authProvider } = useQuery<AuthProvider>({
|
||||
queryKey: ["auth-provider", route.params.name],
|
||||
queryFn: async () => {
|
||||
const { data } =
|
||||
await apiClient.extension.authProvider.getauthHaloRunV1alpha1AuthProvider(
|
||||
{
|
||||
name: route.params.name as string,
|
||||
}
|
||||
);
|
||||
return data;
|
||||
},
|
||||
onSuccess(data) {
|
||||
if (data.spec.settingRef?.name) {
|
||||
tabs.value.push({
|
||||
id: "setting",
|
||||
label: "设置",
|
||||
});
|
||||
}
|
||||
},
|
||||
refetchOnWindowFocus: false,
|
||||
enabled: computed(() => !!route.params.name),
|
||||
});
|
||||
|
||||
// setting
|
||||
const saving = ref(false);
|
||||
const group = computed(
|
||||
() => authProvider.value?.spec.settingRef?.group as string
|
||||
);
|
||||
|
||||
const { data: setting, refetch: handleFetchSettings } = useQuery<Setting>({
|
||||
queryKey: [
|
||||
"auth-provider-setting",
|
||||
authProvider.value?.spec.settingRef?.name,
|
||||
],
|
||||
queryFn: async () => {
|
||||
const { data } = await apiClient.extension.setting.getv1alpha1Setting(
|
||||
{
|
||||
name: authProvider.value?.spec.settingRef?.name as string,
|
||||
},
|
||||
{
|
||||
mute: true,
|
||||
}
|
||||
);
|
||||
return data;
|
||||
},
|
||||
refetchOnWindowFocus: false,
|
||||
enabled: computed(() => !!authProvider.value?.spec.settingRef?.name),
|
||||
});
|
||||
|
||||
const { data: configMap, refetch: handleFetchConfigMap } = useQuery({
|
||||
queryKey: [
|
||||
"auth-provider-configMap",
|
||||
authProvider.value?.spec.configMapRef?.name,
|
||||
],
|
||||
queryFn: async () => {
|
||||
const { data } = await apiClient.extension.configMap.getv1alpha1ConfigMap(
|
||||
{
|
||||
name: authProvider.value?.spec.configMapRef?.name as string,
|
||||
},
|
||||
{
|
||||
mute: true,
|
||||
}
|
||||
);
|
||||
return data;
|
||||
},
|
||||
retry: 0,
|
||||
refetchOnWindowFocus: false,
|
||||
onError: async () => {
|
||||
const data = {};
|
||||
data[group.value] = "";
|
||||
await apiClient.extension.configMap.createv1alpha1ConfigMap({
|
||||
configMap: {
|
||||
apiVersion: "v1alpha1",
|
||||
data: data,
|
||||
kind: "ConfigMap",
|
||||
metadata: {
|
||||
name: authProvider.value?.spec.configMapRef?.name as string,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await handleFetchConfigMap();
|
||||
},
|
||||
enabled: computed(
|
||||
() => !!authProvider.value?.spec.configMapRef?.name && !!setting.value
|
||||
),
|
||||
});
|
||||
|
||||
const { configMapFormData, formSchema, convertToSave } = useSettingFormConvert(
|
||||
setting,
|
||||
configMap,
|
||||
group
|
||||
);
|
||||
|
||||
const handleSaveConfigMap = async () => {
|
||||
saving.value = true;
|
||||
const configMapToUpdate = convertToSave();
|
||||
if (!configMapToUpdate || !authProvider?.value) {
|
||||
saving.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
await apiClient.extension.configMap.updatev1alpha1ConfigMap({
|
||||
name: authProvider.value.spec.configMapRef?.name as string,
|
||||
configMap: configMapToUpdate,
|
||||
});
|
||||
|
||||
Toast.success("保存成功");
|
||||
|
||||
await handleFetchSettings();
|
||||
await handleFetchConfigMap();
|
||||
saving.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VPageHeader :title="authProvider?.spec.displayName">
|
||||
<template #icon>
|
||||
<VAvatar
|
||||
v-if="authProvider"
|
||||
:src="authProvider.spec.logo"
|
||||
:alt="authProvider.spec.displayName"
|
||||
class="mr-2"
|
||||
size="sm"
|
||||
/>
|
||||
</template>
|
||||
</VPageHeader>
|
||||
|
||||
<div class="m-0 md:m-4">
|
||||
<VCard :body-class="['!p-0']">
|
||||
<template #header>
|
||||
<VTabbar
|
||||
v-model:active-id="activeTab"
|
||||
:items="tabs"
|
||||
class="w-full !rounded-none"
|
||||
type="outline"
|
||||
></VTabbar>
|
||||
</template>
|
||||
<div class="bg-white">
|
||||
<div v-if="activeTab === 'detail'">
|
||||
<dl class="divide-y divide-gray-100">
|
||||
<div
|
||||
class="bg-white px-4 py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4 sm:px-6"
|
||||
>
|
||||
<dt class="text-sm font-medium text-gray-900">名称</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
||||
{{ authProvider?.spec.displayName }}
|
||||
</dd>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white px-4 py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4 sm:px-6"
|
||||
>
|
||||
<dt class="text-sm font-medium text-gray-900">描述</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
||||
{{ authProvider?.spec.description }}
|
||||
</dd>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white px-4 py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4 sm:px-6"
|
||||
>
|
||||
<dt class="text-sm font-medium text-gray-900">网站</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
||||
<a
|
||||
v-if="authProvider?.spec.website"
|
||||
:href="authProvider?.spec.website"
|
||||
target="_blank"
|
||||
>
|
||||
{{ authProvider.spec.website }}
|
||||
</a>
|
||||
<span v-else>无</span>
|
||||
</dd>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white px-4 py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4 sm:px-6"
|
||||
>
|
||||
<dt class="text-sm font-medium text-gray-900">帮助页面</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
||||
<a
|
||||
v-if="authProvider?.spec.helpPage"
|
||||
:href="authProvider?.spec.helpPage"
|
||||
target="_blank"
|
||||
>
|
||||
{{ authProvider.spec.helpPage }}
|
||||
</a>
|
||||
<span v-else>无</span>
|
||||
</dd>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white px-4 py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4 sm:px-6"
|
||||
>
|
||||
<dt class="text-sm font-medium text-gray-900">登录入口</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:col-span-3 sm:mt-0">
|
||||
{{ authProvider?.spec.authenticationUrl }}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
<div v-if="activeTab === 'setting'" class="bg-white p-4">
|
||||
<div>
|
||||
<FormKit
|
||||
v-if="group && formSchema && configMapFormData"
|
||||
:id="group"
|
||||
v-model="configMapFormData[group]"
|
||||
:name="group"
|
||||
:actions="false"
|
||||
:preserve="true"
|
||||
type="form"
|
||||
@submit="handleSaveConfigMap"
|
||||
>
|
||||
<FormKitSchema
|
||||
:schema="formSchema"
|
||||
:data="configMapFormData[group]"
|
||||
/>
|
||||
</FormKit>
|
||||
</div>
|
||||
<div class="pt-5">
|
||||
<div class="flex justify-start">
|
||||
<VButton
|
||||
:loading="saving"
|
||||
type="secondary"
|
||||
@click="$formkit.submit(group || '')"
|
||||
>
|
||||
保存
|
||||
</VButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</VCard>
|
||||
</div>
|
||||
</template>
|
|
@ -0,0 +1,58 @@
|
|||
<script lang="ts" setup>
|
||||
import { VPageHeader, IconLockPasswordLine, VCard } from "@halo-dev/components";
|
||||
import { useQuery } from "@tanstack/vue-query";
|
||||
import { apiClient } from "@/utils/api-client";
|
||||
import type { ListedAuthProvider } from "@halo-dev/api-client";
|
||||
import AuthProviderListItem from "./components/AuthProviderListItem.vue";
|
||||
|
||||
const {
|
||||
data: authProviders,
|
||||
isLoading,
|
||||
refetch,
|
||||
} = useQuery<ListedAuthProvider[]>({
|
||||
queryKey: ["auth-providers"],
|
||||
queryFn: async () => {
|
||||
const { data } = await apiClient.authProvider.listAuthProviders();
|
||||
return data;
|
||||
},
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VPageHeader title="身份认证">
|
||||
<template #icon>
|
||||
<IconLockPasswordLine class="mr-2 self-center" />
|
||||
</template>
|
||||
</VPageHeader>
|
||||
|
||||
<div class="m-0 md:m-4">
|
||||
<VCard :body-class="['!p-0']">
|
||||
<template #header>
|
||||
<div class="block w-full bg-gray-50 px-4 py-3">
|
||||
<div
|
||||
class="relative flex flex-col items-start sm:flex-row sm:items-center"
|
||||
>
|
||||
<div class="flex w-full flex-1 sm:w-auto">
|
||||
<FormKit placeholder="输入关键词搜索" type="text"></FormKit>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<VLoading v-if="isLoading" />
|
||||
<Transition v-else appear name="fade">
|
||||
<ul
|
||||
class="box-border h-full w-full divide-y divide-gray-100"
|
||||
role="list"
|
||||
>
|
||||
<li v-for="(authProvider, index) in authProviders" :key="index">
|
||||
<AuthProviderListItem
|
||||
:auth-provider="authProvider"
|
||||
@reload="refetch"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</Transition>
|
||||
</VCard>
|
||||
</div>
|
||||
</template>
|
|
@ -0,0 +1,86 @@
|
|||
<script lang="ts" setup>
|
||||
import { apiClient } from "@/utils/api-client";
|
||||
import type { ListedAuthProvider } from "@halo-dev/api-client";
|
||||
import {
|
||||
Dialog,
|
||||
Toast,
|
||||
VAvatar,
|
||||
VEntity,
|
||||
VEntityField,
|
||||
VSwitch,
|
||||
} from "@halo-dev/components";
|
||||
|
||||
const props = defineProps<{
|
||||
authProvider: ListedAuthProvider;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: "reload"): void;
|
||||
}>();
|
||||
|
||||
const handleChangeStatus = async () => {
|
||||
Dialog.info({
|
||||
title: `确定要${
|
||||
props.authProvider.enabled ? "停用" : "启用"
|
||||
}该身份认证方式吗?`,
|
||||
onConfirm: async () => {
|
||||
try {
|
||||
if (props.authProvider.enabled) {
|
||||
await apiClient.authProvider.disableAuthProvider({
|
||||
name: props.authProvider.name,
|
||||
});
|
||||
|
||||
Toast.success("停用成功");
|
||||
} else {
|
||||
await apiClient.authProvider.enableAuthProvider({
|
||||
name: props.authProvider.name,
|
||||
});
|
||||
Toast.success("启用成功");
|
||||
}
|
||||
|
||||
emit("reload");
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VEntity>
|
||||
<template #start>
|
||||
<VEntityField>
|
||||
<template #description>
|
||||
<VAvatar
|
||||
:alt="authProvider.displayName"
|
||||
:src="authProvider.logo"
|
||||
size="md"
|
||||
></VAvatar>
|
||||
</template>
|
||||
</VEntityField>
|
||||
<VEntityField
|
||||
:title="authProvider.displayName"
|
||||
:description="authProvider.description"
|
||||
:route="{
|
||||
name: 'AuthProviderDetail',
|
||||
params: { name: authProvider.name },
|
||||
}"
|
||||
width="27rem"
|
||||
>
|
||||
</VEntityField>
|
||||
</template>
|
||||
<template #end>
|
||||
<VEntityField v-permission="['system:plugins:manage']">
|
||||
<template #description>
|
||||
<div class="flex items-center">
|
||||
<VSwitch
|
||||
:model-value="authProvider.enabled"
|
||||
@click="handleChangeStatus"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</VEntityField>
|
||||
</template>
|
||||
</VEntity>
|
||||
</template>
|
|
@ -0,0 +1,32 @@
|
|||
import { definePlugin } from "@halo-dev/console-shared";
|
||||
import BasicLayout from "@/layouts/BasicLayout.vue";
|
||||
import AuthProviders from "./AuthProviders.vue";
|
||||
import AuthProviderDetail from "./AuthProviderDetail.vue";
|
||||
|
||||
export default definePlugin({
|
||||
routes: [
|
||||
{
|
||||
path: "/users",
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
path: "auth-providers",
|
||||
name: "AuthProviders",
|
||||
component: AuthProviders,
|
||||
meta: {
|
||||
title: "认证方式",
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "auth-providers/:name",
|
||||
name: "AuthProviderDetail",
|
||||
component: AuthProviderDetail,
|
||||
meta: {
|
||||
title: "认证方式详情",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
|
@ -1,15 +1,54 @@
|
|||
<script lang="ts" setup>
|
||||
import { IconUserSettings, VTag } from "@halo-dev/components";
|
||||
import type { Ref } from "vue";
|
||||
import { Dialog, IconUserSettings, VButton, VTag } from "@halo-dev/components";
|
||||
import type { ComputedRef, Ref } from "vue";
|
||||
import { inject } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import type { DetailedUser } from "@halo-dev/api-client";
|
||||
import type { DetailedUser, ListedAuthProvider } from "@halo-dev/api-client";
|
||||
import { rbacAnnotations } from "@/constants/annotations";
|
||||
import { formatDatetime } from "@/utils/date";
|
||||
import { useQuery } from "@tanstack/vue-query";
|
||||
import { apiClient } from "@/utils/api-client";
|
||||
import axios from "axios";
|
||||
|
||||
const user = inject<Ref<DetailedUser | undefined>>("user");
|
||||
const isCurrentUser = inject<ComputedRef<boolean>>("isCurrentUser");
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const { data: authProviders } = useQuery<ListedAuthProvider[]>({
|
||||
queryKey: ["user-auth-providers"],
|
||||
queryFn: async () => {
|
||||
const { data } = await apiClient.authProvider.listAuthProviders();
|
||||
return data;
|
||||
},
|
||||
refetchOnWindowFocus: false,
|
||||
enabled: isCurrentUser,
|
||||
});
|
||||
|
||||
const handleUnbindAuth = (authProvider: ListedAuthProvider) => {
|
||||
Dialog.warning({
|
||||
title: `确定要取消绑定 ${authProvider.displayName} 的登录方式吗?`,
|
||||
onConfirm: async () => {
|
||||
await axios.post(
|
||||
`${import.meta.env.VITE_API_URL}${authProvider.unbindingUrl}`,
|
||||
{
|
||||
withCredentials: true,
|
||||
}
|
||||
);
|
||||
|
||||
window.location.reload();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const handleBindAuth = (authProvider: ListedAuthProvider) => {
|
||||
if (!authProvider.bindingUrl) {
|
||||
return;
|
||||
}
|
||||
window.location.href = `${
|
||||
authProvider.bindingUrl
|
||||
}?redirect_uri=${encodeURIComponent(window.location.href)}`;
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div class="border-t border-gray-100">
|
||||
|
@ -91,6 +130,49 @@ const router = useRouter();
|
|||
{{ user?.user.metadata?.creationTimestamp }}
|
||||
</dd>
|
||||
</div>
|
||||
<div
|
||||
v-if="isCurrentUser"
|
||||
class="bg-white py-5 px-2 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4"
|
||||
>
|
||||
<dt class="text-sm font-medium text-gray-900">登录方式</dt>
|
||||
<dd class="mt-1 text-sm sm:col-span-3 sm:mt-0">
|
||||
<ul class="space-y-2">
|
||||
<template v-for="(authProvider, index) in authProviders">
|
||||
<li v-if="authProvider.bindingUrl" :key="index">
|
||||
<div
|
||||
class="flex w-full cursor-pointer flex-wrap justify-between gap-y-3 rounded border p-5 hover:border-primary sm:w-1/2"
|
||||
>
|
||||
<div class="inline-flex items-center gap-3">
|
||||
<div>
|
||||
<img class="h-7 w-7 rounded" :src="authProvider.logo" />
|
||||
</div>
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{{ authProvider.displayName }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline-flex items-center">
|
||||
<VButton
|
||||
v-if="authProvider.isBound"
|
||||
size="sm"
|
||||
@click="handleUnbindAuth(authProvider)"
|
||||
>
|
||||
解绑
|
||||
</VButton>
|
||||
<VButton
|
||||
v-else
|
||||
size="sm"
|
||||
type="secondary"
|
||||
@click="handleBindAuth(authProvider)"
|
||||
>
|
||||
绑定
|
||||
</VButton>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -4,6 +4,7 @@ import {
|
|||
IconArrowDown,
|
||||
IconUserFollow,
|
||||
IconUserSettings,
|
||||
IconLockPasswordLine,
|
||||
VButton,
|
||||
VCard,
|
||||
VPageHeader,
|
||||
|
@ -325,6 +326,12 @@ const hasFilters = computed(() => {
|
|||
</template>
|
||||
角色管理
|
||||
</VButton>
|
||||
<VButton :route="{ name: 'AuthProviders' }" size="sm" type="default">
|
||||
<template #icon>
|
||||
<IconLockPasswordLine class="h-full w-full" />
|
||||
</template>
|
||||
身份认证
|
||||
</VButton>
|
||||
<VButton
|
||||
v-permission="['system:users:manage']"
|
||||
type="secondary"
|
||||
|
|
|
@ -2,7 +2,15 @@
|
|||
import BasicLayout from "@/layouts/BasicLayout.vue";
|
||||
import { apiClient } from "@/utils/api-client";
|
||||
import { VButton, VSpace, VTabbar, VAvatar } from "@halo-dev/components";
|
||||
import { computed, onMounted, provide, ref, watch, type Ref } from "vue";
|
||||
import {
|
||||
computed,
|
||||
onMounted,
|
||||
provide,
|
||||
ref,
|
||||
watch,
|
||||
type ComputedRef,
|
||||
type Ref,
|
||||
} from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import type { DetailedUser } from "@halo-dev/api-client";
|
||||
import UserEditingModal from "../components/UserEditingModal.vue";
|
||||
|
@ -62,6 +70,7 @@ const isCurrentUser = computed(() => {
|
|||
});
|
||||
|
||||
provide<Ref<DetailedUser | undefined>>("user", user);
|
||||
provide<ComputedRef<boolean>>("isCurrentUser", isCurrentUser);
|
||||
|
||||
const activeTab = ref();
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import {
|
|||
ApiConsoleHaloRunV1alpha1StatsApi,
|
||||
ApiConsoleHaloRunV1alpha1AttachmentApi,
|
||||
ApiConsoleHaloRunV1alpha1IndicesApi,
|
||||
ApiConsoleHaloRunV1alpha1AuthProviderApi,
|
||||
ContentHaloRunV1alpha1CategoryApi,
|
||||
ContentHaloRunV1alpha1CommentApi,
|
||||
ContentHaloRunV1alpha1PostApi,
|
||||
|
@ -33,6 +34,8 @@ import {
|
|||
V1alpha1UserApi,
|
||||
V1alpha1AnnotationSettingApi,
|
||||
LoginApi,
|
||||
AuthHaloRunV1alpha1AuthProviderApi,
|
||||
AuthHaloRunV1alpha1UserConnectionApi,
|
||||
} from "@halo-dev/api-client";
|
||||
import type { AxiosError, AxiosInstance } from "axios";
|
||||
import axios from "axios";
|
||||
|
@ -166,6 +169,16 @@ function setupApiClient(axios: AxiosInstance) {
|
|||
baseURL,
|
||||
axios
|
||||
),
|
||||
authProvider: new AuthHaloRunV1alpha1AuthProviderApi(
|
||||
undefined,
|
||||
baseURL,
|
||||
axios
|
||||
),
|
||||
userConnection: new AuthHaloRunV1alpha1UserConnectionApi(
|
||||
undefined,
|
||||
baseURL,
|
||||
axios
|
||||
),
|
||||
},
|
||||
// custom endpoints
|
||||
user: new ApiConsoleHaloRunV1alpha1UserApi(undefined, baseURL, axios),
|
||||
|
@ -187,6 +200,11 @@ function setupApiClient(axios: AxiosInstance) {
|
|||
),
|
||||
login: new LoginApi(undefined, baseURL, axios),
|
||||
indices: new ApiConsoleHaloRunV1alpha1IndicesApi(undefined, baseURL, axios),
|
||||
authProvider: new ApiConsoleHaloRunV1alpha1AuthProviderApi(
|
||||
undefined,
|
||||
baseURL,
|
||||
axios
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
package run.halo.app.actuator;
|
||||
|
||||
import static org.apache.commons.lang3.BooleanUtils.isTrue;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
|
||||
import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpoint;
|
||||
|
@ -15,21 +20,18 @@ import run.halo.app.infra.SystemSetting;
|
|||
import run.halo.app.infra.SystemSetting.Basic;
|
||||
import run.halo.app.infra.SystemSetting.Comment;
|
||||
import run.halo.app.infra.SystemSetting.User;
|
||||
import run.halo.app.security.AuthProviderService;
|
||||
|
||||
@WebEndpoint(id = "globalinfo")
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class GlobalInfoEndpoint {
|
||||
|
||||
private final ObjectProvider<SystemConfigurableEnvironmentFetcher> systemConfigFetcher;
|
||||
|
||||
private final ExternalUrlSupplier externalUrl;
|
||||
|
||||
public GlobalInfoEndpoint(
|
||||
ObjectProvider<SystemConfigurableEnvironmentFetcher> systemConfigFetcher,
|
||||
ExternalUrlSupplier externalUrl) {
|
||||
this.systemConfigFetcher = systemConfigFetcher;
|
||||
this.externalUrl = externalUrl;
|
||||
}
|
||||
private final AuthProviderService authProviderService;
|
||||
|
||||
@ReadOperation
|
||||
public GlobalInfo globalInfo() {
|
||||
|
@ -37,6 +39,7 @@ public class GlobalInfoEndpoint {
|
|||
info.setExternalUrl(externalUrl.get());
|
||||
info.setLocale(Locale.getDefault());
|
||||
info.setTimeZone(TimeZone.getDefault());
|
||||
handleSocialAuthProvider(info);
|
||||
systemConfigFetcher.ifAvailable(fetcher -> fetcher.getConfigMapBlocking()
|
||||
.ifPresent(configMap -> {
|
||||
handleCommentSetting(info, configMap);
|
||||
|
@ -64,6 +67,22 @@ public class GlobalInfoEndpoint {
|
|||
|
||||
private String favicon;
|
||||
|
||||
private List<SocialAuthProvider> socialAuthProviders;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SocialAuthProvider {
|
||||
private String name;
|
||||
|
||||
private String displayName;
|
||||
|
||||
private String description;
|
||||
|
||||
private String logo;
|
||||
|
||||
private String website;
|
||||
|
||||
private String authenticationUrl;
|
||||
}
|
||||
|
||||
private void handleCommentSetting(GlobalInfo info, ConfigMap configMap) {
|
||||
|
@ -95,4 +114,26 @@ public class GlobalInfoEndpoint {
|
|||
}
|
||||
}
|
||||
|
||||
private void handleSocialAuthProvider(GlobalInfo info) {
|
||||
List<SocialAuthProvider> providers = authProviderService.listAll()
|
||||
.map(listedAuthProviders -> listedAuthProviders.stream()
|
||||
.filter(provider -> isTrue(provider.getEnabled()))
|
||||
.filter(provider -> StringUtils.isNotBlank(provider.getBindingUrl()))
|
||||
.map(provider -> {
|
||||
SocialAuthProvider socialAuthProvider = new SocialAuthProvider();
|
||||
socialAuthProvider.setName(provider.getName());
|
||||
socialAuthProvider.setDisplayName(provider.getDisplayName());
|
||||
socialAuthProvider.setDescription(provider.getDescription());
|
||||
socialAuthProvider.setLogo(provider.getLogo());
|
||||
socialAuthProvider.setWebsite(provider.getWebsite());
|
||||
socialAuthProvider.setAuthenticationUrl(provider.getAuthenticationUrl());
|
||||
return socialAuthProvider;
|
||||
})
|
||||
.toList()
|
||||
)
|
||||
.block();
|
||||
|
||||
info.setSocialAuthProviders(providers);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import static org.springframework.security.web.server.header.XFrameOptionsServer
|
|||
import static org.springframework.security.web.server.util.matcher.ServerWebExchangeMatchers.pathMatchers;
|
||||
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
@ -31,7 +32,9 @@ import run.halo.app.core.extension.service.UserService;
|
|||
import run.halo.app.extension.ReactiveExtensionClient;
|
||||
import run.halo.app.infra.AnonymousUserConst;
|
||||
import run.halo.app.infra.properties.HaloProperties;
|
||||
import run.halo.app.plugin.extensionpoint.ExtensionGetter;
|
||||
import run.halo.app.security.DefaultUserDetailService;
|
||||
import run.halo.app.security.DynamicMatcherSecurityWebFilterChain;
|
||||
import run.halo.app.security.SuperAdminInitializer;
|
||||
import run.halo.app.security.authentication.SecurityConfigurer;
|
||||
import run.halo.app.security.authentication.login.CryptoService;
|
||||
|
@ -47,17 +50,19 @@ import run.halo.app.security.authorization.RequestInfoAuthorizationManager;
|
|||
*/
|
||||
@Configuration
|
||||
@EnableWebFluxSecurity
|
||||
@RequiredArgsConstructor
|
||||
public class WebServerSecurityConfig {
|
||||
|
||||
@Bean
|
||||
@Bean(name = "apiSecurityFilterChain")
|
||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||
SecurityWebFilterChain apiFilterChain(ServerHttpSecurity http,
|
||||
RoleService roleService,
|
||||
ObjectProvider<SecurityConfigurer> securityConfigurers,
|
||||
ServerSecurityContextRepository securityContextRepository) {
|
||||
ServerSecurityContextRepository securityContextRepository,
|
||||
ExtensionGetter extensionGetter) {
|
||||
|
||||
http.securityMatcher(
|
||||
pathMatchers("/api/**", "/apis/**", "/login/**", "/logout", "/actuator/**"))
|
||||
http.securityMatcher(pathMatchers("/api/**", "/apis/**", "/oauth2/**",
|
||||
"/login/**", "/logout", "/actuator/**"))
|
||||
.authorizeExchange().anyExchange()
|
||||
.access(new RequestInfoAuthorizationManager(roleService)).and()
|
||||
.anonymous(spec -> {
|
||||
|
@ -65,15 +70,12 @@ public class WebServerSecurityConfig {
|
|||
spec.principal(AnonymousUserConst.PRINCIPAL);
|
||||
})
|
||||
.securityContextRepository(securityContextRepository)
|
||||
.formLogin(withDefaults())
|
||||
.logout(withDefaults())
|
||||
.httpBasic(withDefaults());
|
||||
|
||||
// Integrate with other configurers separately
|
||||
securityConfigurers.orderedStream()
|
||||
.forEach(securityConfigurer -> securityConfigurer.configure(http));
|
||||
|
||||
return http.build();
|
||||
return new DynamicMatcherSecurityWebFilterChain(extensionGetter, http.build());
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package run.halo.app.core.extension;
|
||||
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.NOT_REQUIRED;
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import run.halo.app.extension.AbstractExtension;
|
||||
import run.halo.app.extension.GVK;
|
||||
|
||||
/**
|
||||
* Auth provider extension.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@GVK(group = "auth.halo.run", version = "v1alpha1", kind = "AuthProvider",
|
||||
singular = "authprovider", plural = "authproviders")
|
||||
public class AuthProvider extends AbstractExtension {
|
||||
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private AuthProviderSpec spec;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public static class AuthProviderSpec {
|
||||
|
||||
@Schema(requiredMode = REQUIRED, description = "Display name of the auth provider")
|
||||
private String displayName;
|
||||
|
||||
private String description;
|
||||
|
||||
private String logo;
|
||||
|
||||
private String website;
|
||||
|
||||
private String helpPage;
|
||||
|
||||
@Schema(requiredMode = REQUIRED, description = "Authentication url of the auth provider")
|
||||
private String authenticationUrl;
|
||||
|
||||
private String bindingUrl;
|
||||
|
||||
private String unbindUrl;
|
||||
|
||||
@Schema(requiredMode = NOT_REQUIRED)
|
||||
private SettingRef settingRef;
|
||||
|
||||
@Schema(requiredMode = NOT_REQUIRED)
|
||||
private ConfigMapRef configMapRef;
|
||||
}
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public static class SettingRef {
|
||||
@Schema(requiredMode = REQUIRED, minLength = 1)
|
||||
private String name;
|
||||
|
||||
@Schema(requiredMode = REQUIRED, minLength = 1)
|
||||
private String group;
|
||||
}
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public static class ConfigMapRef {
|
||||
@Schema(requiredMode = REQUIRED, minLength = 1)
|
||||
private String name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package run.halo.app.core.extension;
|
||||
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.Instant;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import run.halo.app.extension.AbstractExtension;
|
||||
import run.halo.app.extension.GVK;
|
||||
import run.halo.app.extension.Metadata;
|
||||
|
||||
/**
|
||||
* User connection extension.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@GVK(group = "auth.halo.run", version = "v1alpha1", kind = "UserConnection",
|
||||
singular = "userconnection", plural = "userconnections")
|
||||
public class UserConnection extends AbstractExtension {
|
||||
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private UserConnectionSpec spec;
|
||||
|
||||
@Data
|
||||
public static class UserConnectionSpec {
|
||||
|
||||
/**
|
||||
* The name of the OAuth provider (e.g. Google, Facebook, Twitter).
|
||||
*/
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String registrationId;
|
||||
|
||||
/**
|
||||
* The {@link Metadata#getName()} of the user associated with the OAuth connection.
|
||||
*/
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* The unique identifier for the user's connection to the OAuth provider.
|
||||
* for example, the user's GitHub id.
|
||||
*/
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String providerUserId;
|
||||
|
||||
/**
|
||||
* The display name for the user's connection to the OAuth provider.
|
||||
*/
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String displayName;
|
||||
|
||||
/**
|
||||
* The URL to the user's profile page on the OAuth provider.
|
||||
* For example, the user's GitHub profile URL.
|
||||
*/
|
||||
private String profileUrl;
|
||||
|
||||
/**
|
||||
* The URL to the user's avatar image on the OAuth provider.
|
||||
* For example, the user's GitHub avatar URL.
|
||||
*/
|
||||
private String avatarUrl;
|
||||
|
||||
/**
|
||||
* The access token provided by the OAuth provider.
|
||||
*/
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
* The refresh token provided by the OAuth provider (if applicable).
|
||||
*/
|
||||
private String refreshToken;
|
||||
|
||||
private Instant expiresAt;
|
||||
|
||||
private Instant updatedAt;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package run.halo.app.core.extension.endpoint;
|
||||
|
||||
import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder;
|
||||
import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder;
|
||||
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.webflux.core.fn.SpringdocRouteBuilder;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.reactive.function.server.RouterFunction;
|
||||
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
import run.halo.app.core.extension.AuthProvider;
|
||||
import run.halo.app.security.AuthProviderService;
|
||||
import run.halo.app.security.ListedAuthProvider;
|
||||
|
||||
/**
|
||||
* Auth provider endpoint.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AuthProviderEndpoint implements CustomEndpoint {
|
||||
|
||||
private final AuthProviderService authProviderService;
|
||||
|
||||
@Override
|
||||
public RouterFunction<ServerResponse> endpoint() {
|
||||
final var tag = "api.console.halo.run/v1alpha1/AuthProvider";
|
||||
return SpringdocRouteBuilder.route()
|
||||
.GET("auth-providers", this::listAuthProviders,
|
||||
builder -> builder.operationId("listAuthProviders")
|
||||
.description("Lists all auth providers")
|
||||
.tag(tag)
|
||||
.response(responseBuilder()
|
||||
.implementationArray(ListedAuthProvider.class))
|
||||
)
|
||||
.PUT("auth-providers/{name}/enable", this::enableAuthProvider,
|
||||
builder -> builder.operationId("enableAuthProvider")
|
||||
.description("Enables an auth provider")
|
||||
.tag(tag)
|
||||
.parameter(parameterBuilder()
|
||||
.name("name")
|
||||
.in(ParameterIn.PATH)
|
||||
.required(true)
|
||||
.implementation(String.class)
|
||||
)
|
||||
.response(responseBuilder()
|
||||
.implementation(AuthProvider.class))
|
||||
)
|
||||
.PUT("auth-providers/{name}/disable", this::disableAuthProvider,
|
||||
builder -> builder.operationId("disableAuthProvider")
|
||||
.description("Disables an auth provider")
|
||||
.tag(tag)
|
||||
.parameter(parameterBuilder()
|
||||
.name("name")
|
||||
.in(ParameterIn.PATH)
|
||||
.required(true)
|
||||
.implementation(String.class)
|
||||
)
|
||||
.response(responseBuilder()
|
||||
.implementation(AuthProvider.class))
|
||||
)
|
||||
.build();
|
||||
}
|
||||
|
||||
private Mono<ServerResponse> enableAuthProvider(ServerRequest request) {
|
||||
String name = request.pathVariable("name");
|
||||
return authProviderService.enable(name)
|
||||
.flatMap(authProvider -> ServerResponse.ok().bodyValue(authProvider));
|
||||
}
|
||||
|
||||
private Mono<ServerResponse> disableAuthProvider(ServerRequest request) {
|
||||
String name = request.pathVariable("name");
|
||||
return authProviderService.disable(name)
|
||||
.flatMap(authProvider -> ServerResponse.ok().bodyValue(authProvider));
|
||||
}
|
||||
|
||||
Mono<ServerResponse> listAuthProviders(ServerRequest request) {
|
||||
return authProviderService.listAll()
|
||||
.flatMap(providers -> ServerResponse.ok().bodyValue(providers));
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import org.springframework.context.ApplicationListener;
|
|||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Component;
|
||||
import run.halo.app.core.extension.AnnotationSetting;
|
||||
import run.halo.app.core.extension.AuthProvider;
|
||||
import run.halo.app.core.extension.Counter;
|
||||
import run.halo.app.core.extension.Menu;
|
||||
import run.halo.app.core.extension.MenuItem;
|
||||
|
@ -16,6 +17,7 @@ import run.halo.app.core.extension.RoleBinding;
|
|||
import run.halo.app.core.extension.Setting;
|
||||
import run.halo.app.core.extension.Theme;
|
||||
import run.halo.app.core.extension.User;
|
||||
import run.halo.app.core.extension.UserConnection;
|
||||
import run.halo.app.core.extension.attachment.Attachment;
|
||||
import run.halo.app.core.extension.attachment.Group;
|
||||
import run.halo.app.core.extension.attachment.Policy;
|
||||
|
@ -29,6 +31,8 @@ import run.halo.app.core.extension.content.Snapshot;
|
|||
import run.halo.app.core.extension.content.Tag;
|
||||
import run.halo.app.extension.ConfigMap;
|
||||
import run.halo.app.extension.SchemeManager;
|
||||
import run.halo.app.plugin.extensionpoint.ExtensionDefinition;
|
||||
import run.halo.app.plugin.extensionpoint.ExtensionPointDefinition;
|
||||
import run.halo.app.search.extension.SearchEngine;
|
||||
import run.halo.app.security.authentication.pat.PersonalAccessToken;
|
||||
|
||||
|
@ -53,6 +57,8 @@ public class SchemeInitializer implements ApplicationListener<ApplicationStarted
|
|||
// plugin.halo.run
|
||||
schemeManager.register(Plugin.class);
|
||||
schemeManager.register(SearchEngine.class);
|
||||
schemeManager.register(ExtensionPointDefinition.class);
|
||||
schemeManager.register(ExtensionDefinition.class);
|
||||
|
||||
schemeManager.register(RoleBinding.class);
|
||||
schemeManager.register(User.class);
|
||||
|
@ -77,6 +83,9 @@ public class SchemeInitializer implements ApplicationListener<ApplicationStarted
|
|||
schemeManager.register(PolicyTemplate.class);
|
||||
// metrics.halo.run
|
||||
schemeManager.register(Counter.class);
|
||||
// auth.halo.run
|
||||
schemeManager.register(AuthProvider.class);
|
||||
schemeManager.register(UserConnection.class);
|
||||
|
||||
eventPublisher.publishEvent(new SchemeInitializedEvent(this));
|
||||
}
|
||||
|
|
|
@ -102,6 +102,12 @@ public class SystemSetting {
|
|||
public String primary;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class AuthProvider {
|
||||
public static final String GROUP = "authProvider";
|
||||
private Set<String> enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* ExtensionPointEnabled key is full qualified name of extension point and value is a list of
|
||||
* full qualified name of implementation.
|
||||
|
|
|
@ -2,6 +2,7 @@ package run.halo.app.plugin;
|
|||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.security.web.server.context.ServerSecurityContextRepository;
|
||||
import org.springframework.stereotype.Component;
|
||||
import run.halo.app.extension.DefaultSchemeManager;
|
||||
import run.halo.app.extension.ExtensionClient;
|
||||
|
@ -64,6 +65,8 @@ public class SharedApplicationContextHolder {
|
|||
beanFactory.registerSingleton("schemeManager", defaultSchemeManager);
|
||||
beanFactory.registerSingleton("externalUrlSupplier",
|
||||
rootApplicationContext.getBean(ExternalUrlSupplier.class));
|
||||
beanFactory.registerSingleton("serverSecurityContextRepository",
|
||||
rootApplicationContext.getBean(ServerSecurityContextRepository.class));
|
||||
// TODO add more shared instance here
|
||||
|
||||
return sharedApplicationContext;
|
||||
|
|
|
@ -1,16 +1,21 @@
|
|||
package run.halo.app.plugin.extensionpoint;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.pf4j.ExtensionPoint;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import run.halo.app.extension.ReactiveExtensionClient;
|
||||
import run.halo.app.infra.SystemConfigurableEnvironmentFetcher;
|
||||
import run.halo.app.infra.SystemSetting.ExtensionPointEnabled;
|
||||
import run.halo.app.plugin.HaloPluginManager;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DefaultExtensionGetter implements ExtensionGetter {
|
||||
|
||||
private final SystemConfigurableEnvironmentFetcher systemConfigFetcher;
|
||||
|
@ -19,12 +24,7 @@ public class DefaultExtensionGetter implements ExtensionGetter {
|
|||
|
||||
private final ApplicationContext applicationContext;
|
||||
|
||||
public DefaultExtensionGetter(SystemConfigurableEnvironmentFetcher systemConfigFetcher,
|
||||
HaloPluginManager pluginManager, ApplicationContext applicationContext) {
|
||||
this.systemConfigFetcher = systemConfigFetcher;
|
||||
this.pluginManager = pluginManager;
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
private final ReactiveExtensionClient client;
|
||||
|
||||
@Override
|
||||
public <T extends ExtensionPoint> Mono<T> getEnabledExtension(Class<T> extensionPoint) {
|
||||
|
@ -64,4 +64,33 @@ public class DefaultExtensionGetter implements ExtensionGetter {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends ExtensionPoint> Flux<T> getEnabledExtensionByDefinition(
|
||||
Class<T> extensionPoint) {
|
||||
return fetchExtensionPointDefinition(extensionPoint)
|
||||
.flatMapMany(extensionPointDefinition -> {
|
||||
ExtensionPointDefinition.ExtensionPointType type =
|
||||
extensionPointDefinition.getSpec().getType();
|
||||
if (type == ExtensionPointDefinition.ExtensionPointType.SINGLETON) {
|
||||
return getEnabledExtension(extensionPoint).flux();
|
||||
}
|
||||
Stream<T> pluginExtsStream = pluginManager.getExtensions(extensionPoint)
|
||||
.stream();
|
||||
Stream<T> systemExtsStream = applicationContext.getBeanProvider(extensionPoint)
|
||||
.orderedStream();
|
||||
// TODO If the type is sortable, may need to process the returned order.
|
||||
return Flux.just(pluginExtsStream, systemExtsStream)
|
||||
.flatMap(Flux::fromStream);
|
||||
});
|
||||
}
|
||||
|
||||
Mono<ExtensionPointDefinition> fetchExtensionPointDefinition(
|
||||
Class<? extends ExtensionPoint> extensionPoint) {
|
||||
// TODO Optimize query
|
||||
return client.list(ExtensionPointDefinition.class, definition ->
|
||||
extensionPoint.getName().equals(definition.getSpec().getClassName()),
|
||||
Comparator.comparing(definition -> definition.getMetadata().getCreationTimestamp())
|
||||
)
|
||||
.next();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package run.halo.app.plugin.extensionpoint;
|
||||
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import run.halo.app.extension.AbstractExtension;
|
||||
import run.halo.app.extension.GVK;
|
||||
|
||||
/**
|
||||
* Extension definition.
|
||||
* An {@link ExtensionDefinition} is a type of metadata that provides additional information about
|
||||
* an extension. An extension is a way to add new functionality to an existing class, structure,
|
||||
* enumeration, or protocol type without needing to subclass it.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@GVK(group = "plugin.halo.run", version = "v1alpha1",
|
||||
kind = "ExtensionDefinition", singular = "extensiondefinition",
|
||||
plural = "extensiondefinitions")
|
||||
public class ExtensionDefinition extends AbstractExtension {
|
||||
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private ExtensionSpec spec;
|
||||
|
||||
@Data
|
||||
public static class ExtensionSpec {
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String className;
|
||||
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String extensionPointName;
|
||||
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String displayName;
|
||||
|
||||
private String description;
|
||||
|
||||
private String icon;
|
||||
}
|
||||
}
|
|
@ -24,4 +24,14 @@ public interface ExtensionGetter {
|
|||
*/
|
||||
<T extends ExtensionPoint> Flux<T> getEnabledExtensions(Class<T> extensionPoint);
|
||||
|
||||
/**
|
||||
* Get the extension(s) according to the {@link ExtensionPointDefinition} queried
|
||||
* by incoming extension point class.
|
||||
*
|
||||
* @param extensionPoint extension point class
|
||||
* @return implementations of the corresponding extension point.
|
||||
* @throws IllegalArgumentException if the incoming extension point class does not have
|
||||
* the {@link ExtensionPointDefinition}.
|
||||
*/
|
||||
<T extends ExtensionPoint> Flux<T> getEnabledExtensionByDefinition(Class<T> extensionPoint);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
package run.halo.app.plugin.extensionpoint;
|
||||
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import run.halo.app.extension.AbstractExtension;
|
||||
import run.halo.app.extension.GVK;
|
||||
|
||||
/**
|
||||
* Extension point definition.
|
||||
* An {@link ExtensionPointDefinition} is a concept used in <code>Halo</code> to allow for the
|
||||
* dynamic extension of system. It defines a location within <code>Halo</code> where
|
||||
* additional functionality can be added through the use of plugins or extensions.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@GVK(group = "plugin.halo.run", version = "v1alpha1",
|
||||
kind = "ExtensionPointDefinition", singular = "extensionpointdefinition",
|
||||
plural = "extensionpointdefinitions")
|
||||
public class ExtensionPointDefinition extends AbstractExtension {
|
||||
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private ExtensionPointSpec spec;
|
||||
|
||||
@Data
|
||||
public static class ExtensionPointSpec {
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String className;
|
||||
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private String displayName;
|
||||
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
private ExtensionPointType type;
|
||||
|
||||
private String description;
|
||||
|
||||
private String icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Types of extension points include.</p>
|
||||
* There are several types:
|
||||
* <ul>
|
||||
* <li>Singleton extension point: means that only one implementation class of the extension
|
||||
* point can be enabled. It is generally used for global core extension points, such as global
|
||||
* logging components. When using a singleton extension point, it is necessary to ensure that
|
||||
* only one implementation class is enabled, otherwise unexpected issues may occur.</li>
|
||||
* <li>Multi-instance extension point: means that there can be multiple implementation
|
||||
* classes of the extension point enabled, and the execution order of each implementation
|
||||
* class may be different. It is generally used for specific business logic extension points,
|
||||
* such as the selection of data sources or the use of caches. When using a multi-instance
|
||||
* extension point, it is necessary to consider the dependency relationship and execution
|
||||
* order between each implementation class to ensure the correctness of the business logic.</li>
|
||||
* <li>Ordered extension point: means that multiple implementation classes of the extension
|
||||
* point can be enabled, but they need to be executed in a specified order. It is generally
|
||||
* used in scenarios that require strict control of execution order, such as the execution
|
||||
* order of message listeners. When using an ordered extension point, it is necessary to
|
||||
* assign a priority for each implementation class to ensure that they can be executed in the
|
||||
* correct order.</li>
|
||||
* <li>Conditional extension point: means that multiple implementation classes of the extension
|
||||
* point can be enabled, but they need to meet specific conditions to be executed. For
|
||||
* example, some implementation classes can only be executed under specific operating systems
|
||||
* or specific runtime environments. When using a conditional extension point, it is
|
||||
* necessary to define appropriate conditions according to the actual scenario to ensure the
|
||||
* correctness and availability of the extension point.</li>
|
||||
* </ul>
|
||||
* There are two kinds of definitions for the time being: SINGLETON and MULTI_INSTANCE.
|
||||
*/
|
||||
public enum ExtensionPointType {
|
||||
SINGLETON,
|
||||
MULTI_INSTANCE;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package run.halo.app.security;
|
||||
|
||||
import org.pf4j.ExtensionPoint;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.web.server.WebFilter;
|
||||
|
||||
/**
|
||||
* Contract for interception-style, chained processing of Web requests that may be used to
|
||||
* implement cross-cutting, application-agnostic requirements such as security, timeouts, and
|
||||
* others.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
public interface AdditionalWebFilter extends WebFilter, ExtensionPoint, Ordered {
|
||||
|
||||
/**
|
||||
* Gets the order value of the object.
|
||||
*
|
||||
* @return the order value
|
||||
*/
|
||||
default int getOrder() {
|
||||
return Ordered.LOWEST_PRECEDENCE;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package run.halo.app.security;
|
||||
|
||||
import java.util.List;
|
||||
import reactor.core.publisher.Mono;
|
||||
import run.halo.app.core.extension.AuthProvider;
|
||||
|
||||
/**
|
||||
* A service for {@link AuthProvider}.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
public interface AuthProviderService {
|
||||
|
||||
Mono<AuthProvider> enable(String name);
|
||||
|
||||
Mono<AuthProvider> disable(String name);
|
||||
|
||||
Mono<List<ListedAuthProvider>> listAll();
|
||||
}
|
|
@ -0,0 +1,153 @@
|
|||
package run.halo.app.security;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.security.core.context.ReactiveSecurityContextHolder;
|
||||
import org.springframework.stereotype.Component;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import run.halo.app.core.extension.AuthProvider;
|
||||
import run.halo.app.core.extension.UserConnection;
|
||||
import run.halo.app.extension.ConfigMap;
|
||||
import run.halo.app.extension.ReactiveExtensionClient;
|
||||
import run.halo.app.infra.SystemSetting;
|
||||
import run.halo.app.infra.utils.JsonUtils;
|
||||
|
||||
/**
|
||||
* A default implementation of {@link AuthProviderService}.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AuthProviderServiceImpl implements AuthProviderService {
|
||||
private final ReactiveExtensionClient client;
|
||||
|
||||
@Override
|
||||
public Mono<AuthProvider> enable(String name) {
|
||||
return client.get(AuthProvider.class, name)
|
||||
.flatMap(authProvider -> updateAuthProviderEnabled(enabled -> enabled.add(name))
|
||||
.thenReturn(authProvider)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<AuthProvider> disable(String name) {
|
||||
return client.get(AuthProvider.class, name)
|
||||
.flatMap(authProvider -> updateAuthProviderEnabled(enabled -> enabled.remove(name))
|
||||
.thenReturn(authProvider)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<List<ListedAuthProvider>> listAll() {
|
||||
return client.list(AuthProvider.class, provider ->
|
||||
provider.getMetadata().getDeletionTimestamp() == null,
|
||||
Comparator.comparing(item -> item.getMetadata().getCreationTimestamp())
|
||||
)
|
||||
.map(this::convertTo)
|
||||
.collectList()
|
||||
.flatMap(providers -> listMyConnections()
|
||||
.map(connection -> connection.getSpec().getRegistrationId())
|
||||
.collectList()
|
||||
.map(connectedNames -> providers.stream()
|
||||
.peek(provider -> {
|
||||
boolean isBound = connectedNames.contains(provider.getName());
|
||||
provider.setIsBound(isBound);
|
||||
})
|
||||
.collect(Collectors.toList())
|
||||
)
|
||||
.defaultIfEmpty(providers)
|
||||
)
|
||||
.flatMap(providers -> fetchEnabledAuthProviders()
|
||||
.map(names -> providers.stream()
|
||||
.peek(provider -> {
|
||||
boolean enabled = names.contains(provider.getName());
|
||||
provider.setEnabled(enabled);
|
||||
})
|
||||
.collect(Collectors.toList())
|
||||
)
|
||||
.defaultIfEmpty(providers)
|
||||
);
|
||||
}
|
||||
|
||||
private Mono<Set<String>> fetchEnabledAuthProviders() {
|
||||
return client.fetch(ConfigMap.class, SystemSetting.SYSTEM_CONFIG)
|
||||
.map(configMap -> {
|
||||
SystemSetting.AuthProvider authProvider = getAuthProvider(configMap);
|
||||
return authProvider.getEnabled();
|
||||
});
|
||||
}
|
||||
|
||||
Flux<UserConnection> listMyConnections() {
|
||||
return ReactiveSecurityContextHolder.getContext()
|
||||
.map(securityContext -> securityContext.getAuthentication().getName())
|
||||
.flatMapMany(username -> client.list(UserConnection.class,
|
||||
persisted -> persisted.getSpec().getUsername().equals(username),
|
||||
Comparator.comparing(item -> item.getMetadata()
|
||||
.getCreationTimestamp())
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private Mono<ConfigMap> updateAuthProviderEnabled(Consumer<Set<String>> consumer) {
|
||||
return client.fetch(ConfigMap.class, SystemSetting.SYSTEM_CONFIG)
|
||||
.flatMap(configMap -> {
|
||||
SystemSetting.AuthProvider authProvider = getAuthProvider(configMap);
|
||||
final Map<String, String> data = configMap.getData();
|
||||
consumer.accept(authProvider.getEnabled());
|
||||
data.put(SystemSetting.AuthProvider.GROUP, JsonUtils.objectToJson(authProvider));
|
||||
return client.update(configMap);
|
||||
});
|
||||
}
|
||||
|
||||
private ListedAuthProvider convertTo(AuthProvider authProvider) {
|
||||
return ListedAuthProvider.builder()
|
||||
.name(authProvider.getMetadata().getName())
|
||||
.displayName(authProvider.getSpec().getDisplayName())
|
||||
.logo(authProvider.getSpec().getLogo())
|
||||
.website(authProvider.getSpec().getWebsite())
|
||||
.description(authProvider.getSpec().getDescription())
|
||||
.authenticationUrl(authProvider.getSpec().getAuthenticationUrl())
|
||||
.helpPage(authProvider.getSpec().getHelpPage())
|
||||
.bindingUrl(authProvider.getSpec().getBindingUrl())
|
||||
.unbindingUrl(authProvider.getSpec().getUnbindUrl())
|
||||
.isBound(false)
|
||||
.enabled(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static SystemSetting.AuthProvider getAuthProvider(ConfigMap configMap) {
|
||||
if (configMap.getData() == null) {
|
||||
configMap.setData(new HashMap<>());
|
||||
}
|
||||
final Map<String, String> data = configMap.getData();
|
||||
String providerGroup = data.get(SystemSetting.AuthProvider.GROUP);
|
||||
|
||||
SystemSetting.AuthProvider authProvider;
|
||||
if (StringUtils.isBlank(providerGroup)) {
|
||||
authProvider = new SystemSetting.AuthProvider();
|
||||
} else {
|
||||
authProvider =
|
||||
JsonUtils.jsonToObject(providerGroup, SystemSetting.AuthProvider.class);
|
||||
}
|
||||
|
||||
if (authProvider.getEnabled() == null) {
|
||||
authProvider.setEnabled(new HashSet<>());
|
||||
}
|
||||
// default enable local auth provider
|
||||
authProvider.getEnabled().add("local");
|
||||
return authProvider;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package run.halo.app.security;
|
||||
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.security.web.server.SecurityWebFilterChain;
|
||||
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import org.springframework.web.server.WebFilter;
|
||||
import org.springframework.web.server.WebFilterChain;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import run.halo.app.plugin.extensionpoint.ExtensionGetter;
|
||||
|
||||
/**
|
||||
* A {@link SecurityWebFilterChain} that leverages a {@link ServerWebExchangeMatcher} to
|
||||
* determine which {@link WebFilter} to execute.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
public class DynamicMatcherSecurityWebFilterChain implements SecurityWebFilterChain {
|
||||
|
||||
private final SecurityWebFilterChain delegate;
|
||||
|
||||
private final ExtensionGetter extensionGetter;
|
||||
|
||||
public DynamicMatcherSecurityWebFilterChain(ExtensionGetter extensionGetter,
|
||||
SecurityWebFilterChain delegate) {
|
||||
this.delegate = delegate;
|
||||
this.extensionGetter = extensionGetter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Boolean> matches(ServerWebExchange exchange) {
|
||||
return delegate.matches(exchange);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<WebFilter> getWebFilters() {
|
||||
return Flux.merge(delegate.getWebFilters(), getAdditionalFilters())
|
||||
.sort(new AnnotationAwareOrderComparator());
|
||||
}
|
||||
|
||||
private Flux<WebFilter> getAdditionalFilters() {
|
||||
return extensionGetter.getEnabledExtensionByDefinition(AdditionalWebFilter.class)
|
||||
.map(additionalWebFilter -> new OrderedWebFilter(additionalWebFilter,
|
||||
additionalWebFilter.getOrder())
|
||||
);
|
||||
}
|
||||
|
||||
private record OrderedWebFilter(WebFilter webFilter, int order) implements WebFilter, Ordered {
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public Mono<Void> filter(@NonNull ServerWebExchange exchange,
|
||||
@NonNull WebFilterChain chain) {
|
||||
return this.webFilter.filter(exchange, chain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package run.halo.app.security;
|
||||
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* A listed value object for {@link run.halo.app.core.extension.AuthProvider}.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class ListedAuthProvider {
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
String name;
|
||||
|
||||
@Schema(requiredMode = REQUIRED)
|
||||
String displayName;
|
||||
|
||||
String description;
|
||||
|
||||
String logo;
|
||||
|
||||
String website;
|
||||
|
||||
String authenticationUrl;
|
||||
|
||||
String helpPage;
|
||||
|
||||
String bindingUrl;
|
||||
|
||||
String unbindingUrl;
|
||||
|
||||
Boolean isBound;
|
||||
|
||||
Boolean enabled;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package run.halo.app.security.authentication.login;
|
||||
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.security.config.web.server.SecurityWebFiltersOrder;
|
||||
import org.springframework.security.web.server.ui.LogoutPageGeneratingWebFilter;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import org.springframework.web.server.WebFilterChain;
|
||||
import reactor.core.publisher.Mono;
|
||||
import run.halo.app.security.AdditionalWebFilter;
|
||||
|
||||
/**
|
||||
* Generates a default log out page.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@Component
|
||||
public class DelegatingLogoutPageGeneratingWebFilter implements AdditionalWebFilter {
|
||||
private final LogoutPageGeneratingWebFilter logoutPageGeneratingWebFilter =
|
||||
new LogoutPageGeneratingWebFilter();
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public Mono<Void> filter(@NonNull ServerWebExchange exchange, @NonNull WebFilterChain chain) {
|
||||
return logoutPageGeneratingWebFilter.filter(exchange, chain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return SecurityWebFiltersOrder.LOGOUT_PAGE_GENERATING.getOrder();
|
||||
}
|
||||
}
|
|
@ -7,11 +7,11 @@ import java.util.Map;
|
|||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.security.authentication.ObservationReactiveAuthenticationManager;
|
||||
import org.springframework.security.authentication.ReactiveAuthenticationManager;
|
||||
import org.springframework.security.authentication.UserDetailsRepositoryReactiveAuthenticationManager;
|
||||
import org.springframework.security.config.web.server.SecurityWebFiltersOrder;
|
||||
import org.springframework.security.config.web.server.ServerHttpSecurity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.CredentialsContainer;
|
||||
|
@ -25,16 +25,23 @@ import org.springframework.security.web.server.authentication.RedirectServerAuth
|
|||
import org.springframework.security.web.server.authentication.ServerAuthenticationFailureHandler;
|
||||
import org.springframework.security.web.server.authentication.ServerAuthenticationSuccessHandler;
|
||||
import org.springframework.security.web.server.context.ServerSecurityContextRepository;
|
||||
import org.springframework.security.web.server.ui.LogoutPageGeneratingWebFilter;
|
||||
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher;
|
||||
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatchers;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import org.springframework.web.server.WebFilterChain;
|
||||
import reactor.core.publisher.Mono;
|
||||
import run.halo.app.security.authentication.SecurityConfigurer;
|
||||
import run.halo.app.security.AdditionalWebFilter;
|
||||
|
||||
/**
|
||||
* Authentication filter for username and password.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@Component
|
||||
public class LoginConfigurer implements SecurityConfigurer {
|
||||
public class UsernamePasswordAuthenticator implements AdditionalWebFilter {
|
||||
|
||||
private final ServerResponse.Context context;
|
||||
|
||||
|
@ -50,13 +57,12 @@ public class LoginConfigurer implements SecurityConfigurer {
|
|||
|
||||
private final CryptoService cryptoService;
|
||||
|
||||
public LoginConfigurer(ServerResponse.Context context,
|
||||
ObservationRegistry observationRegistry,
|
||||
ReactiveUserDetailsService userDetailsService,
|
||||
ReactiveUserDetailsPasswordService passwordService,
|
||||
PasswordEncoder passwordEncoder,
|
||||
ServerSecurityContextRepository securityContextRepository,
|
||||
CryptoService cryptoService) {
|
||||
private final AuthenticationWebFilter authenticationWebFilter;
|
||||
|
||||
public UsernamePasswordAuthenticator(ServerResponse.Context context,
|
||||
ObservationRegistry observationRegistry, ReactiveUserDetailsService userDetailsService,
|
||||
ReactiveUserDetailsPasswordService passwordService, PasswordEncoder passwordEncoder,
|
||||
ServerSecurityContextRepository securityContextRepository, CryptoService cryptoService) {
|
||||
this.context = context;
|
||||
this.observationRegistry = observationRegistry;
|
||||
this.userDetailsService = userDetailsService;
|
||||
|
@ -64,27 +70,29 @@ public class LoginConfigurer implements SecurityConfigurer {
|
|||
this.passwordEncoder = passwordEncoder;
|
||||
this.securityContextRepository = securityContextRepository;
|
||||
this.cryptoService = cryptoService;
|
||||
|
||||
this.authenticationWebFilter = new AuthenticationWebFilter(authenticationManager());
|
||||
configureAuthenticationWebFilter(this.authenticationWebFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(ServerHttpSecurity http) {
|
||||
// We disable the form login because we will customize the login by ourselves.
|
||||
// See https://github.com/spring-projects/spring-security/issues/5361 for more.
|
||||
http.formLogin()
|
||||
.disable();
|
||||
@NonNull
|
||||
public Mono<Void> filter(@NonNull ServerWebExchange exchange, @NonNull WebFilterChain chain) {
|
||||
return authenticationWebFilter.filter(exchange, chain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return SecurityWebFiltersOrder.FORM_LOGIN.getOrder();
|
||||
}
|
||||
|
||||
void configureAuthenticationWebFilter(AuthenticationWebFilter filter) {
|
||||
var requiresMatcher = ServerWebExchangeMatchers.pathMatchers(HttpMethod.POST, "/login");
|
||||
|
||||
var filter = new AuthenticationWebFilter(authenticationManager());
|
||||
filter.setRequiresAuthenticationMatcher(requiresMatcher);
|
||||
filter.setAuthenticationFailureHandler(new LoginFailureHandler());
|
||||
filter.setAuthenticationSuccessHandler(new LoginSuccessHandler());
|
||||
filter.setServerAuthenticationConverter(new LoginAuthenticationConverter(cryptoService));
|
||||
filter.setSecurityContextRepository(securityContextRepository);
|
||||
|
||||
http.addFilterAt(filter, SecurityWebFiltersOrder.FORM_LOGIN);
|
||||
http.addFilterAt(new LogoutPageGeneratingWebFilter(),
|
||||
SecurityWebFiltersOrder.LOGOUT_PAGE_GENERATING);
|
||||
}
|
||||
|
||||
ReactiveAuthenticationManager authenticationManager() {
|
||||
|
@ -123,6 +131,11 @@ public class LoginConfigurer implements SecurityConfigurer {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles login failure.
|
||||
*
|
||||
* @author johnniang
|
||||
*/
|
||||
public class LoginFailureHandler implements ServerAuthenticationFailureHandler {
|
||||
|
||||
private final ServerAuthenticationFailureHandler defaultHandler =
|
||||
|
@ -144,6 +157,5 @@ public class LoginConfigurer implements SecurityConfigurer {
|
|||
.switchIfEmpty(
|
||||
defaultHandler.onAuthenticationFailure(webFilterExchange, exception));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package run.halo.app.security.authentication.login;
|
||||
|
||||
import static run.halo.app.security.authentication.WebExchangeMatchers.ignoringMediaTypeAll;
|
||||
|
||||
import java.net.URI;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.security.config.web.server.SecurityWebFiltersOrder;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.web.server.WebFilterExchange;
|
||||
import org.springframework.security.web.server.authentication.logout.LogoutWebFilter;
|
||||
import org.springframework.security.web.server.authentication.logout.RedirectServerLogoutSuccessHandler;
|
||||
import org.springframework.security.web.server.authentication.logout.SecurityContextServerLogoutHandler;
|
||||
import org.springframework.security.web.server.authentication.logout.ServerLogoutSuccessHandler;
|
||||
import org.springframework.security.web.server.context.ServerSecurityContextRepository;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import org.springframework.web.server.WebFilterChain;
|
||||
import reactor.core.publisher.Mono;
|
||||
import run.halo.app.security.AdditionalWebFilter;
|
||||
|
||||
/**
|
||||
* Logout handler for username password authentication.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@Component
|
||||
public class UsernamePasswordLogoutHandler implements AdditionalWebFilter {
|
||||
private final ServerSecurityContextRepository securityContextRepository;
|
||||
private final LogoutWebFilter logoutWebFilter;
|
||||
|
||||
/**
|
||||
* Constructs a {@link UsernamePasswordLogoutHandler} with the given
|
||||
* {@link ServerSecurityContextRepository}.
|
||||
* It will create a {@link LogoutWebFilter} instance and configure it.
|
||||
*
|
||||
* @param securityContextRepository a {@link ServerSecurityContextRepository} instance
|
||||
*/
|
||||
public UsernamePasswordLogoutHandler(
|
||||
ServerSecurityContextRepository securityContextRepository) {
|
||||
this.securityContextRepository = securityContextRepository;
|
||||
|
||||
this.logoutWebFilter = new LogoutWebFilter();
|
||||
configureLogoutWebFilter(logoutWebFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public Mono<Void> filter(@NonNull ServerWebExchange exchange, @NonNull WebFilterChain chain) {
|
||||
return logoutWebFilter.filter(exchange, chain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return SecurityWebFiltersOrder.LOGOUT.getOrder();
|
||||
}
|
||||
|
||||
void configureLogoutWebFilter(LogoutWebFilter filter) {
|
||||
var securityContextServerLogoutHandler = new SecurityContextServerLogoutHandler();
|
||||
securityContextServerLogoutHandler.setSecurityContextRepository(securityContextRepository);
|
||||
filter.setLogoutHandler(securityContextServerLogoutHandler);
|
||||
filter.setLogoutSuccessHandler(new LogoutSuccessHandler());
|
||||
}
|
||||
|
||||
/**
|
||||
* Success handler for logout.
|
||||
*
|
||||
* @author johnniang
|
||||
*/
|
||||
public static class LogoutSuccessHandler implements ServerLogoutSuccessHandler {
|
||||
|
||||
private final ServerLogoutSuccessHandler defaultHandler;
|
||||
|
||||
public LogoutSuccessHandler() {
|
||||
var defaultHandler = new RedirectServerLogoutSuccessHandler();
|
||||
defaultHandler.setLogoutSuccessUrl(URI.create("/console/?logout"));
|
||||
this.defaultHandler = defaultHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> onLogoutSuccess(WebFilterExchange exchange,
|
||||
Authentication authentication) {
|
||||
return ignoringMediaTypeAll(MediaType.APPLICATION_JSON).matches(exchange.getExchange())
|
||||
.flatMap(matchResult -> {
|
||||
if (matchResult.isMatch()) {
|
||||
exchange.getExchange().getResponse().setStatusCode(HttpStatus.OK);
|
||||
return Mono.empty();
|
||||
}
|
||||
return defaultHandler.onLogoutSuccess(exchange, authentication);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
package run.halo.app.security.authentication.logout;
|
||||
|
||||
import static run.halo.app.security.authentication.WebExchangeMatchers.ignoringMediaTypeAll;
|
||||
|
||||
import java.net.URI;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.config.web.server.ServerHttpSecurity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.web.server.WebFilterExchange;
|
||||
import org.springframework.security.web.server.authentication.logout.RedirectServerLogoutSuccessHandler;
|
||||
import org.springframework.security.web.server.authentication.logout.ServerLogoutSuccessHandler;
|
||||
import org.springframework.stereotype.Component;
|
||||
import reactor.core.publisher.Mono;
|
||||
import run.halo.app.security.authentication.SecurityConfigurer;
|
||||
|
||||
@Component
|
||||
public class LogoutConfigurer implements SecurityConfigurer {
|
||||
|
||||
@Override
|
||||
public void configure(ServerHttpSecurity http) {
|
||||
http.logout()
|
||||
.logoutSuccessHandler(new LogoutSuccessHandler());
|
||||
}
|
||||
|
||||
public static class LogoutSuccessHandler implements ServerLogoutSuccessHandler {
|
||||
|
||||
private final ServerLogoutSuccessHandler defaultHandler;
|
||||
|
||||
public LogoutSuccessHandler() {
|
||||
var defaultHandler = new RedirectServerLogoutSuccessHandler();
|
||||
defaultHandler.setLogoutSuccessUrl(URI.create("/console/?logout"));
|
||||
this.defaultHandler = defaultHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> onLogoutSuccess(WebFilterExchange exchange,
|
||||
Authentication authentication) {
|
||||
return ignoringMediaTypeAll(MediaType.APPLICATION_JSON).matches(exchange.getExchange())
|
||||
.flatMap(matchResult -> {
|
||||
if (matchResult.isMatch()) {
|
||||
exchange.getExchange().getResponse().setStatusCode(HttpStatus.OK);
|
||||
return Mono.empty();
|
||||
}
|
||||
return defaultHandler.onLogoutSuccess(exchange, authentication);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
apiVersion: auth.halo.run/v1alpha1
|
||||
kind: AuthProvider
|
||||
metadata:
|
||||
name: local
|
||||
finalizers:
|
||||
- system-protection
|
||||
spec:
|
||||
displayName: Local
|
||||
enabled: true
|
||||
description: Built-in authentication for Halo.
|
||||
logo: https://halo.run/logo
|
||||
website: https://halo.run
|
||||
authenticationUrl: /login
|
|
@ -0,0 +1,35 @@
|
|||
apiVersion: plugin.halo.run/v1alpha1
|
||||
kind: ExtensionDefinition
|
||||
metadata:
|
||||
name: username-password-authenticator
|
||||
labels:
|
||||
auth.halo.run/extension-point-name: "additional-webfilter"
|
||||
spec:
|
||||
className: run.halo.app.security.authentication.login.UsernamePasswordAuthenticator
|
||||
extensionPointName: additional-webfilter
|
||||
displayName: "UsernamePasswordAuthenticator"
|
||||
description: "Authenticates a user by username and password."
|
||||
---
|
||||
apiVersion: plugin.halo.run/v1alpha1
|
||||
kind: ExtensionDefinition
|
||||
metadata:
|
||||
name: username-password-logout-handler
|
||||
labels:
|
||||
auth.halo.run/extension-point-name: "additional-webfilter"
|
||||
spec:
|
||||
className: run.halo.app.security.authentication.login.UsernamePasswordLogoutHandler
|
||||
extensionPointName: additional-webfilter
|
||||
displayName: "UsernamePasswordLogoutHandler"
|
||||
description: "Logout handler for username and password authentication."
|
||||
---
|
||||
apiVersion: plugin.halo.run/v1alpha1
|
||||
kind: ExtensionDefinition
|
||||
metadata:
|
||||
name: delegating-logout-page-generating-webfilter
|
||||
labels:
|
||||
auth.halo.run/extension-point-name: "additional-webfilter"
|
||||
spec:
|
||||
className: run.halo.app.security.authentication.login.DelegatingLogoutPageGeneratingWebFilter
|
||||
extensionPointName: additional-webfilter
|
||||
displayName: "DelegatingLogoutPageGeneratingWebFilter"
|
||||
description: "Generates a default log out page."
|
|
@ -0,0 +1,10 @@
|
|||
apiVersion: plugin.halo.run/v1alpha1
|
||||
kind: ExtensionPointDefinition
|
||||
metadata:
|
||||
name: additional-webfilter
|
||||
spec:
|
||||
className: run.halo.app.security.AdditionalWebFilter
|
||||
displayName: AdditionalWebFilter
|
||||
type: MULTI_INSTANCE
|
||||
description: "Contract for interception-style, chained processing of Web requests that may be used to
|
||||
implement cross-cutting, application-agnostic requirements such as security, timeouts, and others."
|
|
@ -19,6 +19,9 @@ rules:
|
|||
resources: [ "configmaps" ]
|
||||
resourceNames: [ "system-states" ]
|
||||
verbs: [ "get" ]
|
||||
- apiGroups: [ "api.console.halo.run" ]
|
||||
resources: [ "auth-providers" ]
|
||||
verbs: [ "list" ]
|
||||
---
|
||||
apiVersion: v1alpha1
|
||||
kind: "Role"
|
||||
|
|
|
@ -14,6 +14,9 @@ rules:
|
|||
- apiGroups: [ "" ]
|
||||
resources: [ "settings" ]
|
||||
verbs: [ "create", "patch", "update", "delete", "deletecollection" ]
|
||||
- apiGroups: [ "api.console.halo.run" ]
|
||||
resources: [ "auth-providers/enable", "auth-providers/disable" ]
|
||||
verbs: [ "update" ]
|
||||
---
|
||||
apiVersion: v1alpha1
|
||||
kind: "Role"
|
||||
|
@ -30,3 +33,6 @@ rules:
|
|||
- apiGroups: [ "" ]
|
||||
resources: [ "settings" ]
|
||||
verbs: [ "get", "list" ]
|
||||
- apiGroups: [ "api.console.halo.run" ]
|
||||
resources: [ "auth-providers" ]
|
||||
verbs: [ "get", "list" ]
|
|
@ -0,0 +1,170 @@
|
|||
package run.halo.app.security;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
import org.json.JSONException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.skyscreamer.jsonassert.JSONAssert;
|
||||
import org.springframework.security.test.context.support.WithMockUser;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.StepVerifier;
|
||||
import run.halo.app.core.extension.AuthProvider;
|
||||
import run.halo.app.core.extension.UserConnection;
|
||||
import run.halo.app.extension.ConfigMap;
|
||||
import run.halo.app.extension.Metadata;
|
||||
import run.halo.app.extension.ReactiveExtensionClient;
|
||||
import run.halo.app.infra.SystemSetting;
|
||||
import run.halo.app.infra.utils.JsonUtils;
|
||||
|
||||
/**
|
||||
* Tests for {@link AuthProviderServiceImpl}.
|
||||
*
|
||||
* @author guqing
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class AuthProviderServiceImplTest {
|
||||
@Mock
|
||||
private ReactiveExtensionClient client;
|
||||
|
||||
@InjectMocks
|
||||
private AuthProviderServiceImpl authProviderService;
|
||||
|
||||
@Test
|
||||
void testEnable() {
|
||||
// Create a test auth provider
|
||||
AuthProvider authProvider = createAuthProvider("github");
|
||||
when(client.get(eq(AuthProvider.class), eq("github"))).thenReturn(Mono.just(authProvider));
|
||||
|
||||
ArgumentCaptor<ConfigMap> captor = ArgumentCaptor.forClass(ConfigMap.class);
|
||||
when(client.update(captor.capture())).thenReturn(Mono.empty());
|
||||
|
||||
ConfigMap configMap = new ConfigMap();
|
||||
configMap.setData(new HashMap<>());
|
||||
when(client.fetch(eq(ConfigMap.class), eq(SystemSetting.SYSTEM_CONFIG)))
|
||||
.thenReturn(Mono.just(configMap));
|
||||
|
||||
// Call the method being tested
|
||||
Mono<AuthProvider> result = authProviderService.enable("github");
|
||||
|
||||
assertEquals(authProvider, result.block());
|
||||
ConfigMap value = captor.getValue();
|
||||
String providerSettingStr = value.getData().get(SystemSetting.AuthProvider.GROUP);
|
||||
Set<String> enabled =
|
||||
JsonUtils.jsonToObject(providerSettingStr, SystemSetting.AuthProvider.class)
|
||||
.getEnabled();
|
||||
assertThat(enabled).containsExactly("github", "local");
|
||||
// Verify the result
|
||||
verify(client).get(AuthProvider.class, "github");
|
||||
verify(client).fetch(eq(ConfigMap.class), eq(SystemSetting.SYSTEM_CONFIG));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDisable() {
|
||||
// Create a test auth provider
|
||||
AuthProvider authProvider = createAuthProvider("github");
|
||||
when(client.get(eq(AuthProvider.class), eq("github"))).thenReturn(Mono.just(authProvider));
|
||||
|
||||
ArgumentCaptor<ConfigMap> captor = ArgumentCaptor.forClass(ConfigMap.class);
|
||||
when(client.update(captor.capture())).thenReturn(Mono.empty());
|
||||
|
||||
ConfigMap configMap = new ConfigMap();
|
||||
configMap.setData(new HashMap<>());
|
||||
configMap.getData().put(SystemSetting.AuthProvider.GROUP, "{\"enabled\":[\"github\"]}");
|
||||
when(client.fetch(eq(ConfigMap.class), eq(SystemSetting.SYSTEM_CONFIG)))
|
||||
.thenReturn(Mono.just(configMap));
|
||||
|
||||
// Call the method being tested
|
||||
Mono<AuthProvider> result = authProviderService.disable("github");
|
||||
|
||||
assertEquals(authProvider, result.block());
|
||||
ConfigMap value = captor.getValue();
|
||||
String providerSettingStr = value.getData().get(SystemSetting.AuthProvider.GROUP);
|
||||
Set<String> enabled =
|
||||
JsonUtils.jsonToObject(providerSettingStr, SystemSetting.AuthProvider.class)
|
||||
.getEnabled();
|
||||
assertThat(enabled).containsExactly("local");
|
||||
// Verify the result
|
||||
verify(client).get(AuthProvider.class, "github");
|
||||
verify(client).fetch(eq(ConfigMap.class), eq(SystemSetting.SYSTEM_CONFIG));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@WithMockUser(username = "admin")
|
||||
void listAll() {
|
||||
AuthProvider github = createAuthProvider("github");
|
||||
github.getSpec().setBindingUrl("fake-binding-url");
|
||||
|
||||
AuthProvider gitlab = createAuthProvider("gitlab");
|
||||
gitlab.getSpec().setBindingUrl("fake-binding-url");
|
||||
|
||||
AuthProvider gitee = createAuthProvider("gitee");
|
||||
|
||||
when(client.list(eq(AuthProvider.class), any(), any()))
|
||||
.thenReturn(Flux.just(github, gitlab, gitee));
|
||||
when(client.list(eq(UserConnection.class), any(), any())).thenReturn(Flux.empty());
|
||||
|
||||
ConfigMap configMap = new ConfigMap();
|
||||
configMap.setData(new HashMap<>());
|
||||
configMap.getData().put(SystemSetting.AuthProvider.GROUP, "{\"enabled\":[\"github\"]}");
|
||||
when(client.fetch(eq(ConfigMap.class), eq(SystemSetting.SYSTEM_CONFIG)))
|
||||
.thenReturn(Mono.just(configMap));
|
||||
|
||||
authProviderService.listAll()
|
||||
.as(StepVerifier::create)
|
||||
.consumeNextWith(result -> {
|
||||
assertThat(result).hasSize(3);
|
||||
try {
|
||||
JSONAssert.assertEquals("""
|
||||
[{
|
||||
"name": "github",
|
||||
"displayName": "github",
|
||||
"bindingUrl": "fake-binding-url",
|
||||
"enabled": true,
|
||||
"isBound": false
|
||||
}, {
|
||||
"name": "gitlab",
|
||||
"displayName": "gitlab",
|
||||
"bindingUrl": "fake-binding-url",
|
||||
"enabled": false,
|
||||
"isBound": false
|
||||
},{
|
||||
|
||||
"name": "gitee",
|
||||
"displayName": "gitee",
|
||||
"enabled": false,
|
||||
"isBound": false
|
||||
}]
|
||||
""",
|
||||
JsonUtils.objectToJson(result),
|
||||
true);
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
})
|
||||
.verifyComplete();
|
||||
}
|
||||
|
||||
AuthProvider createAuthProvider(String name) {
|
||||
AuthProvider authProvider = new AuthProvider();
|
||||
authProvider.setMetadata(new Metadata());
|
||||
authProvider.getMetadata().setName(name);
|
||||
authProvider.setSpec(new AuthProvider.AuthProviderSpec());
|
||||
authProvider.getSpec().setDisplayName(name);
|
||||
return authProvider;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue