Skip to content

Commit ab0f39d

Browse files
committed
feat(): add apis: AuthApi_checkLoginByName, AuthApi_switchOrg, BootstrapStandaloneApi_batchDeleteBootstrapStandaloneCache, CustomAuthConfigApi_createBackendNode, CustomAuthConfigApi_updateBackendNode, SsoApi_validateAccessToken, SsoServerApi_index, SsoServerApi_oauthAccessToken, SsoServerApi_oauthUserInfo
INFRA-0
1 parent 3ad1103 commit ab0f39d

24 files changed

+983
-13
lines changed

sdk/api-gateway-sdk/contracts.json

Lines changed: 617 additions & 6 deletions
Large diffs are not rendered by default.

sdk/api-gateway-sdk/src/api/api_gateway/auth/checkLogin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ export interface AuthApi_CheckLoginResponseBody {
3434

3535
/** 主名称 次名称 */
3636
userShowValue?: string[];
37+
38+
/** SSO OAuth2 授权登录场景下,认证中心签发的令牌 */
39+
accessToken?: string;
3740
}
3841

3942
/**
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { http, HttpOptions } from "@next-core/http";
2+
import { ResponseBodyWrapper } from "../../../wrapper.js";
3+
4+
export interface AuthApi_CheckLoginByNameRequestBody {
5+
/** 用户名 */
6+
username?: string;
7+
8+
/** 客户id */
9+
org?: number;
10+
}
11+
12+
export interface AuthApi_CheckLoginByNameResponseBody {
13+
/** 是否已经登录 */
14+
loggedIn?: boolean;
15+
16+
/** 用户名 */
17+
username?: string;
18+
19+
/** 客户id */
20+
org?: number;
21+
22+
/** 登录Session */
23+
loginSession?: string;
24+
}
25+
26+
/**
27+
* @description 判断用户是否登录
28+
* @endpoint POST /api/auth/user/check/login
29+
*/
30+
export const AuthApi_checkLoginByName = async (
31+
data: AuthApi_CheckLoginByNameRequestBody,
32+
options?: HttpOptions
33+
): Promise<AuthApi_CheckLoginByNameResponseBody> =>
34+
/**! @contract [email protected] */ (
35+
await http.post<ResponseBodyWrapper<AuthApi_CheckLoginByNameResponseBody>>(
36+
"api/auth/user/check/login",
37+
data,
38+
options
39+
)
40+
).data;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
export * from "./checkLogin.js";
2+
export * from "./checkLoginByName.js";
23
export * from "./getCaptcha.js";
34
export * from "./ldapLogin.js";
45
export * from "./loginV2.js";
56
export * from "./logout.js";
67
export * from "./refreshToken.js";
78
export * from "./register.js";
89
export * from "./registerV2.js";
10+
export * from "./switchOrg.js";
911
export * from "./tokenLdapLogin.js";
1012
export * from "./tokenLogin.js";

sdk/api-gateway-sdk/src/api/api_gateway/auth/loginV2.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ export interface AuthApi_LoginV2ResponseBody {
4242

4343
/** csrf_token,开启了csrf特性才返回值 */
4444
csrfToken?: string;
45+
46+
/** 是否需要修改密码(开启 check-password-security 特性时, 初次登录和密码过期时需要修改密码) */
47+
changePasswordRequired?: boolean;
48+
49+
/** 修改密码的具体原因(firstLogin:初次登录, expired:密码已过期) */
50+
changePasswordReason?: "firstLogin" | "expired";
51+
52+
/** 密码有效期剩余时间(当 changePasswordRequired 为 true 时,这个值为 -1) */
53+
passwordRemainingDays?: number;
4554
}
4655

