@jcoder-stack/abp-react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,202 @@
1
+ import { e as Logger } from './logger-BSnS65IC.js';
2
+ import { F as FetchFn, T as TokenResult, A as AuthSession, S as SessionStore, b as AuthStrategy, c as IdentityContext, I as Identity, a as IdentityResolver, B as BeginInput, H as Handshake } from './types-Bj0MpXtI.js';
3
+ import { z } from 'zod';
4
+
5
+ /** 把值密封成(并从中解封)AES-GCM 加密、URL 安全的字符串。 */
6
+ interface Codec<T> {
7
+ seal(data: T): Promise<string>;
8
+ open(token: string): Promise<T | null>;
9
+ }
10
+ /** codec 载荷校验契约(zod safeParse 兼容)。 */
11
+ interface CodecSchema<T> {
12
+ safeParse(value: unknown): {
13
+ success: true;
14
+ data: T;
15
+ } | {
16
+ success: false;
17
+ };
18
+ }
19
+ /**
20
+ * 创建绑定 secret 与 schema 的加密 codec;secret 短于 32 字符同步抛错,
21
+ * `usage` 必填并参与密钥派生(不同用途的密文互不可解),open 在任何篡改/版本/格式/解密/形状失败时返回 null。
22
+ */
23
+ declare function createCodec<T>(secret: string, schema: CodecSchema<T>, opts: {
24
+ usage: string;
25
+ onError?: (error: unknown) => void;
26
+ }): Codec<T>;
27
+
28
+ /** Set-Cookie 属性;httpOnly/secure 默认 true,SameSite 默认 Lax,Path 默认 /。 */
29
+ interface CookieOptions {
30
+ path?: string;
31
+ maxAge?: number;
32
+ httpOnly?: boolean;
33
+ secure?: boolean;
34
+ sameSite?: "Lax" | "Strict" | "None";
35
+ }
36
+ /**
37
+ * 以安全默认序列化一条 Set-Cookie;值做 URL 编码。
38
+ * name 不合 RFC 6265 token 字符集、或 `SameSite=None` 未配 Secure(浏览器会静默丢弃)时抛错。
39
+ */
40
+ declare function serializeCookie(name: string, value: string, opts?: CookieOptions): string;
41
+ /** 立即过期指定 cookie 的 Set-Cookie。 */
42
+ declare function clearCookie(name: string, opts?: CookieOptions): string;
43
+ /** 解析 Cookie 请求头为 name→value;按第一个 '=' 切分,容忍坏编码。 */
44
+ declare function parseCookieHeader(header: string | null | undefined): Record<string, string>;
45
+ /** 单块 cookie 值序列化(`encodeURIComponent`)后的最大字节数;连同名字与属性保持在浏览器 4096 限制之下。 */
46
+ declare const COOKIE_CHUNK_SIZE = 3600;
47
+ /**
48
+ * 可能超长的值的 Set-Cookie 序列:编码后装得下用单 cookie,否则切成 name.0..n。
49
+ * 总是多清一个尾块;传入 `existing`(请求携带的 cookie)时还清掉本次未覆写的全部旧块,
50
+ * 块数骤减时防止残块以 maxAge 存活、膨胀后续请求头。
51
+ */
52
+ declare function chunkCookieValue(name: string, value: string, opts?: CookieOptions, existing?: Record<string, string>): string[];
53
+ /** 读可能分块的 cookie:整名优先,否则拼 name.0..n 直到出现空档。 */
54
+ declare function readChunkedCookie(cookies: Record<string, string>, name: string): string | undefined;
55
+ /** 清除基名与请求中出现的每个分块。 */
56
+ declare function clearChunkedCookie(name: string, cookies: Record<string, string>, opts?: CookieOptions): string[];
57
+
58
+ declare const oidcMetadataSchema: z.ZodObject<{
59
+ issuer: z.ZodString;
60
+ authorization_endpoint: z.ZodString;
61
+ token_endpoint: z.ZodString;
62
+ end_session_endpoint: z.ZodOptional<z.ZodString>;
63
+ revocation_endpoint: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ type OidcMetadata = z.infer<typeof oidcMetadataSchema>;
66
+ /** OIDC discovery;任何网络/状态/形状失败都归一为 AuthError("discovery_failed")。 */
67
+ declare function discoverMetadata(issuer: string, opts?: {
68
+ fetchFn?: FetchFn;
69
+ timeoutMs?: number;
70
+ }): Promise<OidcMetadata>;
71
+
72
+ interface TokenGrant {
73
+ accessToken: string;
74
+ refreshToken?: string;
75
+ idToken?: string;
76
+ expiresIn?: number;
77
+ }
78
+ interface TokenClientConfig {
79
+ issuer: string;
80
+ clientId: string;
81
+ clientSecret?: string;
82
+ scope?: string;
83
+ fetchFn?: FetchFn;
84
+ timeoutMs?: number;
85
+ logger?: Logger;
86
+ /**
87
+ * 把租户传播给 IdP 的方式:`headers` 随 token 请求发出,`query` 拼进 authorize URL。
88
+ * 多租户是后端约定(ABP 用 `__tenant`)而非 OIDC 协议的一部分,故默认不传播,由宿主注入。
89
+ */
90
+ tenantPropagation?: (tenant: string) => {
91
+ headers?: Record<string, string>;
92
+ query?: Record<string, string>;
93
+ };
94
+ }
95
+ interface TokenClient {
96
+ metadata(): Promise<OidcMetadata>;
97
+ exchangeCode(p: {
98
+ code: string;
99
+ codeVerifier: string;
100
+ redirectUri: string;
101
+ }): Promise<TokenGrant>;
102
+ passwordGrant(p: {
103
+ userName: string;
104
+ password: string;
105
+ tenant?: string | null;
106
+ }): Promise<TokenGrant>;
107
+ refreshGrant(refreshToken: string): Promise<TokenGrant>;
108
+ revoke(refreshToken: string): Promise<void>;
109
+ authorizeUrl(p: {
110
+ state: string;
111
+ nonce: string;
112
+ codeChallenge: string;
113
+ redirectUri: string;
114
+ tenant?: string | null;
115
+ }): Promise<string>;
116
+ endSessionUrl(p: {
117
+ idToken?: string;
118
+ postLogoutRedirectUri?: string;
119
+ }): Promise<string | null>;
120
+ }
121
+ /** 把 grant 包成 TokenResult;expiresAt 只在 IdP 返回 expires_in 时计算。 */
122
+ declare function toTokenResult(grant: TokenGrant, nowMs: number): TokenResult;
123
+ /** IdP token/authorize/end-session 端点的协议客户端;错误按调用语义归一为 AuthError。 */
124
+ declare function createTokenClient(cfg: TokenClientConfig): TokenClient;
125
+
126
+ /** cookieHeader(establish/refresh)供 store 清掉本次未覆写的旧分块;不传则退化为只多清一个尾块。 */
127
+ interface SessionManager {
128
+ establish(result: TokenResult, ctx?: {
129
+ tenant?: string | null;
130
+ culture?: string | null;
131
+ cookieHeader?: string | null;
132
+ }): Promise<string[]>;
133
+ current(cookieHeader: string | null): Promise<AuthSession | null>;
134
+ isExpired(session: AuthSession): boolean;
135
+ refresh(session: AuthSession, cookieHeader?: string | null): Promise<{
136
+ session: AuthSession;
137
+ setCookies: string[];
138
+ } | null>;
139
+ destroy(cookieHeader: string | null): Promise<string[]>;
140
+ }
141
+ /** 会话生命周期引擎:托管策略产出、按 skew 判过期、合并并发刷新、登出时撤销并清 cookie。 */
142
+ declare function createSessionManager(deps: {
143
+ store: SessionStore;
144
+ refreshGrant: (refreshToken: string) => Promise<TokenGrant>;
145
+ revoke?: (refreshToken: string) => Promise<void>;
146
+ logger?: Logger;
147
+ now?: () => number;
148
+ skewSeconds?: number;
149
+ coalesceTtlMs?: number;
150
+ /** 登出时等待 IdP 撤销 refresh token 的上限(默认 2000ms);超时只降级为 warn,不挡登出。 */
151
+ revokeTimeoutMs?: number;
152
+ }): SessionManager;
153
+
154
+ interface Auth {
155
+ strategy(name: string): AuthStrategy;
156
+ session: SessionManager;
157
+ /** 解析身份;`ctx.cookieHeader` 省略即按「无请求上下文」处理,匿名访客的租户选择将不可见。 */
158
+ identity(session: AuthSession | null, ctx?: IdentityContext): Promise<Identity>;
159
+ }
160
+ /** 授权认证模块装配根:策略注册表 + 会话引擎 + 身份解析。 */
161
+ declare function createAuth(opts: {
162
+ strategies: AuthStrategy[];
163
+ store: SessionStore;
164
+ resolveIdentity: IdentityResolver;
165
+ refreshGrant: (refreshToken: string) => Promise<TokenGrant>;
166
+ revoke?: (refreshToken: string) => Promise<void>;
167
+ logger?: Logger;
168
+ now?: () => number;
169
+ /** 登出时等待 IdP 撤销 refresh token 的上限(默认 2000ms);超时只降级为 warn,不挡登出。 */
170
+ revokeTimeoutMs?: number;
171
+ /** 判过期时提前量(默认 60 秒):让 token 在真正到期前就被刷新,避开时钟偏差与在途延迟。 */
172
+ skewSeconds?: number;
173
+ /** 并发刷新合并窗口(默认 10000ms):同一 refresh token 在窗口内共享一次 IdP 调用。 */
174
+ coalesceTtlMs?: number;
175
+ }): Auth;
176
+
177
+ interface OidcStrategy extends AuthStrategy {
178
+ begin(input: BeginInput): Promise<{
179
+ redirectUrl: string;
180
+ handshake: Handshake;
181
+ }>;
182
+ logoutUrl(p: {
183
+ idToken?: string;
184
+ postLogoutRedirectUri?: string;
185
+ }): Promise<string | null>;
186
+ }
187
+ /** 重定向式 OIDC Authorization Code + PKCE 策略;state/nonce 校验与 code 交换全部内化。 */
188
+ declare function oidcStrategy(cfg: {
189
+ tokenClient: TokenClient;
190
+ redirectUri: string;
191
+ now?: () => number;
192
+ logger?: Logger;
193
+ random?: () => string;
194
+ pkce?: () => Promise<{
195
+ verifier: string;
196
+ challenge: string;
197
+ }>;
198
+ /** 握手密文在服务端可用的最长寿命(默认 600 秒);超龄的 callback 一律拒绝。 */
199
+ handshakeMaxAgeSeconds?: number;
200
+ }): OidcStrategy;
201
+
202
+ export { type Auth as A, type Codec as C, type OidcStrategy as O, type SessionManager as S, type TokenClient as T, type CookieOptions as a, COOKIE_CHUNK_SIZE as b, type CodecSchema as c, type OidcMetadata as d, type TokenClientConfig as e, type TokenGrant as f, chunkCookieValue as g, clearChunkedCookie as h, clearCookie as i, createAuth as j, createCodec as k, createSessionManager as l, createTokenClient as m, discoverMetadata as n, oidcMetadataSchema as o, oidcStrategy as p, parseCookieHeader as q, readChunkedCookie as r, serializeCookie as s, toTokenResult as t };
@@ -0,0 +1,18 @@
1
+ import { G as GrantedPolicies } from './is-granted-C0-1wvoW.js';
2
+ export { P as PermissionStrategy, i as isGranted } from './is-granted-C0-1wvoW.js';
3
+
4
+ /** Callable permission checker; `can(x)` and `can.all(...)` require every policy, `can.any(...)` requires one of them, `can.not(policy)` negates a single check. Variadic args are flattened, and an empty policy set is always denied. */
5
+ interface PermissionChecker {
6
+ (policy: string | string[]): boolean;
7
+ /** True when every listed policy is granted. `all()` and `all([])` are false:
8
+ * a spread of no policies must not open a gate. */
9
+ all(...policies: Array<string | string[]>): boolean;
10
+ /** True when at least one listed policy is granted; `any()` and `any([])` are false. */
11
+ any(...policies: Array<string | string[]>): boolean;
12
+ /** True when the given policy is not granted. Takes a single policy so it cannot be read as "none of these are granted". */
13
+ not(policy: string): boolean;
14
+ }
15
+ /** Create a permission checker bound to the given policies, returning a callable with `all`, `any`, and `not` methods. */
16
+ declare function createPermissionChecker(policies: GrantedPolicies): PermissionChecker;
17
+
18
+ export { GrantedPolicies, type PermissionChecker, createPermissionChecker };
@@ -0,0 +1,8 @@
1
+ import {
2
+ createPermissionChecker,
3
+ isGranted
4
+ } from "./chunk-OK6PUP2E.js";
5
+ export {
6
+ createPermissionChecker,
7
+ isGranted
8
+ };
@@ -0,0 +1,201 @@
1
+ import { e as Logger } from './logger-BSnS65IC.js';
2
+ import { A as AuthSession, I as Identity, a as IdentityResolver, F as FetchFn, H as Handshake } from './types-Bj0MpXtI.js';
3
+ import { A as Auth, O as OidcStrategy, C as Codec, a as CookieOptions } from './oidc-7fu5kKVF.js';
4
+ import { A as ApplicationConfiguration } from './application-configuration-DhOZRqtz.js';
5
+ import { z } from 'zod';
6
+
7
+ interface AbpProxyRequest {
8
+ path: string;
9
+ method?: string;
10
+ headers?: Record<string, string>;
11
+ body?: string;
12
+ /** 调用方的取消信号(如宿主的 `request.signal`);触发后当前尝试立即中止且不再重试。 */
13
+ signal?: AbortSignal;
14
+ }
15
+ interface AbpProxyResponse {
16
+ status: number;
17
+ /** 只含内容协商类白名单(见 `EXPOSED_RESPONSE_HEADERS`);上游 Set-Cookie / WWW-Authenticate / Server 已被剔除,可整份转交浏览器。 */
18
+ headers: Headers;
19
+ /** 文本类 content-type 给 string,其余给 ArrayBuffer。二进制经 text() 解码会不可逆损坏。 */
20
+ body: string | ArrayBuffer;
21
+ setCookies: string[];
22
+ }
23
+ /** 会话接入点:proxy 只认 AuthSession 与一个刷新回调,不认识刷新的实现。 */
24
+ interface AbpProxyAuth {
25
+ session: AuthSession | null;
26
+ refresh: () => Promise<{
27
+ session: AuthSession;
28
+ setCookies: string[];
29
+ } | null>;
30
+ }
31
+ interface AbpProxy {
32
+ send(req: AbpProxyRequest, auth: AbpProxyAuth): Promise<AbpProxyResponse>;
33
+ }
34
+ /** 代理请求最终失败但过程中已产生会话 cookie(如 401→刷新成功→重放失败);调用方必须把 setCookies 落到响应上再转抛,否则轮换型 IdP 下用户被静默登出。 */
35
+ declare class AbpProxyError extends Error {
36
+ readonly setCookies: string[];
37
+ constructor(message: string, setCookies: string[], opts?: {
38
+ cause?: unknown;
39
+ });
40
+ }
41
+ /** ABP 代理网关:贴 Bearer、401→刷新→重放一次、幂等重试、超时。状态码透传,永不因状态码 throw;响应头按白名单过滤后交出。 */
42
+ declare function createAbpProxy(opts: {
43
+ baseUrl: string;
44
+ fetchFn?: typeof fetch;
45
+ /** 单次尝试的超时(默认 30s)。 */
46
+ timeoutMs?: number;
47
+ retry?: {
48
+ retries: number;
49
+ };
50
+ /** 含重试与退避在内的总预算;默认不设,此时最坏耗时是 (retries+1)×timeoutMs 加退避。 */
51
+ totalTimeoutMs?: number;
52
+ logger?: Logger;
53
+ }): AbpProxy;
54
+
55
+ /** 租户切换 cookie / 头名,与 ABP 后端约定共享。 */
56
+ declare const TENANT_COOKIE = "__tenant";
57
+ /** ASP.NET Core 文化 cookie 名,与 ABP 后端约定共享。 */
58
+ declare const CULTURE_COOKIE = ".AspNetCore.Culture";
59
+ /** abp-call/identity 只认代理、会话与日志三样;宿主的完整 runtime 结构上兼容此形状。 */
60
+ interface AbpCallRuntime {
61
+ proxy: AbpProxy;
62
+ auth: Auth;
63
+ logger: Logger;
64
+ }
65
+ /** ABP 策略头。租户:会话优先、cookie 兜底;文化:cookie 优先(显式切换胜过登录快照)。 */
66
+ declare function buildPolicyHeaders(session: AuthSession | null, cookieHeader: string | null): Record<string, string>;
67
+ /** 经代理调 ABP:策略头 + 会话 + 401 刷新回调。策略头压过调用方 headers(防伪造租户/文化);Set-Cookie 由调用方落响应。 */
68
+ declare function callAbpWithSession(rt: AbpCallRuntime, session: AuthSession | null, cookieHeader: string | null, req: AbpProxyRequest): Promise<AbpProxyResponse>;
69
+
70
+ /**
71
+ * 从 app-config 派生可注水的身份视图;token 不经过这里。
72
+ * `isAuthenticated` 却无 `id` 属上游 shape drift:记 warn 并按匿名处理,不产出空 id 身份。
73
+ */
74
+ declare function deriveIdentity(config: ApplicationConfiguration, opts?: {
75
+ logger?: Logger;
76
+ }): Identity;
77
+ interface AppState {
78
+ config: ApplicationConfiguration;
79
+ identity: Identity;
80
+ setCookies: string[];
81
+ }
82
+ /** 一次 application-configuration 取数同时喂 config 与 identity;4xx/5xx 抛带 status 的 HttpError。 */
83
+ declare function loadAppState(rt: AbpCallRuntime, session: AuthSession | null, cookieHeader: string | null): Promise<AppState>;
84
+ /** IdentityResolver 的 ABP 实现;策略头来自会话与请求 cookie(匿名访客的 `__tenant` 选择由此生效)。 */
85
+ declare function createAbpIdentityResolver(rt: () => AbpCallRuntime): IdentityResolver;
86
+
87
+ /** AUTH_* 环境变量解析后的配置;核心包不读 env,这里是唯一入口。 */
88
+ declare const abpAuthEnvSchema: z.ZodObject<{
89
+ issuer: z.ZodString;
90
+ clientId: z.ZodString;
91
+ clientSecret: z.ZodOptional<z.ZodString>;
92
+ scope: z.ZodDefault<z.ZodString>;
93
+ redirectUri: z.ZodString;
94
+ postLogoutRedirectUri: z.ZodOptional<z.ZodString>;
95
+ sessionSecret: z.ZodString;
96
+ abpBaseUrl: z.ZodString;
97
+ debug: z.ZodDefault<z.ZodBoolean>;
98
+ }, z.core.$strip>;
99
+ type AbpAuthEnv = z.infer<typeof abpAuthEnvSchema>;
100
+ /**
101
+ * 把 AUTH_* 记录解析成 AbpAuthEnv。
102
+ * @param env 通常是 process.env。
103
+ * @param opts.schema 覆盖默认 zod schema(`abpAuthEnvSchema`),用于给 AUTH_* 契约加更严的
104
+ * 校验/精化;解析产物必须仍是 AbpAuthEnv(类型系统兜底,故只能 `.extend()`/`.merge()` 等
105
+ * 保持输出形状不变的方式收紧,例如
106
+ * `abpAuthEnvSchema.extend({ clientSecret: z.string().min(1) })`)。
107
+ */
108
+ declare function resolveAbpAuthEnv(env: Record<string, string | undefined>, opts?: {
109
+ schema?: z.ZodType<AbpAuthEnv>;
110
+ }): AbpAuthEnv;
111
+
112
+ /** 加密会话 cookie(httpOnly)默认名,装密封的 AuthSession(超长分块)。 */
113
+ declare const DEFAULT_SESSION_COOKIE = "auth_session";
114
+ /** 短命握手 cookie(httpOnly)默认名,装 authorize↔callback 之间的密封 Handshake。 */
115
+ declare const DEFAULT_LOGIN_COOKIE = "auth_login";
116
+ /** 会话 cookie 默认寿命(7 天);调整时与 IdP refresh token 寿命对齐。 */
117
+ declare const DEFAULT_SESSION_COOKIE_MAX_AGE: number;
118
+ /** 握手 cookie 默认寿命(10 分钟),只需活过 IdP 往返。 */
119
+ declare const DEFAULT_LOGIN_COOKIE_MAX_AGE = 600;
120
+ /** 租户/文化切换 cookie 寿命(1 年);ASP.NET/ABP 协议约定,非应用策略,故非选项。 */
121
+ declare const SWITCH_COOKIE_MAX_AGE: number;
122
+ /** 一张 auth cookie 的名字、寿命与浏览器投递属性;`secure`/`sameSite` 省略即 `true`/`Lax`。 */
123
+ interface AuthCookieSettings {
124
+ name: string;
125
+ maxAge: number;
126
+ secure?: boolean;
127
+ sameSite?: "Lax" | "Strict" | "None";
128
+ }
129
+ /** 运行时携带的 cookie 配置,供 handler 读取(会话 + 握手两张)。 */
130
+ interface AuthCookieConfig {
131
+ session: AuthCookieSettings;
132
+ login: AuthCookieSettings;
133
+ }
134
+ /** 取一张 auth cookie 的浏览器投递属性;名字与寿命由调用点自己给。 */
135
+ declare function cookieAttributesOf(settings: AuthCookieSettings): CookieOptions;
136
+ /** auth 模块的进程级运行时:装配根。env→logger 在此兑现(AUTH_DEBUG → debug 级)。 */
137
+ interface AuthRuntime {
138
+ env: AbpAuthEnv;
139
+ auth: Auth;
140
+ proxy: AbpProxy;
141
+ oidc: OidcStrategy;
142
+ handshakeCodec: Codec<Handshake>;
143
+ logger: Logger;
144
+ cookies: AuthCookieConfig;
145
+ /** IdP 登出后回跳地址(默认取 AUTH_POST_LOGOUT_REDIRECT_URI)。 */
146
+ postLogoutRedirectUri?: string;
147
+ }
148
+ interface AbpAuthRuntimeOptions {
149
+ fetchFn?: FetchFn;
150
+ now?: () => number;
151
+ logger?: Logger;
152
+ /** 覆盖 AUTH_* env 解析用的 zod schema(默认 `abpAuthEnvSchema`);解析产物必须仍是 AbpAuthEnv。 */
153
+ envSchema?: z.ZodType<AbpAuthEnv>;
154
+ /**
155
+ * 覆盖 cookie 名/寿命/投递属性(会话默认 "auth_session"/7 天;握手默认 "auth_login"/10 分钟)。
156
+ * `secure: false` 只用于非 localhost 的 http 预览环境。浏览器会静默丢弃 http 下的 Secure cookie。
157
+ */
158
+ cookies?: {
159
+ session?: Partial<AuthCookieSettings>;
160
+ login?: Partial<AuthCookieSettings>;
161
+ };
162
+ /** 覆盖代理网关的超时与重试(默认 30s 单次超时、幂等请求重试 2 次、无总预算)。 */
163
+ proxy?: {
164
+ timeoutMs?: number;
165
+ retries?: number;
166
+ totalTimeoutMs?: number;
167
+ };
168
+ /** 覆盖会话引擎调优项(默认 60s 过期宽限、10s 刷新合并窗口、2s 撤销超时)。 */
169
+ session?: {
170
+ skewSeconds?: number;
171
+ coalesceTtlMs?: number;
172
+ revokeTimeoutMs?: number;
173
+ };
174
+ /** 覆盖 IdP 登出后回跳地址(默认取 AUTH_POST_LOGOUT_REDIRECT_URI)。 */
175
+ postLogoutRedirectUri?: string;
176
+ /** 策略启停(默认 oidc 与 password 都开)。 */
177
+ strategies?: {
178
+ oidc?: boolean;
179
+ password?: boolean;
180
+ };
181
+ /** 替换身份解析器(默认从 ABP application-configuration 派生)。 */
182
+ resolveIdentity?: IdentityResolver;
183
+ }
184
+ /**
185
+ * 装配 auth 运行时:strategies(OIDC/password)+ 会话层(加密分块 cookie)+ ABP 代理 +
186
+ * 身份解析。默认即现行为,`opts` 只传覆盖项。
187
+ */
188
+ declare function createAbpAuthRuntime(envRecord: Record<string, string | undefined>, opts?: AbpAuthRuntimeOptions): AuthRuntime;
189
+
190
+ /** GET /api/auth/login:begin 策略握手,密封进短命 cookie,302 去 IdP。 */
191
+ declare function handleLogin(request: Request, rt: AuthRuntime): Promise<Response>;
192
+ /** GET /api/auth/callback:complete 策略握手,建会话,302 回 returnUrl;失败 302 /login?error=。 */
193
+ declare function handleCallback(request: Request, rt: AuthRuntime): Promise<Response>;
194
+ /** GET /api/auth/logout:destroy 会话(内含撤销),302 去 IdP end-session(拿不到则回首页)。 */
195
+ declare function handleLogout(request: Request, rt: AuthRuntime): Promise<Response>;
196
+ /** GET /api/culture?culture=zh-Hans&returnUrl=/:落共享文化 cookie 并弹回。 */
197
+ declare function handleSetCulture(request: Request): Response;
198
+ /** GET /api/tenant?tenant=t1&returnUrl=/:落租户 cookie(缺 tenant 则清除)并弹回。 */
199
+ declare function handleSetTenant(request: Request): Response;
200
+
201
+ export { type AbpAuthEnv, type AbpAuthRuntimeOptions, type AbpCallRuntime, type AbpProxy, type AbpProxyAuth, AbpProxyError, type AbpProxyRequest, type AbpProxyResponse, type AppState, type AuthCookieConfig, type AuthCookieSettings, type AuthRuntime, CULTURE_COOKIE, DEFAULT_LOGIN_COOKIE, DEFAULT_LOGIN_COOKIE_MAX_AGE, DEFAULT_SESSION_COOKIE, DEFAULT_SESSION_COOKIE_MAX_AGE, SWITCH_COOKIE_MAX_AGE, TENANT_COOKIE, abpAuthEnvSchema, buildPolicyHeaders, callAbpWithSession, cookieAttributesOf, createAbpAuthRuntime, createAbpIdentityResolver, createAbpProxy, deriveIdentity, handleCallback, handleLogin, handleLogout, handleSetCulture, handleSetTenant, loadAppState, resolveAbpAuthEnv };