@vfarcic/dot-ai 1.5.0 → 1.6.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/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +27 -0
- package/dist/interfaces/error-response.d.ts +2 -1
- package/dist/interfaces/error-response.d.ts.map +1 -1
- package/dist/interfaces/error-response.js +6 -2
- package/dist/interfaces/mcp.d.ts +32 -12
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +327 -230
- package/dist/interfaces/oauth/dex-api.proto +304 -0
- package/dist/interfaces/oauth/dex-client.d.ts +41 -0
- package/dist/interfaces/oauth/dex-client.d.ts.map +1 -0
- package/dist/interfaces/oauth/dex-client.js +145 -0
- package/dist/interfaces/oauth/index.d.ts +6 -0
- package/dist/interfaces/oauth/index.d.ts.map +1 -0
- package/dist/interfaces/oauth/index.js +16 -0
- package/dist/interfaces/oauth/jwt.d.ts +37 -0
- package/dist/interfaces/oauth/jwt.d.ts.map +1 -0
- package/dist/interfaces/oauth/jwt.js +106 -0
- package/dist/interfaces/oauth/middleware.d.ts +27 -0
- package/dist/interfaces/oauth/middleware.d.ts.map +1 -0
- package/dist/interfaces/oauth/middleware.js +106 -0
- package/dist/interfaces/oauth/provider.d.ts +94 -0
- package/dist/interfaces/oauth/provider.d.ts.map +1 -0
- package/dist/interfaces/oauth/provider.js +373 -0
- package/dist/interfaces/oauth/types.d.ts +98 -0
- package/dist/interfaces/oauth/types.d.ts.map +1 -0
- package/dist/interfaces/oauth/types.js +8 -0
- package/dist/interfaces/oauth/user-management.d.ts +36 -0
- package/dist/interfaces/oauth/user-management.d.ts.map +1 -0
- package/dist/interfaces/oauth/user-management.js +156 -0
- package/dist/interfaces/request-context.d.ts +19 -0
- package/dist/interfaces/request-context.d.ts.map +1 -0
- package/dist/interfaces/request-context.js +20 -0
- package/dist/interfaces/rest-api.d.ts +12 -0
- package/dist/interfaces/rest-api.d.ts.map +1 -1
- package/dist/interfaces/rest-api.js +107 -0
- package/dist/interfaces/routes/index.d.ts.map +1 -1
- package/dist/interfaces/routes/index.js +38 -0
- package/dist/interfaces/schemas/common.d.ts +1 -0
- package/dist/interfaces/schemas/common.d.ts.map +1 -1
- package/dist/interfaces/schemas/common.js +1 -0
- package/dist/interfaces/schemas/index.d.ts +1 -0
- package/dist/interfaces/schemas/index.d.ts.map +1 -1
- package/dist/interfaces/schemas/index.js +16 -1
- package/dist/interfaces/schemas/users.d.ts +128 -0
- package/dist/interfaces/schemas/users.d.ts.map +1 -0
- package/dist/interfaces/schemas/users.js +64 -0
- package/dist/tools/remediate.d.ts +1 -1
- package/dist/tools/remediate.d.ts.map +1 -1
- package/dist/tools/remediate.js +38 -26
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +4 -0
- package/package.json +7 -2
- package/shared-prompts/prd-start.md +13 -0
- package/dist/interfaces/auth.d.ts +0 -26
- package/dist/interfaces/auth.d.ts.map +0 -1
- package/dist/interfaces/auth.js +0 -82
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.ResourceSyncResponseSchema = exports.ResourceSyncDataSchema = exports.ResourceSyncRequestSchema = exports.NamespacesResponseSchema = exports.NamespacesDataSchema = exports.SingleResourceResponseSchema = exports.SingleResourceDataSchema = exports.ResourceListResponseSchema = exports.ResourceListDataSchema = exports.ResourceSearchResponseSchema = exports.ResourceSearchDataSchema = exports.ResourceSummarySchema = exports.ResourceKindsResponseSchema = exports.ResourceKindsDataSchema = exports.ResourceKindSchema = exports.VisualizationInternalErrorSchema = exports.VisualizationServiceUnavailableErrorSchema = exports.VisualizationNotFoundErrorSchema = exports.VisualizationResponseSchema = exports.VisualizationResponseDataSchema = exports.VisualizationSchema = exports.VisualizationContentSchema = exports.BarChartContentSchema = exports.BarChartDataItemSchema = exports.DiffContentSchema = exports.CardsContentSchema = exports.CardItemSchema = exports.TableContentSchema = exports.CodeContentSchema = exports.VisualizationTypeSchema = exports.ToolDiscoveryErrorSchema = exports.ToolExecutionErrorSchema = exports.InvalidToolRequestErrorSchema = exports.ToolNotFoundErrorSchema = exports.ToolExecutionResponseSchema = exports.ToolExecutionDataSchema = exports.ToolDiscoveryResponseSchema = exports.ToolDiscoveryDataSchema = exports.ToolInfoSchema = exports.ToolParameterSchema = exports.createSuccessResponseSchema = exports.InternalServerErrorSchema = exports.ServiceUnavailableErrorSchema = exports.MethodNotAllowedErrorSchema = exports.BadRequestErrorSchema = exports.NotFoundErrorSchema = exports.ErrorResponseSchema = exports.RestApiResponseSchema = exports.ErrorDetailsSchema = exports.MetaSchema = void 0;
|
|
15
15
|
exports.KnowledgeAskSourceSchema = exports.KnowledgeAskRequestSchema = exports.DeleteBySourceErrorSchema = exports.DeleteBySourcePluginUnavailableErrorSchema = exports.DeleteBySourceBadRequestErrorSchema = exports.DeleteBySourceResponseSchema = exports.DeleteBySourceDataSchema = exports.PromptsCacheRefreshErrorSchema = exports.PromptsCacheRefreshResponseSchema = exports.PromptsCacheRefreshDataSchema = exports.PromptGetErrorSchema = exports.PromptsListErrorSchema = exports.PromptValidationErrorSchema = exports.PromptNotFoundErrorSchema = exports.PromptGetRequestSchema = exports.PromptGetResponseSchema = exports.PromptGetDataSchema = exports.PromptFileSchema = exports.PromptMessageSchema = exports.PromptsListResponseSchema = exports.PromptsListDataSchema = exports.PromptInfoSchema = exports.PromptArgumentSchema = exports.SessionRetrievalErrorSchema = exports.SessionNotFoundErrorSchema = exports.SessionResponseSchema = exports.SessionResponseDataSchema = exports.SessionDataSchema = exports.SessionMetadataSchema = exports.LogsErrorSchema = exports.LogsPluginUnavailableErrorSchema = exports.LogsBadRequestErrorSchema = exports.LogsResponseSchema = exports.LogsDataSchema = exports.EventsErrorSchema = exports.EventsPluginUnavailableErrorSchema = exports.EventsBadRequestErrorSchema = exports.EventsResponseSchema = exports.EventsDataSchema = exports.KubernetesEventSchema = exports.EventInvolvedObjectSchema = exports.ResourceSyncErrorSchema = exports.NamespacesErrorSchema = exports.SingleResourceErrorSchema = exports.ResourceListErrorSchema = exports.ResourceSearchErrorSchema = exports.ResourceKindsErrorSchema = exports.ResourcePluginUnavailableErrorSchema = exports.ResourceBadRequestErrorSchema = exports.ResourceNotFoundErrorSchema = void 0;
|
|
16
|
-
exports.EmbeddingMigrationErrorSchema = exports.EmbeddingMigrationServiceUnavailableErrorSchema = exports.EmbeddingMigrationBadRequestErrorSchema = exports.EmbeddingMigrationResponseSchema = exports.EmbeddingMigrationDataSchema = exports.CollectionMigrationResultSchema = exports.EmbeddingMigrationRequestSchema = exports.KnowledgeAskErrorSchema = exports.KnowledgeAskPluginUnavailableErrorSchema = exports.KnowledgeAskAIUnavailableErrorSchema = exports.KnowledgeAskBadRequestErrorSchema = exports.KnowledgeAskResponseSchema = exports.KnowledgeAskDataSchema = exports.KnowledgeAskChunkSchema = void 0;
|
|
16
|
+
exports.UserManagementErrorSchema = exports.UserBadRequestErrorSchema = exports.UserNotFoundErrorSchema = exports.UserConflictErrorSchema = exports.UserEmailParamsSchema = exports.UserEntrySchema = exports.UserDeleteResponseSchema = exports.UserDeleteDataSchema = exports.UserListResponseSchema = exports.UserListDataSchema = exports.UserCreateResponseSchema = exports.UserCreateDataSchema = exports.UserCreateRequestSchema = exports.EmbeddingMigrationErrorSchema = exports.EmbeddingMigrationServiceUnavailableErrorSchema = exports.EmbeddingMigrationBadRequestErrorSchema = exports.EmbeddingMigrationResponseSchema = exports.EmbeddingMigrationDataSchema = exports.CollectionMigrationResultSchema = exports.EmbeddingMigrationRequestSchema = exports.KnowledgeAskErrorSchema = exports.KnowledgeAskPluginUnavailableErrorSchema = exports.KnowledgeAskAIUnavailableErrorSchema = exports.KnowledgeAskBadRequestErrorSchema = exports.KnowledgeAskResponseSchema = exports.KnowledgeAskDataSchema = exports.KnowledgeAskChunkSchema = void 0;
|
|
17
17
|
// Common schemas
|
|
18
18
|
var common_1 = require("./common");
|
|
19
19
|
Object.defineProperty(exports, "MetaSchema", { enumerable: true, get: function () { return common_1.MetaSchema; } });
|
|
@@ -149,3 +149,18 @@ Object.defineProperty(exports, "EmbeddingMigrationResponseSchema", { enumerable:
|
|
|
149
149
|
Object.defineProperty(exports, "EmbeddingMigrationBadRequestErrorSchema", { enumerable: true, get: function () { return embeddings_1.EmbeddingMigrationBadRequestErrorSchema; } });
|
|
150
150
|
Object.defineProperty(exports, "EmbeddingMigrationServiceUnavailableErrorSchema", { enumerable: true, get: function () { return embeddings_1.EmbeddingMigrationServiceUnavailableErrorSchema; } });
|
|
151
151
|
Object.defineProperty(exports, "EmbeddingMigrationErrorSchema", { enumerable: true, get: function () { return embeddings_1.EmbeddingMigrationErrorSchema; } });
|
|
152
|
+
// Users schemas (PRD #380 Task 2.5)
|
|
153
|
+
var users_1 = require("./users");
|
|
154
|
+
Object.defineProperty(exports, "UserCreateRequestSchema", { enumerable: true, get: function () { return users_1.UserCreateRequestSchema; } });
|
|
155
|
+
Object.defineProperty(exports, "UserCreateDataSchema", { enumerable: true, get: function () { return users_1.UserCreateDataSchema; } });
|
|
156
|
+
Object.defineProperty(exports, "UserCreateResponseSchema", { enumerable: true, get: function () { return users_1.UserCreateResponseSchema; } });
|
|
157
|
+
Object.defineProperty(exports, "UserListDataSchema", { enumerable: true, get: function () { return users_1.UserListDataSchema; } });
|
|
158
|
+
Object.defineProperty(exports, "UserListResponseSchema", { enumerable: true, get: function () { return users_1.UserListResponseSchema; } });
|
|
159
|
+
Object.defineProperty(exports, "UserDeleteDataSchema", { enumerable: true, get: function () { return users_1.UserDeleteDataSchema; } });
|
|
160
|
+
Object.defineProperty(exports, "UserDeleteResponseSchema", { enumerable: true, get: function () { return users_1.UserDeleteResponseSchema; } });
|
|
161
|
+
Object.defineProperty(exports, "UserEntrySchema", { enumerable: true, get: function () { return users_1.UserEntrySchema; } });
|
|
162
|
+
Object.defineProperty(exports, "UserEmailParamsSchema", { enumerable: true, get: function () { return users_1.UserEmailParamsSchema; } });
|
|
163
|
+
Object.defineProperty(exports, "UserConflictErrorSchema", { enumerable: true, get: function () { return users_1.UserConflictErrorSchema; } });
|
|
164
|
+
Object.defineProperty(exports, "UserNotFoundErrorSchema", { enumerable: true, get: function () { return users_1.UserNotFoundErrorSchema; } });
|
|
165
|
+
Object.defineProperty(exports, "UserBadRequestErrorSchema", { enumerable: true, get: function () { return users_1.UserBadRequestErrorSchema; } });
|
|
166
|
+
Object.defineProperty(exports, "UserManagementErrorSchema", { enumerable: true, get: function () { return users_1.UserManagementErrorSchema; } });
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Management Endpoint Schemas (PRD #380 Task 2.5)
|
|
3
|
+
*
|
|
4
|
+
* Schemas for the /api/v1/users endpoints.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
export declare const UserCreateRequestSchema: z.ZodObject<{
|
|
8
|
+
email: z.ZodString;
|
|
9
|
+
password: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type UserCreateRequest = z.infer<typeof UserCreateRequestSchema>;
|
|
12
|
+
export declare const UserEmailParamsSchema: z.ZodObject<{
|
|
13
|
+
email: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const UserEntrySchema: z.ZodObject<{
|
|
16
|
+
email: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const UserCreateDataSchema: z.ZodObject<{
|
|
19
|
+
email: z.ZodString;
|
|
20
|
+
message: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type UserCreateData = z.infer<typeof UserCreateDataSchema>;
|
|
23
|
+
export declare const UserCreateResponseSchema: z.ZodObject<{
|
|
24
|
+
success: z.ZodLiteral<true>;
|
|
25
|
+
data: z.ZodObject<{
|
|
26
|
+
email: z.ZodString;
|
|
27
|
+
message: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
timestamp: z.ZodString;
|
|
31
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
32
|
+
version: z.ZodString;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type UserCreateResponse = z.infer<typeof UserCreateResponseSchema>;
|
|
36
|
+
export declare const UserListDataSchema: z.ZodObject<{
|
|
37
|
+
users: z.ZodArray<z.ZodObject<{
|
|
38
|
+
email: z.ZodString;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
total: z.ZodNumber;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type UserListData = z.infer<typeof UserListDataSchema>;
|
|
43
|
+
export declare const UserListResponseSchema: z.ZodObject<{
|
|
44
|
+
success: z.ZodLiteral<true>;
|
|
45
|
+
data: z.ZodObject<{
|
|
46
|
+
users: z.ZodArray<z.ZodObject<{
|
|
47
|
+
email: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
total: z.ZodNumber;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
timestamp: z.ZodString;
|
|
53
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
version: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type UserListResponse = z.infer<typeof UserListResponseSchema>;
|
|
58
|
+
export declare const UserDeleteDataSchema: z.ZodObject<{
|
|
59
|
+
email: z.ZodString;
|
|
60
|
+
message: z.ZodString;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export type UserDeleteData = z.infer<typeof UserDeleteDataSchema>;
|
|
63
|
+
export declare const UserDeleteResponseSchema: z.ZodObject<{
|
|
64
|
+
success: z.ZodLiteral<true>;
|
|
65
|
+
data: z.ZodObject<{
|
|
66
|
+
email: z.ZodString;
|
|
67
|
+
message: z.ZodString;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
70
|
+
timestamp: z.ZodString;
|
|
71
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
72
|
+
version: z.ZodString;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type UserDeleteResponse = z.infer<typeof UserDeleteResponseSchema>;
|
|
76
|
+
export declare const UserConflictErrorSchema: z.ZodObject<{
|
|
77
|
+
success: z.ZodLiteral<false>;
|
|
78
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
timestamp: z.ZodString;
|
|
80
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
81
|
+
version: z.ZodString;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
error: z.ZodObject<{
|
|
84
|
+
message: z.ZodString;
|
|
85
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
86
|
+
code: z.ZodLiteral<"USER_CONFLICT">;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
export declare const UserNotFoundErrorSchema: z.ZodObject<{
|
|
90
|
+
success: z.ZodLiteral<false>;
|
|
91
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
timestamp: z.ZodString;
|
|
93
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
94
|
+
version: z.ZodString;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
error: z.ZodObject<{
|
|
97
|
+
message: z.ZodString;
|
|
98
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
99
|
+
code: z.ZodLiteral<"USER_NOT_FOUND">;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export declare const UserBadRequestErrorSchema: z.ZodObject<{
|
|
103
|
+
success: z.ZodLiteral<false>;
|
|
104
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
timestamp: z.ZodString;
|
|
106
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
107
|
+
version: z.ZodString;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
error: z.ZodObject<{
|
|
110
|
+
message: z.ZodString;
|
|
111
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
112
|
+
code: z.ZodLiteral<"INVALID_REQUEST">;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export declare const UserManagementErrorSchema: z.ZodObject<{
|
|
116
|
+
success: z.ZodLiteral<false>;
|
|
117
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
118
|
+
timestamp: z.ZodString;
|
|
119
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
120
|
+
version: z.ZodString;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
error: z.ZodObject<{
|
|
123
|
+
message: z.ZodString;
|
|
124
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
125
|
+
code: z.ZodLiteral<"USER_MANAGEMENT_ERROR">;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/interfaces/schemas/users.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,qBAAqB;;iBAEhC,CAAC;AAMH,eAAO,MAAM,eAAe;;iBAE1B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,wBAAwB;;;;;;;;;;;iBACc,CAAC;AAEpD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,kBAAkB;;;;;iBAG7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;iBACc,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,wBAAwB;;;;;;;;;;;iBACc,CAAC;AAEpD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAIlC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAIlC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;iBAIpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;iBAIpC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* User Management Endpoint Schemas (PRD #380 Task 2.5)
|
|
4
|
+
*
|
|
5
|
+
* Schemas for the /api/v1/users endpoints.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.UserManagementErrorSchema = exports.UserBadRequestErrorSchema = exports.UserNotFoundErrorSchema = exports.UserConflictErrorSchema = exports.UserDeleteResponseSchema = exports.UserDeleteDataSchema = exports.UserListResponseSchema = exports.UserListDataSchema = exports.UserCreateResponseSchema = exports.UserCreateDataSchema = exports.UserEntrySchema = exports.UserEmailParamsSchema = exports.UserCreateRequestSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const common_1 = require("./common");
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Request schemas
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
exports.UserCreateRequestSchema = zod_1.z.object({
|
|
15
|
+
email: zod_1.z.string().email().describe('User email address'),
|
|
16
|
+
password: zod_1.z.string().min(8).describe('User password (minimum 8 characters)'),
|
|
17
|
+
});
|
|
18
|
+
exports.UserEmailParamsSchema = zod_1.z.object({
|
|
19
|
+
email: zod_1.z.string().describe('User email address'),
|
|
20
|
+
});
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// Response data schemas
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
exports.UserEntrySchema = zod_1.z.object({
|
|
25
|
+
email: zod_1.z.string().email().describe('User email address'),
|
|
26
|
+
});
|
|
27
|
+
exports.UserCreateDataSchema = zod_1.z.object({
|
|
28
|
+
email: zod_1.z.string().email().describe('Created user email'),
|
|
29
|
+
message: zod_1.z.string().describe('Result message'),
|
|
30
|
+
});
|
|
31
|
+
exports.UserCreateResponseSchema = (0, common_1.createSuccessResponseSchema)(exports.UserCreateDataSchema);
|
|
32
|
+
exports.UserListDataSchema = zod_1.z.object({
|
|
33
|
+
users: zod_1.z.array(exports.UserEntrySchema).describe('List of users'),
|
|
34
|
+
total: zod_1.z.number().describe('Total number of users'),
|
|
35
|
+
});
|
|
36
|
+
exports.UserListResponseSchema = (0, common_1.createSuccessResponseSchema)(exports.UserListDataSchema);
|
|
37
|
+
exports.UserDeleteDataSchema = zod_1.z.object({
|
|
38
|
+
email: zod_1.z.string().email().describe('Deleted user email'),
|
|
39
|
+
message: zod_1.z.string().describe('Result message'),
|
|
40
|
+
});
|
|
41
|
+
exports.UserDeleteResponseSchema = (0, common_1.createSuccessResponseSchema)(exports.UserDeleteDataSchema);
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Error schemas
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
exports.UserConflictErrorSchema = common_1.ErrorResponseSchema.extend({
|
|
46
|
+
error: common_1.ErrorDetailsSchema.extend({
|
|
47
|
+
code: zod_1.z.literal('USER_CONFLICT'),
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
exports.UserNotFoundErrorSchema = common_1.ErrorResponseSchema.extend({
|
|
51
|
+
error: common_1.ErrorDetailsSchema.extend({
|
|
52
|
+
code: zod_1.z.literal('USER_NOT_FOUND'),
|
|
53
|
+
}),
|
|
54
|
+
});
|
|
55
|
+
exports.UserBadRequestErrorSchema = common_1.ErrorResponseSchema.extend({
|
|
56
|
+
error: common_1.ErrorDetailsSchema.extend({
|
|
57
|
+
code: zod_1.z.literal('INVALID_REQUEST'),
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
60
|
+
exports.UserManagementErrorSchema = common_1.InternalServerErrorSchema.extend({
|
|
61
|
+
error: common_1.ErrorDetailsSchema.extend({
|
|
62
|
+
code: zod_1.z.literal('USER_MANAGEMENT_ERROR'),
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
@@ -67,7 +67,7 @@ export interface ExecutionChoice {
|
|
|
67
67
|
risk?: 'low' | 'medium' | 'high';
|
|
68
68
|
}
|
|
69
69
|
export interface RemediateOutput {
|
|
70
|
-
status: 'success' | 'failed' | 'awaiting_user_approval';
|
|
70
|
+
status: 'success' | 'failed' | 'awaiting_user_approval' | 'partially_resolved';
|
|
71
71
|
sessionId: string;
|
|
72
72
|
investigation: {
|
|
73
73
|
iterations: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remediate.d.ts","sourceRoot":"","sources":["../../src/tools/remediate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAA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AG,MAAM,CAAC;KACjC,CAAC;IACF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,GACjB,uBAAuB,CAyHzB;AAqcD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAgOhC"}
|
package/dist/tools/remediate.js
CHANGED
|
@@ -547,35 +547,48 @@ ${executedCommands.map((cmd, i) => `${i + 1}. ${cmd}`).join('\n')}
|
|
|
547
547
|
Validation task: ${validationIntent}
|
|
548
548
|
|
|
549
549
|
IMPORTANT: You MUST respond with the final JSON analysis format as specified in your instructions. Verify the remediation was successful and return your analysis as JSON with issueStatus set to "resolved" if fixed, or "active" if issues remain.`;
|
|
550
|
-
|
|
550
|
+
// Run validation via conductInvestigation() directly (not handleRemediateTool)
|
|
551
|
+
// to avoid creating a new session with mode:'manual' which always returns awaiting_user_approval
|
|
552
|
+
const validationSession = sessionManager.createSession({
|
|
553
|
+
toolName: 'remediate',
|
|
551
554
|
issue: validationIssue,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
555
|
+
mode: session.data.mode,
|
|
556
|
+
status: 'investigating',
|
|
557
|
+
interaction_id: currentInteractionId || session.data.interaction_id,
|
|
558
|
+
});
|
|
559
|
+
const validationAiProvider = (0, ai_provider_factory_1.createAIProvider)();
|
|
560
|
+
const validationOutput = await conductInvestigation(validationSession, sessionManager, validationAiProvider, logger, requestId, true, // isValidation
|
|
561
|
+
currentInteractionId || session.data.interaction_id);
|
|
562
|
+
const validationResolved = validationOutput.status === 'success';
|
|
563
|
+
// If validation discovered remaining issues, enhance with execution context
|
|
564
|
+
if (!validationResolved) {
|
|
565
|
+
logger.info('Validation discovered remaining issues, enhancing response with execution context', {
|
|
561
566
|
requestId,
|
|
562
567
|
sessionId: session.sessionId,
|
|
563
|
-
|
|
568
|
+
validationStatus: validationOutput.status,
|
|
569
|
+
newIssueConfidence: validationOutput.analysis?.confidence,
|
|
564
570
|
});
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
571
|
+
const enhancedResponse = {
|
|
572
|
+
...validationOutput,
|
|
573
|
+
status: 'partially_resolved',
|
|
574
|
+
executed: true,
|
|
575
|
+
results: results,
|
|
576
|
+
executedCommands: results.map(r => r.action),
|
|
577
|
+
previousExecution: {
|
|
578
|
+
sessionId: session.sessionId,
|
|
579
|
+
summary: `Previously executed ${results.length} remediation actions`,
|
|
580
|
+
actions: finalAnalysis.remediation.actions,
|
|
581
|
+
},
|
|
582
|
+
validation: {
|
|
583
|
+
success: false,
|
|
584
|
+
summary: 'Validation found remaining issues after remediation',
|
|
585
|
+
},
|
|
573
586
|
};
|
|
574
587
|
return {
|
|
575
588
|
content: [
|
|
576
589
|
{
|
|
577
590
|
type: 'text',
|
|
578
|
-
text: JSON.stringify(
|
|
591
|
+
text: JSON.stringify(enhancedResponse, null, 2),
|
|
579
592
|
},
|
|
580
593
|
],
|
|
581
594
|
};
|
|
@@ -584,23 +597,22 @@ IMPORTANT: You MUST respond with the final JSON analysis format as specified in
|
|
|
584
597
|
logger.info('Validation confirmed issue is resolved, creating success response', {
|
|
585
598
|
requestId,
|
|
586
599
|
sessionId: session.sessionId,
|
|
587
|
-
validationStatus:
|
|
600
|
+
validationStatus: validationOutput.status,
|
|
588
601
|
});
|
|
589
|
-
// Create success response with execution context
|
|
590
602
|
const successResponse = {
|
|
591
603
|
status: 'success',
|
|
592
604
|
sessionId: session.sessionId,
|
|
593
605
|
executed: true,
|
|
594
606
|
results: results,
|
|
595
607
|
executedCommands: results.map(r => r.action),
|
|
596
|
-
analysis:
|
|
608
|
+
analysis: validationOutput.analysis,
|
|
597
609
|
remediation: {
|
|
598
|
-
summary: `Successfully executed ${results.length} remediation actions. ${
|
|
610
|
+
summary: `Successfully executed ${results.length} remediation actions. ${validationOutput.remediation?.summary || 'Issue resolved.'}`,
|
|
599
611
|
actions: finalAnalysis.remediation.actions,
|
|
600
612
|
risk: finalAnalysis.remediation.risk,
|
|
601
613
|
},
|
|
602
|
-
investigation:
|
|
603
|
-
validationIntent:
|
|
614
|
+
investigation: validationOutput.investigation,
|
|
615
|
+
validationIntent: validationOutput.validationIntent,
|
|
604
616
|
guidance: `✅ REMEDIATION COMPLETE: Issue has been successfully resolved through executed commands.`,
|
|
605
617
|
agentInstructions: `1. Show user that the issue has been successfully resolved\n2. Display the actual kubectl commands that were executed (from remediation.actions[].command field)\n3. Show execution results with success/failure status for each command\n4. Show the validation results confirming the fix worked\n5. No further action required`,
|
|
606
618
|
message: `Issue successfully resolved. Executed ${results.length} remediation actions and validated the fix.`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAOhD,OAAO,EAAuB,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAOhD,OAAO,EAAuB,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAInF,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,wBAAwB,oDAAoD,CAAC;AAC1F,eAAO,MAAM,yBAAyB;;CAErC,CAAC;AAEF,MAAM,WAAW,WA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,OAAO,CAAC,mBAAmB,CAAC,CAuI9B"}
|
package/dist/tools/version.js
CHANGED
|
@@ -57,6 +57,7 @@ const config_1 = require("../core/tracing/config");
|
|
|
57
57
|
const generic_session_manager_1 = require("../core/generic-session-manager");
|
|
58
58
|
const visualization_1 = require("../core/visualization");
|
|
59
59
|
const plugin_registry_1 = require("../core/plugin-registry");
|
|
60
|
+
const request_context_1 = require("../interfaces/request-context");
|
|
60
61
|
exports.VERSION_TOOL_NAME = 'version';
|
|
61
62
|
exports.VERSION_TOOL_DESCRIPTION = 'Get comprehensive system health and diagnostics';
|
|
62
63
|
exports.VERSION_TOOL_INPUT_SCHEMA = {
|
|
@@ -727,9 +728,12 @@ async function handleVersionTool(args, logger, requestId) {
|
|
|
727
728
|
});
|
|
728
729
|
// PRD #320: Generate visualization URL if configured
|
|
729
730
|
const visualizationUrl = (0, visualization_1.getVisualizationUrl)(session.sessionId);
|
|
731
|
+
// PRD #380: Include authenticated user identity in output
|
|
732
|
+
const identity = (0, request_context_1.getCurrentIdentity)();
|
|
730
733
|
// Build response with optional visualization URL in JSON
|
|
731
734
|
const responseData = {
|
|
732
735
|
status: 'success',
|
|
736
|
+
...(identity ? { identity } : {}),
|
|
733
737
|
system: systemStatus,
|
|
734
738
|
summary,
|
|
735
739
|
timestamp,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
|
|
5
5
|
"mcpName": "io.github.vfarcic/dot-ai",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"clean": "rm -rf dist",
|
|
36
36
|
"prebuild": "npm run clean && npm run lint",
|
|
37
37
|
"build": "tsc --sourceMap false",
|
|
38
|
-
"postbuild": "chmod +x dist/mcp/server.js",
|
|
38
|
+
"postbuild": "chmod +x dist/mcp/server.js && cp src/interfaces/oauth/dex-api.proto dist/interfaces/oauth/",
|
|
39
39
|
"build:prod": "npm run clean && tsc --sourceMap false --removeComments true",
|
|
40
40
|
"build:dev": "tsc --sourceMap true",
|
|
41
41
|
"build:watch": "tsc --watch",
|
|
@@ -86,6 +86,8 @@
|
|
|
86
86
|
],
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@eslint/js": "^10.0.0",
|
|
89
|
+
"@types/bcryptjs": "^2.4.6",
|
|
90
|
+
"@types/express": "^5.0.6",
|
|
89
91
|
"@types/glob": "^9.0.0",
|
|
90
92
|
"@types/handlebars": "^4.0.40",
|
|
91
93
|
"@types/node": "^22.0.0",
|
|
@@ -109,6 +111,8 @@
|
|
|
109
111
|
"@ai-sdk/google": "^2.0.17",
|
|
110
112
|
"@ai-sdk/openai": "^2.0.42",
|
|
111
113
|
"@ai-sdk/xai": "^2.0.26",
|
|
114
|
+
"@grpc/grpc-js": "^1.14.3",
|
|
115
|
+
"@grpc/proto-loader": "^0.8.0",
|
|
112
116
|
"@kubernetes/client-node": "^1.3.0",
|
|
113
117
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
114
118
|
"@openrouter/ai-sdk-provider": "^1.2.0",
|
|
@@ -120,6 +124,7 @@
|
|
|
120
124
|
"@opentelemetry/semantic-conventions": "^1.37.0",
|
|
121
125
|
"@qdrant/js-client-rest": "^1.15.0",
|
|
122
126
|
"ai": "^5.0.60",
|
|
127
|
+
"bcryptjs": "^3.0.3",
|
|
123
128
|
"handlebars": "^4.7.8",
|
|
124
129
|
"mermaid": "^10.9.5",
|
|
125
130
|
"posthog-node": "^5.23.0",
|
|
@@ -126,6 +126,16 @@ For documentation-first PRDs:
|
|
|
126
126
|
|
|
127
127
|
**⚠️ MANDATORY: Complete this step BEFORE proceeding to Step 4**
|
|
128
128
|
|
|
129
|
+
### Issue Assignment
|
|
130
|
+
|
|
131
|
+
**Assign the GitHub issue to yourself to signal that work is in progress:**
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
gh issue edit [issue-id] --add-assignee @me
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
This prevents others from picking up the same PRD and working on it in parallel.
|
|
138
|
+
|
|
129
139
|
### Git Branch Management
|
|
130
140
|
|
|
131
141
|
1. **Check current branch**: Run `git branch --show-current`
|
|
@@ -146,6 +156,7 @@ For documentation-first PRDs:
|
|
|
146
156
|
|
|
147
157
|
```markdown
|
|
148
158
|
## Environment Setup ✅
|
|
159
|
+
- **Assignee**: @[username] ✅
|
|
149
160
|
- **Branch**: `[current-branch-name]` ✅
|
|
150
161
|
- **Status**: [Created new branch / Already on correct branch / Staying on main (reason)]
|
|
151
162
|
```
|
|
@@ -160,6 +171,7 @@ Once the implementation context is set up, present this message to the user:
|
|
|
160
171
|
## Ready for Implementation 🚀
|
|
161
172
|
|
|
162
173
|
**PRD**: [PRD Name] (#[PRD Number])
|
|
174
|
+
**Assignee**: @[username]
|
|
163
175
|
**Branch**: `[branch-name]`
|
|
164
176
|
**Status**: Ready for development
|
|
165
177
|
|
|
@@ -181,6 +193,7 @@ To identify and start working on your first task, run `/prd-next`.
|
|
|
181
193
|
This command should:
|
|
182
194
|
- ✅ Successfully identify the target PRD for implementation
|
|
183
195
|
- ✅ Validate that the PRD is ready for development work
|
|
196
|
+
- ✅ Assign the GitHub issue to the current user to prevent duplicate work
|
|
184
197
|
- ✅ Set up proper implementation context (branch, environment)
|
|
185
198
|
- ✅ Hand off to `/prd-next` for task identification
|
|
186
199
|
- ✅ Bridge the gap between PRD planning and development setup
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authentication module for HTTP transport
|
|
3
|
-
*
|
|
4
|
-
* Provides Bearer token authentication for the MCP HTTP server.
|
|
5
|
-
* Authentication is optional and only enabled when DOT_AI_AUTH_TOKEN is set.
|
|
6
|
-
*/
|
|
7
|
-
import { IncomingMessage } from 'node:http';
|
|
8
|
-
export interface AuthResult {
|
|
9
|
-
authorized: boolean;
|
|
10
|
-
message?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Check Bearer token authentication for HTTP requests.
|
|
14
|
-
*
|
|
15
|
-
* Authentication is only required when DOT_AI_AUTH_TOKEN environment variable is set.
|
|
16
|
-
* Uses constant-time comparison to prevent timing attacks.
|
|
17
|
-
*
|
|
18
|
-
* @param req - The incoming HTTP request
|
|
19
|
-
* @returns AuthResult indicating if request is authorized
|
|
20
|
-
*/
|
|
21
|
-
export declare function checkBearerAuth(req: IncomingMessage): AuthResult;
|
|
22
|
-
/**
|
|
23
|
-
* Check if authentication is enabled (DOT_AI_AUTH_TOKEN is set)
|
|
24
|
-
*/
|
|
25
|
-
export declare function isAuthEnabled(): boolean;
|
|
26
|
-
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/interfaces/auth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG5C,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,UAAU,CAoEhE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC"}
|
package/dist/interfaces/auth.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Authentication module for HTTP transport
|
|
4
|
-
*
|
|
5
|
-
* Provides Bearer token authentication for the MCP HTTP server.
|
|
6
|
-
* Authentication is optional and only enabled when DOT_AI_AUTH_TOKEN is set.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.checkBearerAuth = checkBearerAuth;
|
|
10
|
-
exports.isAuthEnabled = isAuthEnabled;
|
|
11
|
-
const node_crypto_1 = require("node:crypto");
|
|
12
|
-
/**
|
|
13
|
-
* Check Bearer token authentication for HTTP requests.
|
|
14
|
-
*
|
|
15
|
-
* Authentication is only required when DOT_AI_AUTH_TOKEN environment variable is set.
|
|
16
|
-
* Uses constant-time comparison to prevent timing attacks.
|
|
17
|
-
*
|
|
18
|
-
* @param req - The incoming HTTP request
|
|
19
|
-
* @returns AuthResult indicating if request is authorized
|
|
20
|
-
*/
|
|
21
|
-
function checkBearerAuth(req) {
|
|
22
|
-
const configuredToken = process.env.DOT_AI_AUTH_TOKEN;
|
|
23
|
-
// If no token configured, authentication is disabled (backward compatible)
|
|
24
|
-
if (!configuredToken) {
|
|
25
|
-
return { authorized: true };
|
|
26
|
-
}
|
|
27
|
-
const rawAuthHeader = req.headers['authorization'];
|
|
28
|
-
// Check if Authorization header is present
|
|
29
|
-
if (!rawAuthHeader) {
|
|
30
|
-
return {
|
|
31
|
-
authorized: false,
|
|
32
|
-
message: 'Authentication required. Provide Authorization: Bearer <token> header.'
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
// Normalize header to string (handle array case)
|
|
36
|
-
const authHeader = Array.isArray(rawAuthHeader)
|
|
37
|
-
? (rawAuthHeader[0] ?? '')
|
|
38
|
-
: rawAuthHeader;
|
|
39
|
-
// Parse Bearer token (case-insensitive per RFC 7235)
|
|
40
|
-
// Use split instead of regex to avoid ReDoS vulnerability
|
|
41
|
-
const trimmedHeader = authHeader.trim();
|
|
42
|
-
const spaceIndex = trimmedHeader.indexOf(' ');
|
|
43
|
-
if (spaceIndex === -1) {
|
|
44
|
-
return {
|
|
45
|
-
authorized: false,
|
|
46
|
-
message: 'Invalid authorization format. Expected: Bearer <token>'
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const scheme = trimmedHeader.slice(0, spaceIndex);
|
|
50
|
-
const providedToken = trimmedHeader.slice(spaceIndex + 1).trim();
|
|
51
|
-
// Validate Bearer scheme (case-insensitive)
|
|
52
|
-
if (scheme.toLowerCase() !== 'bearer') {
|
|
53
|
-
return {
|
|
54
|
-
authorized: false,
|
|
55
|
-
message: 'Invalid authorization format. Expected: Bearer <token>'
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
// Check if token is empty
|
|
59
|
-
if (!providedToken) {
|
|
60
|
-
return { authorized: false, message: 'Bearer token is empty.' };
|
|
61
|
-
}
|
|
62
|
-
// Use constant-time comparison to prevent timing attacks
|
|
63
|
-
// Both buffers must be same length for timingSafeEqual
|
|
64
|
-
const configuredBuffer = Buffer.from(configuredToken, 'utf8');
|
|
65
|
-
const providedBuffer = Buffer.from(providedToken, 'utf8');
|
|
66
|
-
// If lengths differ, tokens don't match (but still do constant-time operation to avoid timing leak)
|
|
67
|
-
if (configuredBuffer.length !== providedBuffer.length) {
|
|
68
|
-
// Perform a dummy comparison to maintain constant time
|
|
69
|
-
(0, node_crypto_1.timingSafeEqual)(configuredBuffer, configuredBuffer);
|
|
70
|
-
return { authorized: false, message: 'Invalid authentication token.' };
|
|
71
|
-
}
|
|
72
|
-
if (!(0, node_crypto_1.timingSafeEqual)(configuredBuffer, providedBuffer)) {
|
|
73
|
-
return { authorized: false, message: 'Invalid authentication token.' };
|
|
74
|
-
}
|
|
75
|
-
return { authorized: true };
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Check if authentication is enabled (DOT_AI_AUTH_TOKEN is set)
|
|
79
|
-
*/
|
|
80
|
-
function isAuthEnabled() {
|
|
81
|
-
return !!process.env.DOT_AI_AUTH_TOKEN;
|
|
82
|
-
}
|