4756
/**
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { http, HttpOptions } from "@next-core/http";
2+
import { ResponseBodyWrapper } from "../../../wrapper.js";
3+
4+
export interface AuthApi_SwitchOrgRequestBody {
5+
/** 切换到哪个组织 (具体是哪个用户切换组织,从 context 中获取 username) */
6+
org: number;
7+
}
8+
9+
export interface AuthApi_SwitchOrgResponseBody {
10+
/** 用户名 */
11+
username?: string;
12+
13+
/** 组织 org */
14+
org?: number;
15+
16+
/** 用户 id */
17+
userInstanceId?: string;
18+
19+
/** 判断当前登录用户是否是系统管理员 */
20+
isAdmin?: boolean;
21+
22+
/** 主名称 次名称 */
23+
userShowValue?: string[];
24+
}
25+
26+
/**
27+
* @description 多组织用户切换组织
28+
* @endpoint POST /api/auth/login/switch_org
29+
*/
30+
export const AuthApi_switchOrg = async (
31+
data: AuthApi_SwitchOrgRequestBody,
32+
options?: HttpOptions
33+
): Promise<AuthApi_SwitchOrgResponseBody> =>
34+
/**! @contract [email protected] */ (
35+
await http.post<ResponseBodyWrapper<AuthApi_SwitchOrgResponseBody>>(
36+
"api/auth/login/switch_org",
37+
data,
38+
options
39+
)
40+
).data;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { http, HttpOptions } from "@next-core/http";
2+
3+
export interface BootstrapStandaloneApi_BatchDeleteBootstrapStandaloneCacheRequestBody {
4+
/** 主页 */
5+
homePage?: string[];
6+
}
7+
8+
/**
9+
* @description 批量删除独立小产品主页缓存
10+
* @endpoint POST /api/v1/bootstrap_standalone_cache/batch_delete
11+
*/
12+
export const BootstrapStandaloneApi_batchDeleteBootstrapStandaloneCache = (
13+
data: BootstrapStandaloneApi_BatchDeleteBootstrapStandaloneCacheRequestBody,
14+
options?: HttpOptions
15+
): Promise<void> =>
16+
/**! @contract easyops.api.api_gateway.bootstrap_standalone.BatchDeleteBootstrapStandaloneCache@1.0.0 */ http.post<void>(
17+
"api/v1/bootstrap_standalone_cache/batch_delete",
18+
data,
19+
options
20+
);

sdk/api-gateway-sdk/src/api/api_gateway/bootstrap_standalone/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export * from "./batchDeleteBootstrapStandaloneCache.js";
12
export * from "./deleteBootstrapStandaloneCache.js";
23
export * from "./deleteLaunchpadEtagCache.js";
34
export * from "./getBrandFavicon.js";
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { http, HttpOptions } from "@next-core/http";
2+
import { ModelBackendNode } from "../../../model/api_gateway/index.js";
3+
import { ResponseBodyWrapper } from "../../../wrapper.js";
4+
5+
export interface CustomAuthConfigApi_CreateBackendNodeRequestBody {
6+
/** 节点 */
7+
node?: Partial<ModelBackendNode>;
8+
9+
/** 关联的服务ID列表 */
10+
serviceInstanceIds?: string[];
11+
}
12+
13+
export interface CustomAuthConfigApi_CreateBackendNodeResponseBody {
14+
/** 节点id */
15+
id?: string;
16+
}
17+
18+
/**
19+
* @description 创建后端节点
20+
* @endpoint POST /api/v1/api_gateway/backend_node
21+
*/
22+
export const CustomAuthConfigApi_createBackendNode = async (
23+
data: CustomAuthConfigApi_CreateBackendNodeRequestBody,
24+
options?: HttpOptions
25+
): Promise<CustomAuthConfigApi_CreateBackendNodeResponseBody> =>
26+
/**! @contract easyops.api.api_gateway.custom_auth_config.CreateBackendNode@1.4.0 */ (
27+
await http.post<
28+
ResponseBodyWrapper<CustomAuthConfigApi_CreateBackendNodeResponseBody>
29+
>("api/v1/api_gateway/backend_node", data, options)
30+
).data;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
export * from "./createBackendNode.js";
12
export * from "./createCustomAuthConfig.js";
23
export * from "./deleteCustomAuthConfig.js";
34
export * from "./getCustomAuthConfig.js";
45
export * from "./listCustomAuthConfig.js";
56
export * from "./oAuth2AccessTokenDebug.js";
67
export * from "./updateCustomAuthConfig.js";
8+
export * from "./updateBackendNode.js";

0 commit comments

Comments
 (0)