@krak-stack/auth 0.1.70 → 0.2.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.
- package/README.md +4 -3
- package/dist/access.d.ts +4 -4
- package/dist/access.js +10 -4
- package/dist/admin/api.group.d.ts +17 -17
- package/dist/admin/api.group.js +2 -2
- package/dist/admin/schema.d.ts +18 -18
- package/dist/admin/schema.js +3 -3
- package/dist/api.d.ts +2093 -631
- package/dist/api.js +7 -7
- package/dist/auth/api.group.d.ts +793 -0
- package/dist/auth/api.group.js +241 -0
- package/dist/auth/schema.d.ts +800 -0
- package/dist/auth/schema.js +625 -0
- package/dist/components/admin-organization-form.d.ts +1 -1
- package/dist/components/admin-organization-form.js +16 -18
- package/dist/components/admin-organizations.js +52 -46
- package/dist/components/admin-users.js +115 -138
- package/dist/components/api-key-edit-form.d.ts +4 -3
- package/dist/components/api-key-edit-form.js +32 -27
- package/dist/components/api-key-permissions.d.ts +1 -1
- package/dist/components/api-key-rate-limit.d.ts +1 -1
- package/dist/components/api-key-referrers.d.ts +3 -2
- package/dist/components/api-key-referrers.js +2 -3
- package/dist/components/api-key.d.ts +0 -9
- package/dist/components/api-key.js +0 -39
- package/dist/components/auth-atoms.d.ts +178 -0
- package/dist/components/auth-atoms.js +46 -0
- package/dist/components/auth-client-api.d.ts +2474 -142
- package/dist/components/auth-client-api.js +14 -10
- package/dist/components/auth-forms.d.ts +1 -3
- package/dist/components/auth-forms.js +168 -195
- package/dist/components/auth-provider.d.ts +3 -7
- package/dist/components/auth-provider.js +56 -30
- package/dist/components/has-permission.js +1 -1
- package/dist/components/index.d.ts +19 -20
- package/dist/components/index.js +13 -13
- package/dist/components/member-required.d.ts +1 -3
- package/dist/components/member-required.js +102 -78
- package/dist/components/organization-switcher.d.ts +4 -6
- package/dist/components/organization-switcher.js +469 -324
- package/dist/components/project-access-matrix.d.ts +1 -1
- package/dist/components/project-access-matrix.js +9 -13
- package/dist/components/user-button.d.ts +5 -3
- package/dist/components/user-button.js +265 -316
- package/dist/components/utils.d.ts +3 -1
- package/dist/components/utils.js +4 -11
- package/dist/extra/api.group.d.ts +3 -3
- package/dist/extra/api.group.js +6 -6
- package/dist/extra/schema.js +1 -1
- package/dist/index.d.ts +11 -12
- package/dist/index.js +11 -12
- package/dist/query.d.ts +2 -2
- package/dist/roles.d.ts +5 -4
- package/dist/roles.js +11 -7
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +26 -19
- package/dist/server/actor.d.ts +30 -32
- package/dist/server/actor.js +39 -22
- package/dist/server/api.group.js +2 -2
- package/dist/server/index.d.ts +14 -14
- package/dist/server/index.js +8 -8
- package/dist/server/middleware.d.ts +3 -3
- package/dist/server/middleware.js +10 -5
- package/dist/server/schema.js +1 -1
- package/dist/service.d.ts +2053 -201
- package/dist/service.js +32 -21
- package/package.json +10 -9
- package/dist/better-auth/api.group.d.ts +0 -62
- package/dist/better-auth/api.group.js +0 -39
- package/dist/better-auth/schema.d.ts +0 -72
- package/dist/better-auth/schema.js +0 -110
- package/dist/components/auth-client.d.ts +0 -50
- package/dist/components/auth-client.js +0 -46
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const isRecord: (
|
|
1
|
+
export declare const isRecord: <I>(input: I) => input is I & {
|
|
2
|
+
readonly [x: string]: unknown;
|
|
3
|
+
};
|
|
2
4
|
export declare const cn: (...inputs: ReadonlyArray<string | false | null | undefined>) => string;
|
|
3
5
|
export type OrganizationBrandingLocale = "en" | "fr";
|
|
4
6
|
export interface OrganizationBrandingSource {
|
package/dist/components/utils.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { decodeOrganizationMetadata } from "../schema.js";
|
|
3
|
+
const UnknownRecord = Schema.Record(Schema.String, Schema.Unknown);
|
|
4
|
+
export const isRecord = Schema.is(UnknownRecord);
|
|
4
5
|
export const cn = (...inputs) => inputs.filter(Boolean).join(" ");
|
|
5
|
-
const parseOrganizationMetadata =
|
|
6
|
-
try {
|
|
7
|
-
const value = typeof metadata === "string" ? JSON.parse(metadata) : metadata;
|
|
8
|
-
return Schema.decodeUnknownSync(OrganizationMetadata)(value);
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
return { translations: [] };
|
|
12
|
-
}
|
|
13
|
-
};
|
|
6
|
+
const parseOrganizationMetadata = decodeOrganizationMetadata;
|
|
14
7
|
export const organizationBranding = (organization, locale = "en") => {
|
|
15
8
|
if (!organization)
|
|
16
9
|
return null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
-
import { ExtraBadRequest } from "./schema";
|
|
4
|
-
export * from "./schema";
|
|
5
|
-
export type { Organization, OrganizationMetadata } from "../schema";
|
|
3
|
+
import { ExtraBadRequest } from "./schema.js";
|
|
4
|
+
export * from "./schema.js";
|
|
5
|
+
export type { Organization, OrganizationMetadata } from "../schema.js";
|
|
6
6
|
export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"authExtra", HttpApiEndpoint.HttpApiEndpoint<"createApiKey", "POST", "/auth/create-api-key", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
7
7
|
readonly configId: Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>;
|
|
8
8
|
readonly name: Schema.optional<Schema.NonEmptyString>;
|
package/dist/extra/api.group.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { OpenApi } from "effect/unstable/httpapi";
|
|
3
3
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, } from "effect/unstable/httpapi";
|
|
4
|
-
import { ExtraBadRequest, ExtraCreateApiKeyPayload, ExtraCreateApiKeyResponse, ExtraImageUploadMultipartPayload, ExtraOkResponse, ExtraOrganizationPublicProfile, ExtraOrganizationPublicProfileQuery, ExtraProjectPublicConfig, ExtraProjectPublicConfigQuery, ExtraSetPasswordPayload, ExtraUpdateApiKeyPayload, ExtraUploadedAsset, ExtraVerifyApiKeyPayload, ExtraVerifyApiKeyResponse, ExtraVerifyPasswordPayload, } from "./schema";
|
|
5
|
-
export * from "./schema";
|
|
4
|
+
import { ExtraBadRequest, ExtraCreateApiKeyPayload, ExtraCreateApiKeyResponse, ExtraImageUploadMultipartPayload, ExtraOkResponse, ExtraOrganizationPublicProfile, ExtraOrganizationPublicProfileQuery, ExtraProjectPublicConfig, ExtraProjectPublicConfigQuery, ExtraSetPasswordPayload, ExtraUpdateApiKeyPayload, ExtraUploadedAsset, ExtraVerifyApiKeyPayload, ExtraVerifyApiKeyResponse, ExtraVerifyPasswordPayload, } from "./schema.js";
|
|
5
|
+
export * from "./schema.js";
|
|
6
6
|
export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
7
7
|
.add(HttpApiEndpoint.get("getProjectPublicConfig", "/auth/project-config", {
|
|
8
8
|
query: ExtraProjectPublicConfigQuery,
|
|
@@ -32,7 +32,7 @@ export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
|
32
32
|
}).annotateMerge(OpenApi.annotations({
|
|
33
33
|
title: "Update API key",
|
|
34
34
|
summary: "Update an API key",
|
|
35
|
-
description: "Updates API key details and server-only permissions after
|
|
35
|
+
description: "Updates API key details and server-only permissions after verifying user ownership or organization key-management access.",
|
|
36
36
|
})))
|
|
37
37
|
.add(HttpApiEndpoint.get("getOrganizationPublicProfile", "/auth/organization-profile", {
|
|
38
38
|
query: ExtraOrganizationPublicProfileQuery,
|
|
@@ -83,7 +83,7 @@ export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
|
83
83
|
}).annotateMerge(OpenApi.annotations({
|
|
84
84
|
title: "Create API key",
|
|
85
85
|
summary: "Create an API key with optional permissions",
|
|
86
|
-
description: "Creates a user or organization API key through
|
|
86
|
+
description: "Creates a user or organization API key through the server API so server-only fields like permissions can be set.",
|
|
87
87
|
})))
|
|
88
88
|
.add(HttpApiEndpoint.post("verifyApiKey", "/auth/verify-api-key", {
|
|
89
89
|
payload: ExtraVerifyApiKeyPayload,
|
|
@@ -92,7 +92,7 @@ export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
|
92
92
|
}).annotateMerge(OpenApi.annotations({
|
|
93
93
|
title: "Verify API key",
|
|
94
94
|
summary: "Verify a remote API key",
|
|
95
|
-
description: "Verifies a user or organization API key and optional permissions
|
|
95
|
+
description: "Verifies a user or organization API key and optional permissions.",
|
|
96
96
|
})))
|
|
97
97
|
.add(HttpApiEndpoint.post("uploadUserImage", "/auth/image/upload", {
|
|
98
98
|
payload: ExtraImageUploadMultipartPayload,
|
|
@@ -110,5 +110,5 @@ export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
|
110
110
|
})))
|
|
111
111
|
.annotateMerge(OpenApi.annotations({
|
|
112
112
|
title: "Extra",
|
|
113
|
-
description: "KrakStack-specific endpoints
|
|
113
|
+
description: "KrakStack-specific authentication endpoints.",
|
|
114
114
|
}));
|
package/dist/extra/schema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { Multipart } from "effect/unstable/http";
|
|
3
3
|
import { HttpApiSchema } from "effect/unstable/httpapi";
|
|
4
|
-
import { OrganizationEmail, OrganizationLocale, OrganizationPhone, OrganizationSocial, OrganizationWebsite, FormattedOrganizationAddress, } from "../schema";
|
|
4
|
+
import { OrganizationEmail, OrganizationLocale, OrganizationPhone, OrganizationSocial, OrganizationWebsite, FormattedOrganizationAddress, } from "../schema.js";
|
|
5
5
|
export const ExtraImageUploadPayload = Schema.Struct({
|
|
6
6
|
file: Multipart.SingleFileSchema,
|
|
7
7
|
}).annotate({
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
export * from "./schema";
|
|
2
|
-
export * as Query from "./query";
|
|
3
|
-
export * as Roles from "./roles";
|
|
4
|
-
export { AuthClientApi, AuthServiceApi } from "./api";
|
|
5
|
-
export { AuthService, type AuthServiceLayerOptions } from "./service";
|
|
6
|
-
export { AuthClientConfig } from "./config";
|
|
7
|
-
export { proxyAuthRequest } from "./server/proxy";
|
|
8
|
-
export
|
|
9
|
-
export * as
|
|
10
|
-
export * as
|
|
11
|
-
export * as
|
|
12
|
-
export * as Admin from "./admin/api.group";
|
|
1
|
+
export * from "./schema.js";
|
|
2
|
+
export * as Query from "./query.js";
|
|
3
|
+
export * as Roles from "./roles.js";
|
|
4
|
+
export { AuthClientApi, AuthServiceApi } from "./api.js";
|
|
5
|
+
export { AuthService, type AuthServiceLayerOptions } from "./service.js";
|
|
6
|
+
export { AuthClientConfig } from "./config.js";
|
|
7
|
+
export { proxyAuthRequest } from "./server/proxy.js";
|
|
8
|
+
export * as Auth from "./auth/api.group.js";
|
|
9
|
+
export * as Extra from "./extra/api.group.js";
|
|
10
|
+
export * as Server from "./server/index.js";
|
|
11
|
+
export * as Admin from "./admin/api.group.js";
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
export * from "./schema";
|
|
2
|
-
export * as Query from "./query";
|
|
3
|
-
export * as Roles from "./roles";
|
|
4
|
-
export { AuthClientApi, AuthServiceApi } from "./api";
|
|
5
|
-
export { AuthService } from "./service";
|
|
6
|
-
export { AuthClientConfig } from "./config";
|
|
7
|
-
export { proxyAuthRequest } from "./server/proxy";
|
|
8
|
-
export
|
|
9
|
-
export * as
|
|
10
|
-
export * as
|
|
11
|
-
export * as
|
|
12
|
-
export * as Admin from "./admin/api.group";
|
|
1
|
+
export * from "./schema.js";
|
|
2
|
+
export * as Query from "./query.js";
|
|
3
|
+
export * as Roles from "./roles.js";
|
|
4
|
+
export { AuthClientApi, AuthServiceApi } from "./api.js";
|
|
5
|
+
export { AuthService } from "./service.js";
|
|
6
|
+
export { AuthClientConfig } from "./config.js";
|
|
7
|
+
export { proxyAuthRequest } from "./server/proxy.js";
|
|
8
|
+
export * as Auth from "./auth/api.group.js";
|
|
9
|
+
export * as Extra from "./extra/api.group.js";
|
|
10
|
+
export * as Server from "./server/index.js";
|
|
11
|
+
export * as Admin from "./admin/api.group.js";
|
package/dist/query.d.ts
CHANGED
|
@@ -38,8 +38,8 @@ export declare const PaginationMeta: Schema.Struct<{
|
|
|
38
38
|
readonly pageCount: Schema.Int;
|
|
39
39
|
}>;
|
|
40
40
|
export type PaginationMetaType = typeof PaginationMeta.Type;
|
|
41
|
-
export declare const PaginatedResponse: <
|
|
42
|
-
readonly data: Schema.$Array<
|
|
41
|
+
export declare const PaginatedResponse: <S extends Schema.Top>(items: S) => Schema.Struct<{
|
|
42
|
+
readonly data: Schema.$Array<S>;
|
|
43
43
|
readonly meta: Schema.Struct<{
|
|
44
44
|
readonly page: Schema.Int;
|
|
45
45
|
readonly pageSize: Schema.Int;
|
package/dist/roles.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ export type OrganizationRole = (typeof organizationRoles)[number];
|
|
|
3
3
|
export declare const organizationImpersonationRoles: readonly ["owner", "admin", "support"];
|
|
4
4
|
export declare const globalAdminRoles: readonly ["admin"];
|
|
5
5
|
export type GlobalAdminRole = (typeof globalAdminRoles)[number];
|
|
6
|
-
export declare const parseRoleList: (role:
|
|
7
|
-
export declare const hasAnyRole: (role:
|
|
6
|
+
export declare const parseRoleList: (role: typeof Schema.Unknown.Type) => string[];
|
|
7
|
+
export declare const hasAnyRole: (role: typeof Schema.Unknown.Type, roles: readonly string[]) => boolean;
|
|
8
8
|
export declare const isOrganizationRole: (role: string) => role is OrganizationRole;
|
|
9
|
-
export declare const normalizeOrganizationRole: (role:
|
|
10
|
-
export declare const normalizeOrganizationRoles: (role:
|
|
9
|
+
export declare const normalizeOrganizationRole: (role: typeof Schema.Unknown.Type) => OrganizationRole;
|
|
10
|
+
export declare const normalizeOrganizationRoles: (role: typeof Schema.Unknown.Type) => OrganizationRole[];
|
|
11
|
+
import { Schema } from "effect";
|
package/dist/roles.js
CHANGED
|
@@ -10,17 +10,20 @@ export const organizationImpersonationRoles = [
|
|
|
10
10
|
"support",
|
|
11
11
|
];
|
|
12
12
|
export const globalAdminRoles = ["admin"];
|
|
13
|
-
export const parseRoleList = (role) =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export const parseRoleList = (role) => {
|
|
14
|
+
const decoded = Schema.decodeUnknownOption(Schema.String)(role);
|
|
15
|
+
return Option.isSome(decoded)
|
|
16
|
+
? decoded.value
|
|
17
|
+
.split(",")
|
|
18
|
+
.map((item) => item.trim())
|
|
19
|
+
.filter(Boolean)
|
|
20
|
+
: [];
|
|
21
|
+
};
|
|
19
22
|
export const hasAnyRole = (role, roles) => {
|
|
20
23
|
const allowed = new Set(roles);
|
|
21
24
|
return parseRoleList(role).some((item) => allowed.has(item));
|
|
22
25
|
};
|
|
23
|
-
export const isOrganizationRole = (role) => organizationRoles.
|
|
26
|
+
export const isOrganizationRole = (role) => organizationRoles.some((organizationRole) => organizationRole === role);
|
|
24
27
|
export const normalizeOrganizationRole = (role) => {
|
|
25
28
|
const [firstRole] = parseRoleList(role).filter(isOrganizationRole);
|
|
26
29
|
return firstRole ?? "member";
|
|
@@ -29,3 +32,4 @@ export const normalizeOrganizationRoles = (role) => {
|
|
|
29
32
|
const roles = parseRoleList(role).filter(isOrganizationRole);
|
|
30
33
|
return roles.length > 0 ? Array.from(new Set(roles)) : ["member"];
|
|
31
34
|
};
|
|
35
|
+
import { Option, Schema } from "effect";
|
package/dist/schema.d.ts
CHANGED
|
@@ -152,7 +152,7 @@ export declare const OrganizationMetadata: Schema.Struct<{
|
|
|
152
152
|
}>>;
|
|
153
153
|
}>>>;
|
|
154
154
|
}>;
|
|
155
|
-
export declare const decodeOrganizationMetadata: (metadata:
|
|
155
|
+
export declare const decodeOrganizationMetadata: (metadata: typeof Schema.Unknown.Type) => OrganizationMetadata;
|
|
156
156
|
export declare const Organization: Schema.Struct<{
|
|
157
157
|
readonly id: Schema.String;
|
|
158
158
|
readonly name: Schema.String;
|
package/dist/schema.js
CHANGED
|
@@ -44,7 +44,7 @@ export const Session = Schema.Struct({
|
|
|
44
44
|
}).annotate({
|
|
45
45
|
identifier: "Session",
|
|
46
46
|
title: "Session",
|
|
47
|
-
description: "Current
|
|
47
|
+
description: "Current browser session record.",
|
|
48
48
|
examples: [
|
|
49
49
|
{
|
|
50
50
|
id: "session_1",
|
|
@@ -247,28 +247,35 @@ export const OrganizationMetadata = Schema.Struct({
|
|
|
247
247
|
},
|
|
248
248
|
],
|
|
249
249
|
});
|
|
250
|
-
const
|
|
250
|
+
const OrganizationMetadataRecord = Schema.Record(Schema.String, Schema.Unknown);
|
|
251
|
+
const OrganizationMetadataInput = Schema.Union([
|
|
252
|
+
OrganizationMetadataRecord,
|
|
253
|
+
Schema.fromJsonString(OrganizationMetadataRecord),
|
|
254
|
+
]);
|
|
251
255
|
export const decodeOrganizationMetadata = (metadata) => {
|
|
252
|
-
const value =
|
|
253
|
-
|
|
254
|
-
: metadata;
|
|
255
|
-
if (typeof value !== "object" || value === null) {
|
|
256
|
+
const value = Schema.decodeUnknownOption(OrganizationMetadataInput)(metadata);
|
|
257
|
+
if (Option.isNone(value))
|
|
256
258
|
return { translations: [] };
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
const
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
return {
|
|
259
|
+
const translations = Schema.decodeUnknownOption(Schema.Array(OrganizationTranslation))(value.value.translations);
|
|
260
|
+
const emails = Schema.decodeUnknownOption(Schema.Array(OrganizationEmail))(value.value.emails);
|
|
261
|
+
const phones = Schema.decodeUnknownOption(Schema.Array(OrganizationPhone))(value.value.phones);
|
|
262
|
+
const websites = Schema.decodeUnknownOption(Schema.Array(OrganizationWebsite))(value.value.websites);
|
|
263
|
+
const socials = Schema.decodeUnknownOption(Schema.Array(OrganizationSocial))(value.value.socials);
|
|
264
|
+
const addresses = Schema.decodeUnknownOption(Schema.Array(OrganizationAddress))(value.value.addresses);
|
|
265
|
+
let result = {
|
|
265
266
|
translations: Option.getOrElse(translations, () => []),
|
|
266
|
-
...(Option.isSome(emails) ? { emails: emails.value } : {}),
|
|
267
|
-
...(Option.isSome(phones) ? { phones: phones.value } : {}),
|
|
268
|
-
...(Option.isSome(websites) ? { websites: websites.value } : {}),
|
|
269
|
-
...(Option.isSome(socials) ? { socials: socials.value } : {}),
|
|
270
|
-
...(Option.isSome(addresses) ? { addresses: addresses.value } : {}),
|
|
271
267
|
};
|
|
268
|
+
if (Option.isSome(emails))
|
|
269
|
+
result = { ...result, emails: emails.value };
|
|
270
|
+
if (Option.isSome(phones))
|
|
271
|
+
result = { ...result, phones: phones.value };
|
|
272
|
+
if (Option.isSome(websites))
|
|
273
|
+
result = { ...result, websites: websites.value };
|
|
274
|
+
if (Option.isSome(socials))
|
|
275
|
+
result = { ...result, socials: socials.value };
|
|
276
|
+
if (Option.isSome(addresses))
|
|
277
|
+
result = { ...result, addresses: addresses.value };
|
|
278
|
+
return result;
|
|
272
279
|
};
|
|
273
280
|
const CompatibleOrganizationMetadata = Schema.Unknown.pipe(Schema.decodeTo(OrganizationMetadata, {
|
|
274
281
|
decode: SchemaGetter.transform(decodeOrganizationMetadata),
|
package/dist/server/actor.d.ts
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
import { Layer } from "effect";
|
|
2
2
|
import { HttpApiError, HttpApiMiddleware } from "effect/unstable/httpapi";
|
|
3
|
-
import { CurrentActor, type ProjectAccessDefinition } from "../access";
|
|
4
|
-
import { AuthService } from "../service";
|
|
3
|
+
import { CurrentActor, type ProjectAccessDefinition } from "../access.js";
|
|
4
|
+
import { AuthService } from "../service.js";
|
|
5
5
|
declare const AnyActorRequired_base: HttpApiMiddleware.ServiceClass<AnyActorRequired, "@krak-stack/auth/ActorRequired", {
|
|
6
6
|
requires: AuthService;
|
|
7
7
|
provides: CurrentActor;
|
|
8
|
-
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden];
|
|
8
|
+
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable];
|
|
9
9
|
clientError: never;
|
|
10
10
|
requiredForClient: false;
|
|
11
11
|
security: never;
|
|
12
|
-
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden], AuthService>>;
|
|
12
|
+
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable], AuthService>>;
|
|
13
13
|
declare class AnyActorRequired extends AnyActorRequired_base {
|
|
14
14
|
}
|
|
15
15
|
declare const UserActorRequired_base: HttpApiMiddleware.ServiceClass<UserActorRequired, "@krak-stack/auth/ActorRequired/User", {
|
|
16
16
|
requires: AuthService;
|
|
17
17
|
provides: CurrentActor;
|
|
18
|
-
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden];
|
|
18
|
+
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable];
|
|
19
19
|
clientError: never;
|
|
20
20
|
requiredForClient: false;
|
|
21
21
|
security: never;
|
|
22
|
-
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden], AuthService>>;
|
|
22
|
+
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable], AuthService>>;
|
|
23
23
|
declare class UserActorRequired extends UserActorRequired_base {
|
|
24
24
|
}
|
|
25
25
|
declare const ApiKeyActorRequired_base: HttpApiMiddleware.ServiceClass<ApiKeyActorRequired, "@krak-stack/auth/ActorRequired/ApiKey", {
|
|
26
26
|
requires: AuthService;
|
|
27
27
|
provides: CurrentActor;
|
|
28
|
-
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden];
|
|
28
|
+
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable];
|
|
29
29
|
clientError: never;
|
|
30
30
|
requiredForClient: false;
|
|
31
31
|
security: never;
|
|
32
|
-
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden], AuthService>>;
|
|
32
|
+
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable], AuthService>>;
|
|
33
33
|
declare class ApiKeyActorRequired extends ApiKeyActorRequired_base {
|
|
34
34
|
}
|
|
35
35
|
declare const UserApiKeyActorRequired_base: HttpApiMiddleware.ServiceClass<UserApiKeyActorRequired, "@krak-stack/auth/ActorRequired/ApiKey/User", {
|
|
36
36
|
requires: AuthService;
|
|
37
37
|
provides: CurrentActor;
|
|
38
|
-
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden];
|
|
38
|
+
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable];
|
|
39
39
|
clientError: never;
|
|
40
40
|
requiredForClient: false;
|
|
41
41
|
security: never;
|
|
42
|
-
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden], AuthService>>;
|
|
42
|
+
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable], AuthService>>;
|
|
43
43
|
declare class UserApiKeyActorRequired extends UserApiKeyActorRequired_base {
|
|
44
44
|
}
|
|
45
45
|
declare const OrganizationApiKeyActorRequired_base: HttpApiMiddleware.ServiceClass<OrganizationApiKeyActorRequired, "@krak-stack/auth/ActorRequired/ApiKey/Organization", {
|
|
46
46
|
requires: AuthService;
|
|
47
47
|
provides: CurrentActor;
|
|
48
|
-
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden];
|
|
48
|
+
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable];
|
|
49
49
|
clientError: never;
|
|
50
50
|
requiredForClient: false;
|
|
51
51
|
security: never;
|
|
52
|
-
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden], AuthService>>;
|
|
52
|
+
}, HttpApiMiddleware.HttpApiMiddleware<CurrentActor, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable], AuthService>>;
|
|
53
53
|
declare class OrganizationApiKeyActorRequired extends OrganizationApiKeyActorRequired_base {
|
|
54
54
|
}
|
|
55
55
|
export type ActorConstraint = {
|
|
@@ -58,24 +58,22 @@ export type ActorConstraint = {
|
|
|
58
58
|
readonly type: "apiKey";
|
|
59
59
|
readonly ownerType?: "user" | "organization" | undefined;
|
|
60
60
|
};
|
|
61
|
-
declare
|
|
62
|
-
|
|
63
|
-
(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
export declare const ActorRequired: ActorRequiredFactory;
|
|
61
|
+
export declare function ActorRequired(): typeof AnyActorRequired;
|
|
62
|
+
export declare namespace ActorRequired {
|
|
63
|
+
var layer: <Project extends string, Action extends string>(access: ProjectAccessDefinition<Project, Action>) => Layer.Layer<AnyActorRequired | ApiKeyActorRequired | OrganizationApiKeyActorRequired | UserActorRequired | UserApiKeyActorRequired, never, never>;
|
|
64
|
+
}
|
|
65
|
+
export declare function ActorRequired(constraint: {
|
|
66
|
+
readonly type: "user";
|
|
67
|
+
}): typeof UserActorRequired;
|
|
68
|
+
export declare function ActorRequired(constraint: {
|
|
69
|
+
readonly type: "apiKey";
|
|
70
|
+
readonly ownerType: "user";
|
|
71
|
+
}): typeof UserApiKeyActorRequired;
|
|
72
|
+
export declare function ActorRequired(constraint: {
|
|
73
|
+
readonly type: "apiKey";
|
|
74
|
+
readonly ownerType: "organization";
|
|
75
|
+
}): typeof OrganizationApiKeyActorRequired;
|
|
76
|
+
export declare function ActorRequired(constraint: {
|
|
77
|
+
readonly type: "apiKey";
|
|
78
|
+
}): typeof ApiKeyActorRequired;
|
|
81
79
|
export {};
|
package/dist/server/actor.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Effect, Layer, Schema } from "effect";
|
|
2
2
|
import { HttpApiError, HttpApiMiddleware } from "effect/unstable/httpapi";
|
|
3
|
-
import { ApiKeyPermissionGrant, CurrentActor, } from "../access";
|
|
4
|
-
import { parseRoleList } from "../roles";
|
|
5
|
-
import { AuthService } from "../service";
|
|
3
|
+
import { ApiKeyPermissionGrant, CurrentActor, } from "../access.js";
|
|
4
|
+
import { parseRoleList } from "../roles.js";
|
|
5
|
+
import { AuthService } from "../service.js";
|
|
6
6
|
const activeMemberRoles = ({ organizationId, userId, }) => Effect.gen(function* () {
|
|
7
7
|
const auth = yield* AuthService;
|
|
8
|
-
const
|
|
9
|
-
.
|
|
8
|
+
const role = yield* auth
|
|
9
|
+
.getActiveMemberRole({ organizationId, userId })
|
|
10
10
|
.pipe(Effect.mapError(() => new HttpApiError.Forbidden({})));
|
|
11
|
-
return parseRoleList(
|
|
11
|
+
return parseRoleList(role);
|
|
12
12
|
});
|
|
13
13
|
const resolveCurrentActor = (access) => Effect.gen(function* () {
|
|
14
14
|
const auth = yield* AuthService;
|
|
@@ -60,23 +60,43 @@ const resolveCurrentActor = (access) => Effect.gen(function* () {
|
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
class AnyActorRequired extends HttpApiMiddleware.Service()("@krak-stack/auth/ActorRequired", {
|
|
63
|
-
error: [
|
|
63
|
+
error: [
|
|
64
|
+
HttpApiError.Unauthorized,
|
|
65
|
+
HttpApiError.Forbidden,
|
|
66
|
+
HttpApiError.ServiceUnavailable,
|
|
67
|
+
],
|
|
64
68
|
}) {
|
|
65
69
|
}
|
|
66
70
|
class UserActorRequired extends HttpApiMiddleware.Service()("@krak-stack/auth/ActorRequired/User", {
|
|
67
|
-
error: [
|
|
71
|
+
error: [
|
|
72
|
+
HttpApiError.Unauthorized,
|
|
73
|
+
HttpApiError.Forbidden,
|
|
74
|
+
HttpApiError.ServiceUnavailable,
|
|
75
|
+
],
|
|
68
76
|
}) {
|
|
69
77
|
}
|
|
70
78
|
class ApiKeyActorRequired extends HttpApiMiddleware.Service()("@krak-stack/auth/ActorRequired/ApiKey", {
|
|
71
|
-
error: [
|
|
79
|
+
error: [
|
|
80
|
+
HttpApiError.Unauthorized,
|
|
81
|
+
HttpApiError.Forbidden,
|
|
82
|
+
HttpApiError.ServiceUnavailable,
|
|
83
|
+
],
|
|
72
84
|
}) {
|
|
73
85
|
}
|
|
74
86
|
class UserApiKeyActorRequired extends HttpApiMiddleware.Service()("@krak-stack/auth/ActorRequired/ApiKey/User", {
|
|
75
|
-
error: [
|
|
87
|
+
error: [
|
|
88
|
+
HttpApiError.Unauthorized,
|
|
89
|
+
HttpApiError.Forbidden,
|
|
90
|
+
HttpApiError.ServiceUnavailable,
|
|
91
|
+
],
|
|
76
92
|
}) {
|
|
77
93
|
}
|
|
78
94
|
class OrganizationApiKeyActorRequired extends HttpApiMiddleware.Service()("@krak-stack/auth/ActorRequired/ApiKey/Organization", {
|
|
79
|
-
error: [
|
|
95
|
+
error: [
|
|
96
|
+
HttpApiError.Unauthorized,
|
|
97
|
+
HttpApiError.Forbidden,
|
|
98
|
+
HttpApiError.ServiceUnavailable,
|
|
99
|
+
],
|
|
80
100
|
}) {
|
|
81
101
|
}
|
|
82
102
|
const matchesConstraint = (actor, constraint) => {
|
|
@@ -96,15 +116,14 @@ const withCurrentActor = (httpEffect, actor) => {
|
|
|
96
116
|
: actor.actor.owner.type === "user"
|
|
97
117
|
? actor.actor.owner.userId
|
|
98
118
|
: undefined;
|
|
99
|
-
const attributes = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
};
|
|
119
|
+
const attributes = {};
|
|
120
|
+
if (actor.organizationId)
|
|
121
|
+
attributes["organization.id"] = actor.organizationId;
|
|
122
|
+
if (userId)
|
|
123
|
+
attributes["user.id"] = userId;
|
|
105
124
|
return Effect.annotateCurrentSpan(attributes).pipe(Effect.andThen(httpEffect.pipe(Effect.provideService(CurrentActor, actor), Effect.annotateSpans(attributes), Effect.annotateLogs(attributes))));
|
|
106
125
|
};
|
|
107
|
-
|
|
126
|
+
export function ActorRequired(constraint) {
|
|
108
127
|
if (!constraint)
|
|
109
128
|
return AnyActorRequired;
|
|
110
129
|
if (constraint.type === "user")
|
|
@@ -115,11 +134,9 @@ const actorRequired = (constraint) => {
|
|
|
115
134
|
return OrganizationApiKeyActorRequired;
|
|
116
135
|
}
|
|
117
136
|
return ApiKeyActorRequired;
|
|
118
|
-
}
|
|
137
|
+
}
|
|
119
138
|
const actorRequiredLayer = (access) => Layer.mergeAll(Layer.succeed(AnyActorRequired, (httpEffect) => requiredActor(access).pipe(Effect.flatMap((actor) => withCurrentActor(httpEffect, actor)))), Layer.succeed(UserActorRequired, (httpEffect) => requiredActor(access, { type: "user" }).pipe(Effect.flatMap((actor) => withCurrentActor(httpEffect, actor)))), Layer.succeed(ApiKeyActorRequired, (httpEffect) => requiredActor(access, { type: "apiKey" }).pipe(Effect.flatMap((actor) => withCurrentActor(httpEffect, actor)))), Layer.succeed(UserApiKeyActorRequired, (httpEffect) => requiredActor(access, { type: "apiKey", ownerType: "user" }).pipe(Effect.flatMap((actor) => withCurrentActor(httpEffect, actor)))), Layer.succeed(OrganizationApiKeyActorRequired, (httpEffect) => requiredActor(access, {
|
|
120
139
|
type: "apiKey",
|
|
121
140
|
ownerType: "organization",
|
|
122
141
|
}).pipe(Effect.flatMap((actor) => withCurrentActor(httpEffect, actor)))));
|
|
123
|
-
|
|
124
|
-
layer: actorRequiredLayer,
|
|
125
|
-
});
|
|
142
|
+
ActorRequired.layer = actorRequiredLayer;
|
package/dist/server/api.group.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenApi } from "effect/unstable/httpapi";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, } from "effect/unstable/httpapi";
|
|
3
|
-
import { Member, Organization, User } from "../schema";
|
|
4
|
-
import { ServerActiveOrganization, ServerCreateDomainPayload, ServerDomain, ServerDomainHostParams, ServerDomainIdParams, ServerDomainRecordsResponse, ServerIdParams, ServerIdsQuery, ServerMemberParams, ServerMembersResponse, ServerOrganizationChildrenResponse, ServerOrganizationIdParams, ServerOrganizationsQuery, ServerOrganizationsResponse, ServerUserIdParams, ServerUsersResponse, } from "./schema";
|
|
3
|
+
import { Member, Organization, User } from "../schema.js";
|
|
4
|
+
import { ServerActiveOrganization, ServerCreateDomainPayload, ServerDomain, ServerDomainHostParams, ServerDomainIdParams, ServerDomainRecordsResponse, ServerIdParams, ServerIdsQuery, ServerMemberParams, ServerMembersResponse, ServerOrganizationChildrenResponse, ServerOrganizationIdParams, ServerOrganizationsQuery, ServerOrganizationsResponse, ServerUserIdParams, ServerUsersResponse, } from "./schema.js";
|
|
5
5
|
export const ServerUsersApiGroup = HttpApiGroup.make("users")
|
|
6
6
|
.add(HttpApiEndpoint.get("listUsersByIds", "/users", {
|
|
7
7
|
query: ServerIdsQuery,
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { AuthService } from "../service";
|
|
2
|
-
export type { AuthSession, AuthSessionWithOrganization, AuthSessionWithUser, AuthSessionWithUserAndOrganization, } from "../service";
|
|
3
|
-
export { AuthClientConfig } from "../config";
|
|
4
|
-
export { ServerDomainsApiGroup, ServerOrganizationsApiGroup, ServerUsersApiGroup, } from "./api.group";
|
|
5
|
-
export { proxyAuthRequest } from "./proxy";
|
|
6
|
-
export type { ProxyAuthRequestOptions } from "./proxy";
|
|
7
|
-
export { ActorRequired } from "./actor";
|
|
8
|
-
export type { ActorConstraint } from "./actor";
|
|
9
|
-
export { ApiKeySecurity, AuthMiddleware, makeAuthenticationLive, } from "./middleware";
|
|
10
|
-
export type { AuthenticationLiveOptions } from "./middleware";
|
|
11
|
-
export { ServerActiveOrganization, ServerCreateDomainPayload, ServerDomain, ServerDomainHostParams, ServerDomainIdParams, ServerDomainRecordsResponse, ServerMembersResponse, ServerOrganizationChildrenResponse, ServerOrganizationsResponse, ServerUpdateDomainPayload, ServerUsersResponse, } from "./schema";
|
|
12
|
-
export type { Member, Organization, OrganizationMetadata, User, } from "../schema";
|
|
13
|
-
export { ApiKeyPermissionGrant, CurrentActor, Forbidden, all, actorUserId, any, defineProjectAccess, permission, policy, withPolicy, } from "../access";
|
|
14
|
-
export type { ApiKeyOwner, ApiKeyActor, Actor, Policy, ProjectAccessConfig, ProjectAccessCatalog, ProjectAccessDefinition, UserActor, } from "../access";
|
|
1
|
+
export { AuthService } from "../service.js";
|
|
2
|
+
export type { AuthSession, AuthSessionWithOrganization, AuthSessionWithUser, AuthSessionWithUserAndOrganization, } from "../service.js";
|
|
3
|
+
export { AuthClientConfig } from "../config.js";
|
|
4
|
+
export { ServerDomainsApiGroup, ServerOrganizationsApiGroup, ServerUsersApiGroup, } from "./api.group.js";
|
|
5
|
+
export { proxyAuthRequest } from "./proxy.js";
|
|
6
|
+
export type { ProxyAuthRequestOptions } from "./proxy.js";
|
|
7
|
+
export { ActorRequired } from "./actor.js";
|
|
8
|
+
export type { ActorConstraint } from "./actor.js";
|
|
9
|
+
export { ApiKeySecurity, AuthMiddleware, makeAuthenticationLive, } from "./middleware.js";
|
|
10
|
+
export type { AuthenticationLiveOptions } from "./middleware.js";
|
|
11
|
+
export { ServerActiveOrganization, ServerCreateDomainPayload, ServerDomain, ServerDomainHostParams, ServerDomainIdParams, ServerDomainRecordsResponse, ServerMembersResponse, ServerOrganizationChildrenResponse, ServerOrganizationsResponse, ServerUpdateDomainPayload, ServerUsersResponse, } from "./schema.js";
|
|
12
|
+
export type { Member, Organization, OrganizationMetadata, User, } from "../schema.js";
|
|
13
|
+
export { ApiKeyPermissionGrant, CurrentActor, Forbidden, all, actorUserId, any, defineProjectAccess, permission, policy, withPolicy, } from "../access.js";
|
|
14
|
+
export type { ApiKeyOwner, ApiKeyActor, Actor, Policy, ProjectAccessConfig, ProjectAccessCatalog, ProjectAccessDefinition, UserActor, } from "../access.js";
|
package/dist/server/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { AuthService } from "../service";
|
|
2
|
-
export { AuthClientConfig } from "../config";
|
|
3
|
-
export { ServerDomainsApiGroup, ServerOrganizationsApiGroup, ServerUsersApiGroup, } from "./api.group";
|
|
4
|
-
export { proxyAuthRequest } from "./proxy";
|
|
5
|
-
export { ActorRequired } from "./actor";
|
|
6
|
-
export { ApiKeySecurity, AuthMiddleware, makeAuthenticationLive, } from "./middleware";
|
|
7
|
-
export { ServerActiveOrganization, ServerCreateDomainPayload, ServerDomain, ServerDomainHostParams, ServerDomainIdParams, ServerDomainRecordsResponse, ServerMembersResponse, ServerOrganizationChildrenResponse, ServerOrganizationsResponse, ServerUpdateDomainPayload, ServerUsersResponse, } from "./schema";
|
|
8
|
-
export { ApiKeyPermissionGrant, CurrentActor, Forbidden, all, actorUserId, any, defineProjectAccess, permission, policy, withPolicy, } from "../access";
|
|
1
|
+
export { AuthService } from "../service.js";
|
|
2
|
+
export { AuthClientConfig } from "../config.js";
|
|
3
|
+
export { ServerDomainsApiGroup, ServerOrganizationsApiGroup, ServerUsersApiGroup, } from "./api.group.js";
|
|
4
|
+
export { proxyAuthRequest } from "./proxy.js";
|
|
5
|
+
export { ActorRequired } from "./actor.js";
|
|
6
|
+
export { ApiKeySecurity, AuthMiddleware, makeAuthenticationLive, } from "./middleware.js";
|
|
7
|
+
export { ServerActiveOrganization, ServerCreateDomainPayload, ServerDomain, ServerDomainHostParams, ServerDomainIdParams, ServerDomainRecordsResponse, ServerMembersResponse, ServerOrganizationChildrenResponse, ServerOrganizationsResponse, ServerUpdateDomainPayload, ServerUsersResponse, } from "./schema.js";
|
|
8
|
+
export { ApiKeyPermissionGrant, CurrentActor, Forbidden, all, actorUserId, any, defineProjectAccess, permission, policy, withPolicy, } from "../access.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Layer } from "effect";
|
|
2
2
|
import { HttpServerRequest } from "effect/unstable/http";
|
|
3
3
|
import { HttpApiError, HttpApiMiddleware, HttpApiSecurity } from "effect/unstable/httpapi";
|
|
4
|
-
import { AuthService, type AuthServiceLayerOptions } from "../service";
|
|
4
|
+
import { AuthService, type AuthServiceLayerOptions } from "../service.js";
|
|
5
5
|
export declare const ApiKeySecurity: HttpApiSecurity.ApiKey;
|
|
6
6
|
declare const AuthMiddleware_base: HttpApiMiddleware.ServiceClass<AuthMiddleware, "@krak-stack/auth/AuthMiddleware", {
|
|
7
7
|
requires: never;
|
|
8
8
|
provides: AuthService;
|
|
9
|
-
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden];
|
|
9
|
+
error: readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable];
|
|
10
10
|
clientError: never;
|
|
11
11
|
requiredForClient: false;
|
|
12
12
|
security: {
|
|
@@ -14,7 +14,7 @@ declare const AuthMiddleware_base: HttpApiMiddleware.ServiceClass<AuthMiddleware
|
|
|
14
14
|
};
|
|
15
15
|
}, HttpApiMiddleware.HttpApiMiddlewareSecurity<{
|
|
16
16
|
readonly apiKey: HttpApiSecurity.ApiKey;
|
|
17
|
-
}, AuthService, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden], never>>;
|
|
17
|
+
}, AuthService, readonly [typeof HttpApiError.Unauthorized, typeof HttpApiError.Forbidden, typeof HttpApiError.ServiceUnavailable], never>>;
|
|
18
18
|
export declare class AuthMiddleware extends AuthMiddleware_base {
|
|
19
19
|
static readonly layer: (options?: AuthenticationLiveOptions | Layer.Layer<AuthService, unknown>) => Layer.Layer<AuthMiddleware, never, never>;
|
|
20
20
|
}
|