@structured-world/gitlab-mcp 7.7.0 → 9.0.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 +6 -6
- package/dist/src/cli/install/installers.js +9 -195
- package/dist/src/cli/install/installers.js.map +1 -1
- package/dist/src/cli/list-tools.js +2 -8
- package/dist/src/cli/list-tools.js.map +1 -1
- package/dist/src/cli/setup/presets.js +1 -1
- package/dist/src/cli/setup/presets.js.map +1 -1
- package/dist/src/contracts/storage.d.ts +2 -0
- package/dist/{generated/prisma/enums.js → src/contracts/storage.js} +1 -1
- package/dist/src/contracts/storage.js.map +1 -0
- package/dist/src/entities/access_tokens/registry.d.ts +3 -0
- package/dist/src/entities/access_tokens/registry.js +147 -0
- package/dist/src/entities/access_tokens/registry.js.map +1 -0
- package/dist/src/entities/access_tokens/schema-readonly.d.ts +40 -0
- package/dist/src/entities/access_tokens/schema-readonly.js +60 -0
- package/dist/src/entities/access_tokens/schema-readonly.js.map +1 -0
- package/dist/src/entities/access_tokens/schema.d.ts +28 -0
- package/dist/src/entities/access_tokens/schema.js +68 -0
- package/dist/src/entities/access_tokens/schema.js.map +1 -0
- package/dist/src/entities/audit_events/registry.d.ts +3 -0
- package/dist/src/entities/audit_events/registry.js +93 -0
- package/dist/src/entities/audit_events/registry.js.map +1 -0
- package/dist/src/entities/audit_events/schema-readonly.d.ts +33 -0
- package/dist/src/entities/audit_events/schema-readonly.js +78 -0
- package/dist/src/entities/audit_events/schema-readonly.js.map +1 -0
- package/dist/src/entities/container_registry/registry.js +3 -2
- package/dist/src/entities/container_registry/registry.js.map +1 -1
- package/dist/src/entities/context/whoami.js +2 -1
- package/dist/src/entities/context/whoami.js.map +1 -1
- package/dist/src/entities/core/registry.js +3 -2
- package/dist/src/entities/core/registry.js.map +1 -1
- package/dist/src/entities/pipelines/registry.js +5 -23
- package/dist/src/entities/pipelines/registry.js.map +1 -1
- package/dist/src/entities/pipelines/schema.d.ts +4 -6
- package/dist/src/entities/pipelines/schema.js +9 -11
- package/dist/src/entities/pipelines/schema.js.map +1 -1
- package/dist/src/entities/runners/registry.d.ts +3 -0
- package/dist/src/entities/runners/registry.js +226 -0
- package/dist/src/entities/runners/registry.js.map +1 -0
- package/dist/src/entities/runners/schema-readonly.d.ts +99 -0
- package/dist/src/entities/runners/schema-readonly.js +99 -0
- package/dist/src/entities/runners/schema-readonly.js.map +1 -0
- package/dist/src/entities/runners/schema.d.ts +49 -0
- package/dist/src/entities/runners/schema.js +81 -0
- package/dist/src/entities/runners/schema.js.map +1 -0
- package/dist/src/entities/vulnerabilities/registry.d.ts +3 -0
- package/dist/src/entities/vulnerabilities/registry.js +171 -0
- package/dist/src/entities/vulnerabilities/registry.js.map +1 -0
- package/dist/src/entities/vulnerabilities/schema-readonly.d.ts +48 -0
- package/dist/src/entities/vulnerabilities/schema-readonly.js +77 -0
- package/dist/src/entities/vulnerabilities/schema-readonly.js.map +1 -0
- package/dist/src/entities/vulnerabilities/schema.d.ts +23 -0
- package/dist/src/entities/vulnerabilities/schema.js +43 -0
- package/dist/src/entities/vulnerabilities/schema.js.map +1 -0
- package/dist/src/entities/workitems/registry.js +11 -10
- package/dist/src/entities/workitems/registry.js.map +1 -1
- package/dist/src/graphql/runners.d.ts +162 -0
- package/dist/src/graphql/runners.js +144 -0
- package/dist/src/graphql/runners.js.map +1 -0
- package/dist/src/graphql/vulnerabilities.d.ts +90 -0
- package/dist/src/graphql/vulnerabilities.js +105 -0
- package/dist/src/graphql/vulnerabilities.js.map +1 -0
- package/dist/src/oauth/config.js +4 -4
- package/dist/src/oauth/config.js.map +1 -1
- package/dist/src/oauth/index.d.ts +1 -1
- package/dist/src/oauth/index.js +2 -3
- package/dist/src/oauth/index.js.map +1 -1
- package/dist/src/oauth/storage/factory.js +10 -3
- package/dist/src/oauth/storage/factory.js.map +1 -1
- package/dist/src/oauth/storage/index.d.ts +0 -1
- package/dist/src/oauth/storage/index.js +0 -1
- package/dist/src/oauth/storage/index.js.map +1 -1
- package/dist/src/profiles/applicator.js +4 -4
- package/dist/src/profiles/applicator.js.map +1 -1
- package/dist/src/registry-manager.js +44 -0
- package/dist/src/registry-manager.js.map +1 -1
- package/dist/src/services/TokenScopeDetector.js +7 -1
- package/dist/src/services/TokenScopeDetector.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +73 -36
- package/LICENSE +0 -202
- package/LICENSE.MIT +0 -21
- package/dist/generated/prisma/client.d.ts +0 -13
- package/dist/generated/prisma/client.js +0 -46
- package/dist/generated/prisma/client.js.map +0 -1
- package/dist/generated/prisma/commonInputTypes.d.ts +0 -245
- package/dist/generated/prisma/commonInputTypes.js +0 -3
- package/dist/generated/prisma/commonInputTypes.js.map +0 -1
- package/dist/generated/prisma/enums.d.ts +0 -1
- package/dist/generated/prisma/enums.js.map +0 -1
- package/dist/generated/prisma/internal/class.d.ts +0 -49
- package/dist/generated/prisma/internal/class.js +0 -75
- package/dist/generated/prisma/internal/class.js.map +0 -1
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +0 -715
- package/dist/generated/prisma/internal/prismaNamespace.js +0 -141
- package/dist/generated/prisma/internal/prismaNamespace.js.map +0 -1
- package/dist/generated/prisma/models/AuthCodeFlowState.d.ts +0 -512
- package/dist/generated/prisma/models/AuthCodeFlowState.js +0 -3
- package/dist/generated/prisma/models/AuthCodeFlowState.js.map +0 -1
- package/dist/generated/prisma/models/AuthorizationCode.d.ts +0 -640
- package/dist/generated/prisma/models/AuthorizationCode.js +0 -3
- package/dist/generated/prisma/models/AuthorizationCode.js.map +0 -1
- package/dist/generated/prisma/models/DeviceFlowState.d.ts +0 -602
- package/dist/generated/prisma/models/DeviceFlowState.js +0 -3
- package/dist/generated/prisma/models/DeviceFlowState.js.map +0 -1
- package/dist/generated/prisma/models/McpSessionMapping.d.ts +0 -437
- package/dist/generated/prisma/models/McpSessionMapping.js +0 -3
- package/dist/generated/prisma/models/McpSessionMapping.js.map +0 -1
- package/dist/generated/prisma/models/OAuthSession.d.ts +0 -1036
- package/dist/generated/prisma/models/OAuthSession.js +0 -3
- package/dist/generated/prisma/models/OAuthSession.js.map +0 -1
- package/dist/generated/prisma/models.d.ts +0 -6
- package/dist/generated/prisma/models.js +0 -3
- package/dist/generated/prisma/models.js.map +0 -1
- package/dist/src/oauth/storage/postgresql.d.ts +0 -41
- package/dist/src/oauth/storage/postgresql.js +0 -444
- package/dist/src/oauth/storage/postgresql.js.map +0 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
+
export interface RunnerNode {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string | null;
|
|
5
|
+
runnerType: string;
|
|
6
|
+
status: string | null;
|
|
7
|
+
paused: boolean;
|
|
8
|
+
locked: boolean;
|
|
9
|
+
runUntagged: boolean;
|
|
10
|
+
tagList: string[] | null;
|
|
11
|
+
accessLevel: string | null;
|
|
12
|
+
maximumTimeout: number | null;
|
|
13
|
+
jobExecutionStatus: string | null;
|
|
14
|
+
jobCount: number | null;
|
|
15
|
+
contactedAt: string | null;
|
|
16
|
+
createdAt: string | null;
|
|
17
|
+
}
|
|
18
|
+
interface PageInfo {
|
|
19
|
+
hasNextPage: boolean;
|
|
20
|
+
endCursor: string | null;
|
|
21
|
+
}
|
|
22
|
+
interface RunnerConnection {
|
|
23
|
+
nodes: RunnerNode[];
|
|
24
|
+
pageInfo: PageInfo;
|
|
25
|
+
}
|
|
26
|
+
export interface RunnerListVars {
|
|
27
|
+
type?: string | null;
|
|
28
|
+
status?: string | null;
|
|
29
|
+
paused?: boolean | null;
|
|
30
|
+
tagList?: string[] | null;
|
|
31
|
+
search?: string | null;
|
|
32
|
+
first?: number | null;
|
|
33
|
+
after?: string | null;
|
|
34
|
+
}
|
|
35
|
+
export interface ListRunnersResult {
|
|
36
|
+
runners: RunnerConnection | null;
|
|
37
|
+
}
|
|
38
|
+
export declare const LIST_RUNNERS: TypedDocumentNode<ListRunnersResult, RunnerListVars>;
|
|
39
|
+
export interface ListOwnedRunnersResult {
|
|
40
|
+
currentUser: {
|
|
41
|
+
runners: RunnerConnection | null;
|
|
42
|
+
} | null;
|
|
43
|
+
}
|
|
44
|
+
export declare const LIST_OWNED_RUNNERS: TypedDocumentNode<ListOwnedRunnersResult, RunnerListVars>;
|
|
45
|
+
export interface ListGroupRunnersResult {
|
|
46
|
+
group: {
|
|
47
|
+
runners: RunnerConnection | null;
|
|
48
|
+
} | null;
|
|
49
|
+
}
|
|
50
|
+
export interface ListNamespaceRunnersVars extends RunnerListVars {
|
|
51
|
+
fullPath: string;
|
|
52
|
+
}
|
|
53
|
+
export declare const LIST_GROUP_RUNNERS: TypedDocumentNode<ListGroupRunnersResult, ListNamespaceRunnersVars>;
|
|
54
|
+
export interface ListProjectRunnersResult {
|
|
55
|
+
project: {
|
|
56
|
+
runners: RunnerConnection | null;
|
|
57
|
+
} | null;
|
|
58
|
+
}
|
|
59
|
+
export declare const LIST_PROJECT_RUNNERS: TypedDocumentNode<ListProjectRunnersResult, ListNamespaceRunnersVars>;
|
|
60
|
+
export interface GetRunnerResult {
|
|
61
|
+
runner: RunnerNode | null;
|
|
62
|
+
}
|
|
63
|
+
export interface GetRunnerVars {
|
|
64
|
+
id: string;
|
|
65
|
+
}
|
|
66
|
+
export declare const GET_RUNNER: TypedDocumentNode<GetRunnerResult, GetRunnerVars>;
|
|
67
|
+
export interface RunnerJobNode {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string | null;
|
|
70
|
+
status: string | null;
|
|
71
|
+
createdAt: string | null;
|
|
72
|
+
finishedAt: string | null;
|
|
73
|
+
duration: number | null;
|
|
74
|
+
webPath: string | null;
|
|
75
|
+
}
|
|
76
|
+
export interface ListRunnerJobsResult {
|
|
77
|
+
runner: {
|
|
78
|
+
id: string;
|
|
79
|
+
jobs: {
|
|
80
|
+
nodes: RunnerJobNode[];
|
|
81
|
+
pageInfo: PageInfo;
|
|
82
|
+
} | null;
|
|
83
|
+
} | null;
|
|
84
|
+
}
|
|
85
|
+
export interface ListRunnerJobsVars {
|
|
86
|
+
id: string;
|
|
87
|
+
statuses?: string | null;
|
|
88
|
+
first?: number | null;
|
|
89
|
+
after?: string | null;
|
|
90
|
+
}
|
|
91
|
+
export declare const LIST_RUNNER_JOBS: TypedDocumentNode<ListRunnerJobsResult, ListRunnerJobsVars>;
|
|
92
|
+
export interface ResolveGroupResult {
|
|
93
|
+
group: {
|
|
94
|
+
id: string;
|
|
95
|
+
} | null;
|
|
96
|
+
}
|
|
97
|
+
export interface ResolveProjectResult {
|
|
98
|
+
project: {
|
|
99
|
+
id: string;
|
|
100
|
+
} | null;
|
|
101
|
+
}
|
|
102
|
+
export interface ResolvePathVars {
|
|
103
|
+
fullPath: string;
|
|
104
|
+
}
|
|
105
|
+
export declare const RESOLVE_GROUP_ID: TypedDocumentNode<ResolveGroupResult, ResolvePathVars>;
|
|
106
|
+
export declare const RESOLVE_PROJECT_ID: TypedDocumentNode<ResolveProjectResult, ResolvePathVars>;
|
|
107
|
+
export interface RunnerCreateResult {
|
|
108
|
+
runnerCreate: {
|
|
109
|
+
runner: (RunnerNode & {
|
|
110
|
+
ephemeralAuthenticationToken: string | null;
|
|
111
|
+
}) | null;
|
|
112
|
+
errors: string[];
|
|
113
|
+
} | null;
|
|
114
|
+
}
|
|
115
|
+
export interface RunnerCreateVars {
|
|
116
|
+
input: {
|
|
117
|
+
runnerType: string;
|
|
118
|
+
groupId?: string | null;
|
|
119
|
+
projectId?: string | null;
|
|
120
|
+
description?: string | null;
|
|
121
|
+
paused?: boolean | null;
|
|
122
|
+
locked?: boolean | null;
|
|
123
|
+
runUntagged?: boolean | null;
|
|
124
|
+
tagList?: string[] | null;
|
|
125
|
+
accessLevel?: string | null;
|
|
126
|
+
maximumTimeout?: number | null;
|
|
127
|
+
maintenanceNote?: string | null;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export declare const RUNNER_CREATE: TypedDocumentNode<RunnerCreateResult, RunnerCreateVars>;
|
|
131
|
+
export interface RunnerUpdateResult {
|
|
132
|
+
runnerUpdate: {
|
|
133
|
+
runner: RunnerNode | null;
|
|
134
|
+
errors: string[];
|
|
135
|
+
} | null;
|
|
136
|
+
}
|
|
137
|
+
export interface RunnerUpdateVars {
|
|
138
|
+
input: {
|
|
139
|
+
id: string;
|
|
140
|
+
description?: string | null;
|
|
141
|
+
paused?: boolean | null;
|
|
142
|
+
locked?: boolean | null;
|
|
143
|
+
runUntagged?: boolean | null;
|
|
144
|
+
tagList?: string[] | null;
|
|
145
|
+
accessLevel?: string | null;
|
|
146
|
+
maximumTimeout?: number | null;
|
|
147
|
+
maintenanceNote?: string | null;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export declare const RUNNER_UPDATE: TypedDocumentNode<RunnerUpdateResult, RunnerUpdateVars>;
|
|
151
|
+
export interface RunnerDeleteResult {
|
|
152
|
+
runnerDelete: {
|
|
153
|
+
errors: string[];
|
|
154
|
+
} | null;
|
|
155
|
+
}
|
|
156
|
+
export interface RunnerDeleteVars {
|
|
157
|
+
input: {
|
|
158
|
+
id: string;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export declare const RUNNER_DELETE: TypedDocumentNode<RunnerDeleteResult, RunnerDeleteVars>;
|
|
162
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RUNNER_DELETE = exports.RUNNER_UPDATE = exports.RUNNER_CREATE = exports.RESOLVE_PROJECT_ID = exports.RESOLVE_GROUP_ID = exports.LIST_RUNNER_JOBS = exports.GET_RUNNER = exports.LIST_PROJECT_RUNNERS = exports.LIST_GROUP_RUNNERS = exports.LIST_OWNED_RUNNERS = exports.LIST_RUNNERS = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
const RUNNER_FIELDS = `
|
|
6
|
+
id
|
|
7
|
+
description
|
|
8
|
+
runnerType
|
|
9
|
+
status
|
|
10
|
+
paused
|
|
11
|
+
locked
|
|
12
|
+
runUntagged
|
|
13
|
+
tagList
|
|
14
|
+
accessLevel
|
|
15
|
+
maximumTimeout
|
|
16
|
+
jobExecutionStatus
|
|
17
|
+
jobCount
|
|
18
|
+
contactedAt
|
|
19
|
+
createdAt
|
|
20
|
+
`;
|
|
21
|
+
const LIST_ARG_DECLS = `
|
|
22
|
+
$type: CiRunnerType
|
|
23
|
+
$status: CiRunnerStatus
|
|
24
|
+
$paused: Boolean
|
|
25
|
+
$tagList: [String!]
|
|
26
|
+
$search: String
|
|
27
|
+
$first: Int
|
|
28
|
+
$after: String
|
|
29
|
+
`;
|
|
30
|
+
const LIST_ARG_USE = `
|
|
31
|
+
type: $type
|
|
32
|
+
status: $status
|
|
33
|
+
paused: $paused
|
|
34
|
+
tagList: $tagList
|
|
35
|
+
search: $search
|
|
36
|
+
first: $first
|
|
37
|
+
after: $after
|
|
38
|
+
`;
|
|
39
|
+
exports.LIST_RUNNERS = (0, graphql_tag_1.gql) `
|
|
40
|
+
query ListRunners(${LIST_ARG_DECLS}) {
|
|
41
|
+
runners(${LIST_ARG_USE}) {
|
|
42
|
+
nodes { ${RUNNER_FIELDS} }
|
|
43
|
+
pageInfo { hasNextPage endCursor }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
exports.LIST_OWNED_RUNNERS = (0, graphql_tag_1.gql) `
|
|
48
|
+
query ListOwnedRunners(${LIST_ARG_DECLS}) {
|
|
49
|
+
currentUser {
|
|
50
|
+
runners(${LIST_ARG_USE}) {
|
|
51
|
+
nodes { ${RUNNER_FIELDS} }
|
|
52
|
+
pageInfo { hasNextPage endCursor }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
exports.LIST_GROUP_RUNNERS = (0, graphql_tag_1.gql) `
|
|
58
|
+
query ListGroupRunners($fullPath: ID!, ${LIST_ARG_DECLS}) {
|
|
59
|
+
group(fullPath: $fullPath) {
|
|
60
|
+
runners(${LIST_ARG_USE}) {
|
|
61
|
+
nodes { ${RUNNER_FIELDS} }
|
|
62
|
+
pageInfo { hasNextPage endCursor }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
exports.LIST_PROJECT_RUNNERS = (0, graphql_tag_1.gql) `
|
|
68
|
+
query ListProjectRunners($fullPath: ID!, ${LIST_ARG_DECLS}) {
|
|
69
|
+
project(fullPath: $fullPath) {
|
|
70
|
+
runners(${LIST_ARG_USE}) {
|
|
71
|
+
nodes { ${RUNNER_FIELDS} }
|
|
72
|
+
pageInfo { hasNextPage endCursor }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
exports.GET_RUNNER = (0, graphql_tag_1.gql) `
|
|
78
|
+
query GetRunner($id: CiRunnerID!) {
|
|
79
|
+
runner(id: $id) { ${RUNNER_FIELDS} }
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
exports.LIST_RUNNER_JOBS = (0, graphql_tag_1.gql) `
|
|
83
|
+
query ListRunnerJobs($id: CiRunnerID!, $statuses: CiJobStatus, $first: Int, $after: String) {
|
|
84
|
+
runner(id: $id) {
|
|
85
|
+
id
|
|
86
|
+
jobs(statuses: $statuses, first: $first, after: $after) {
|
|
87
|
+
nodes {
|
|
88
|
+
id
|
|
89
|
+
name
|
|
90
|
+
status
|
|
91
|
+
createdAt
|
|
92
|
+
finishedAt
|
|
93
|
+
duration
|
|
94
|
+
webPath
|
|
95
|
+
}
|
|
96
|
+
pageInfo {
|
|
97
|
+
hasNextPage
|
|
98
|
+
endCursor
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
104
|
+
exports.RESOLVE_GROUP_ID = (0, graphql_tag_1.gql) `
|
|
105
|
+
query ResolveGroupId($fullPath: ID!) {
|
|
106
|
+
group(fullPath: $fullPath) {
|
|
107
|
+
id
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
exports.RESOLVE_PROJECT_ID = (0, graphql_tag_1.gql) `
|
|
112
|
+
query ResolveProjectId($fullPath: ID!) {
|
|
113
|
+
project(fullPath: $fullPath) {
|
|
114
|
+
id
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
exports.RUNNER_CREATE = (0, graphql_tag_1.gql) `
|
|
119
|
+
mutation RunnerCreate($input: RunnerCreateInput!) {
|
|
120
|
+
runnerCreate(input: $input) {
|
|
121
|
+
runner {
|
|
122
|
+
${RUNNER_FIELDS}
|
|
123
|
+
ephemeralAuthenticationToken
|
|
124
|
+
}
|
|
125
|
+
errors
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
exports.RUNNER_UPDATE = (0, graphql_tag_1.gql) `
|
|
130
|
+
mutation RunnerUpdate($input: RunnerUpdateInput!) {
|
|
131
|
+
runnerUpdate(input: $input) {
|
|
132
|
+
runner { ${RUNNER_FIELDS} }
|
|
133
|
+
errors
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
`;
|
|
137
|
+
exports.RUNNER_DELETE = (0, graphql_tag_1.gql) `
|
|
138
|
+
mutation RunnerDelete($input: RunnerDeleteInput!) {
|
|
139
|
+
runnerDelete(input: $input) {
|
|
140
|
+
errors
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
`;
|
|
144
|
+
//# sourceMappingURL=runners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runners.js","sourceRoot":"","sources":["../../../src/graphql/runners.ts"],"names":[],"mappings":";;;AAAA,6CAAkC;AAiBlC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;CAerB,CAAC;AAuCF,MAAM,cAAc,GAAG;;;;;;;;CAQtB,CAAC;AACF,MAAM,YAAY,GAAG;;;;;;;;CAQpB,CAAC;AAMW,QAAA,YAAY,GAAyD,IAAA,iBAAG,EAAA;sBAC/D,cAAc;cACtB,YAAY;gBACV,aAAa;;;;CAI5B,CAAC;AAMW,QAAA,kBAAkB,GAA8D,IAAA,iBAAG,EAAA;2BACrE,cAAc;;gBAEzB,YAAY;kBACV,aAAa;;;;;CAK9B,CAAC;AASW,QAAA,kBAAkB,GAG3B,IAAA,iBAAG,EAAA;2CACoC,cAAc;;gBAEzC,YAAY;kBACV,aAAa;;;;;CAK9B,CAAC;AAMW,QAAA,oBAAoB,GAG7B,IAAA,iBAAG,EAAA;6CACsC,cAAc;;gBAE3C,YAAY;kBACV,aAAa;;;;;CAK9B,CAAC;AASW,QAAA,UAAU,GAAsD,IAAA,iBAAG,EAAA;;wBAExD,aAAa;;CAEpC,CAAC;AAwBW,QAAA,gBAAgB,GAAgE,IAAA,iBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;CAqB/F,CAAC;AAaW,QAAA,gBAAgB,GAA2D,IAAA,iBAAG,EAAA;;;;;;CAM1F,CAAC;AACW,QAAA,kBAAkB,GAA6D,IAAA,iBAAG,EAAA;;;;;;CAM9F,CAAC;AAwBW,QAAA,aAAa,GAA4D,IAAA,iBAAG,EAAA;;;;UAI/E,aAAa;;;;;;CAMtB,CAAC;AAmBW,QAAA,aAAa,GAA4D,IAAA,iBAAG,EAAA;;;iBAGxE,aAAa;;;;CAI7B,CAAC;AASW,QAAA,aAAa,GAA4D,IAAA,iBAAG,EAAA;;;;;;CAMxF,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
+
export interface VulnerabilityNode {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string | null;
|
|
5
|
+
description: string | null;
|
|
6
|
+
state: string | null;
|
|
7
|
+
severity: string | null;
|
|
8
|
+
reportType: string | null;
|
|
9
|
+
resolvedOnDefaultBranch: boolean | null;
|
|
10
|
+
detectedAt: string | null;
|
|
11
|
+
confirmedAt: string | null;
|
|
12
|
+
resolvedAt: string | null;
|
|
13
|
+
dismissedAt: string | null;
|
|
14
|
+
vulnerabilityPath: string | null;
|
|
15
|
+
webUrl: string | null;
|
|
16
|
+
}
|
|
17
|
+
interface PageInfo {
|
|
18
|
+
hasNextPage: boolean;
|
|
19
|
+
endCursor: string | null;
|
|
20
|
+
}
|
|
21
|
+
interface VulnConnection {
|
|
22
|
+
nodes: VulnerabilityNode[];
|
|
23
|
+
pageInfo: PageInfo;
|
|
24
|
+
}
|
|
25
|
+
export interface VulnListVars {
|
|
26
|
+
state?: string[] | null;
|
|
27
|
+
severity?: string[] | null;
|
|
28
|
+
reportType?: string[] | null;
|
|
29
|
+
sort?: string | null;
|
|
30
|
+
first?: number | null;
|
|
31
|
+
after?: string | null;
|
|
32
|
+
}
|
|
33
|
+
export interface ListProjectVulnsResult {
|
|
34
|
+
project: {
|
|
35
|
+
vulnerabilities: VulnConnection | null;
|
|
36
|
+
} | null;
|
|
37
|
+
}
|
|
38
|
+
export interface ListNamespaceVulnsVars extends VulnListVars {
|
|
39
|
+
fullPath: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const LIST_PROJECT_VULNS: TypedDocumentNode<ListProjectVulnsResult, ListNamespaceVulnsVars>;
|
|
42
|
+
export interface ListGroupVulnsResult {
|
|
43
|
+
group: {
|
|
44
|
+
vulnerabilities: VulnConnection | null;
|
|
45
|
+
} | null;
|
|
46
|
+
}
|
|
47
|
+
export declare const LIST_GROUP_VULNS: TypedDocumentNode<ListGroupVulnsResult, ListNamespaceVulnsVars>;
|
|
48
|
+
export interface ListInstanceVulnsResult {
|
|
49
|
+
vulnerabilities: VulnConnection | null;
|
|
50
|
+
}
|
|
51
|
+
export interface ListInstanceVulnsVars extends VulnListVars {
|
|
52
|
+
projectId?: string[] | null;
|
|
53
|
+
}
|
|
54
|
+
export declare const LIST_INSTANCE_VULNS: TypedDocumentNode<ListInstanceVulnsResult, ListInstanceVulnsVars>;
|
|
55
|
+
export interface GetVulnResult {
|
|
56
|
+
vulnerability: VulnerabilityNode | null;
|
|
57
|
+
}
|
|
58
|
+
export interface GetVulnVars {
|
|
59
|
+
id: string;
|
|
60
|
+
}
|
|
61
|
+
export declare const GET_VULN: TypedDocumentNode<GetVulnResult, GetVulnVars>;
|
|
62
|
+
interface VulnMutationPayload {
|
|
63
|
+
vulnerability: VulnerabilityNode | null;
|
|
64
|
+
errors: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface DismissVulnResult {
|
|
67
|
+
vulnerabilityDismiss: VulnMutationPayload | null;
|
|
68
|
+
}
|
|
69
|
+
export interface DismissVulnVars {
|
|
70
|
+
id: string;
|
|
71
|
+
comment?: string | null;
|
|
72
|
+
dismissalReason?: string | null;
|
|
73
|
+
}
|
|
74
|
+
export declare const DISMISS_VULN: TypedDocumentNode<DismissVulnResult, DismissVulnVars>;
|
|
75
|
+
export interface ConfirmVulnResult {
|
|
76
|
+
vulnerabilityConfirm: VulnMutationPayload | null;
|
|
77
|
+
}
|
|
78
|
+
export interface VulnIdVars {
|
|
79
|
+
id: string;
|
|
80
|
+
}
|
|
81
|
+
export declare const CONFIRM_VULN: TypedDocumentNode<ConfirmVulnResult, VulnIdVars>;
|
|
82
|
+
export interface ResolveVulnResult {
|
|
83
|
+
vulnerabilityResolve: VulnMutationPayload | null;
|
|
84
|
+
}
|
|
85
|
+
export declare const RESOLVE_VULN: TypedDocumentNode<ResolveVulnResult, VulnIdVars>;
|
|
86
|
+
export interface RevertVulnResult {
|
|
87
|
+
vulnerabilityRevertToDetected: VulnMutationPayload | null;
|
|
88
|
+
}
|
|
89
|
+
export declare const REVERT_VULN: TypedDocumentNode<RevertVulnResult, VulnIdVars>;
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REVERT_VULN = exports.RESOLVE_VULN = exports.CONFIRM_VULN = exports.DISMISS_VULN = exports.GET_VULN = exports.LIST_INSTANCE_VULNS = exports.LIST_GROUP_VULNS = exports.LIST_PROJECT_VULNS = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
const VULN_FIELDS = `
|
|
6
|
+
id
|
|
7
|
+
title
|
|
8
|
+
description
|
|
9
|
+
state
|
|
10
|
+
severity
|
|
11
|
+
reportType
|
|
12
|
+
resolvedOnDefaultBranch
|
|
13
|
+
detectedAt
|
|
14
|
+
confirmedAt
|
|
15
|
+
resolvedAt
|
|
16
|
+
dismissedAt
|
|
17
|
+
vulnerabilityPath
|
|
18
|
+
webUrl
|
|
19
|
+
`;
|
|
20
|
+
const LIST_ARG_DECLS = `
|
|
21
|
+
$state: [VulnerabilityState!]
|
|
22
|
+
$severity: [VulnerabilitySeverity!]
|
|
23
|
+
$reportType: [VulnerabilityReportType!]
|
|
24
|
+
$sort: VulnerabilitySort
|
|
25
|
+
$first: Int
|
|
26
|
+
$after: String
|
|
27
|
+
`;
|
|
28
|
+
const LIST_ARG_USE = `
|
|
29
|
+
state: $state
|
|
30
|
+
severity: $severity
|
|
31
|
+
reportType: $reportType
|
|
32
|
+
sort: $sort
|
|
33
|
+
first: $first
|
|
34
|
+
after: $after
|
|
35
|
+
`;
|
|
36
|
+
exports.LIST_PROJECT_VULNS = (0, graphql_tag_1.gql) `
|
|
37
|
+
query ListProjectVulnerabilities($fullPath: ID!, ${LIST_ARG_DECLS}) {
|
|
38
|
+
project(fullPath: $fullPath) {
|
|
39
|
+
vulnerabilities(${LIST_ARG_USE}) {
|
|
40
|
+
nodes { ${VULN_FIELDS} }
|
|
41
|
+
pageInfo { hasNextPage endCursor }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
exports.LIST_GROUP_VULNS = (0, graphql_tag_1.gql) `
|
|
47
|
+
query ListGroupVulnerabilities($fullPath: ID!, ${LIST_ARG_DECLS}) {
|
|
48
|
+
group(fullPath: $fullPath) {
|
|
49
|
+
vulnerabilities(${LIST_ARG_USE}) {
|
|
50
|
+
nodes { ${VULN_FIELDS} }
|
|
51
|
+
pageInfo { hasNextPage endCursor }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
exports.LIST_INSTANCE_VULNS = (0, graphql_tag_1.gql) `
|
|
57
|
+
query ListInstanceVulnerabilities($projectId: [ID!], ${LIST_ARG_DECLS}) {
|
|
58
|
+
vulnerabilities(projectId: $projectId, ${LIST_ARG_USE}) {
|
|
59
|
+
nodes { ${VULN_FIELDS} }
|
|
60
|
+
pageInfo { hasNextPage endCursor }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
exports.GET_VULN = (0, graphql_tag_1.gql) `
|
|
65
|
+
query GetVulnerability($id: VulnerabilityID!) {
|
|
66
|
+
vulnerability(id: $id) { ${VULN_FIELDS} }
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
exports.DISMISS_VULN = (0, graphql_tag_1.gql) `
|
|
70
|
+
mutation DismissVulnerability(
|
|
71
|
+
$id: VulnerabilityID!
|
|
72
|
+
$comment: String
|
|
73
|
+
$dismissalReason: VulnerabilityDismissalReason
|
|
74
|
+
) {
|
|
75
|
+
vulnerabilityDismiss(input: { id: $id, comment: $comment, dismissalReason: $dismissalReason }) {
|
|
76
|
+
vulnerability { ${VULN_FIELDS} }
|
|
77
|
+
errors
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
exports.CONFIRM_VULN = (0, graphql_tag_1.gql) `
|
|
82
|
+
mutation ConfirmVulnerability($id: VulnerabilityID!) {
|
|
83
|
+
vulnerabilityConfirm(input: { id: $id }) {
|
|
84
|
+
vulnerability { ${VULN_FIELDS} }
|
|
85
|
+
errors
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
exports.RESOLVE_VULN = (0, graphql_tag_1.gql) `
|
|
90
|
+
mutation ResolveVulnerability($id: VulnerabilityID!) {
|
|
91
|
+
vulnerabilityResolve(input: { id: $id }) {
|
|
92
|
+
vulnerability { ${VULN_FIELDS} }
|
|
93
|
+
errors
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
exports.REVERT_VULN = (0, graphql_tag_1.gql) `
|
|
98
|
+
mutation RevertVulnerabilityToDetected($id: VulnerabilityID!) {
|
|
99
|
+
vulnerabilityRevertToDetected(input: { id: $id }) {
|
|
100
|
+
vulnerability { ${VULN_FIELDS} }
|
|
101
|
+
errors
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
//# sourceMappingURL=vulnerabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vulnerabilities.js","sourceRoot":"","sources":["../../../src/graphql/vulnerabilities.ts"],"names":[],"mappings":";;;AAAA,6CAAkC;AAiBlC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;CAcnB,CAAC;AAqCF,MAAM,cAAc,GAAG;;;;;;;CAOtB,CAAC;AACF,MAAM,YAAY,GAAG;;;;;;;CAOpB,CAAC;AASW,QAAA,kBAAkB,GAC7B,IAAA,iBAAG,EAAA;qDACgD,cAAc;;wBAE3C,YAAY;kBAClB,WAAW;;;;;CAK5B,CAAC;AAMW,QAAA,gBAAgB,GAC3B,IAAA,iBAAG,EAAA;mDAC8C,cAAc;;wBAEzC,YAAY;kBAClB,WAAW;;;;;CAK5B,CAAC;AASW,QAAA,mBAAmB,GAG5B,IAAA,iBAAG,EAAA;yDACkD,cAAc;6CAC1B,YAAY;gBACzC,WAAW;;;;CAI1B,CAAC;AASW,QAAA,QAAQ,GAAkD,IAAA,iBAAG,EAAA;;+BAE3C,WAAW;;CAEzC,CAAC;AAgBW,QAAA,YAAY,GAA0D,IAAA,iBAAG,EAAA;;;;;;;wBAO9D,WAAW;;;;CAIlC,CAAC;AAQW,QAAA,YAAY,GAAqD,IAAA,iBAAG,EAAA;;;wBAGzD,WAAW;;;;CAIlC,CAAC;AAKW,QAAA,YAAY,GAAqD,IAAA,iBAAG,EAAA;;;wBAGzD,WAAW;;;;CAIlC,CAAC;AAKW,QAAA,WAAW,GAAoD,IAAA,iBAAG,EAAA;;;wBAGvD,WAAW;;;;CAIlC,CAAC"}
|
package/dist/src/oauth/config.js
CHANGED
|
@@ -13,7 +13,7 @@ const logger_1 = require("../logger");
|
|
|
13
13
|
const OAuthConfigSchema = zod_1.z.object({
|
|
14
14
|
enabled: zod_1.z.literal(true),
|
|
15
15
|
sessionSecret: zod_1.z.string().min(32, 'OAUTH_SESSION_SECRET must be at least 32 characters'),
|
|
16
|
-
gitlabClientId: zod_1.z.string().min(1, '
|
|
16
|
+
gitlabClientId: zod_1.z.string().min(1, 'OAUTH_CLIENT_ID is required'),
|
|
17
17
|
gitlabClientSecret: zod_1.z.string().optional(),
|
|
18
18
|
gitlabScopes: zod_1.z.string().default('api,read_user'),
|
|
19
19
|
tokenTtl: zod_1.z.number().positive().default(3600),
|
|
@@ -34,9 +34,9 @@ function loadOAuthConfig() {
|
|
|
34
34
|
const result = OAuthConfigSchema.safeParse({
|
|
35
35
|
enabled: true,
|
|
36
36
|
sessionSecret: process.env.OAUTH_SESSION_SECRET,
|
|
37
|
-
gitlabClientId: process.env.
|
|
38
|
-
gitlabClientSecret: process.env.
|
|
39
|
-
gitlabScopes: process.env.
|
|
37
|
+
gitlabClientId: process.env.OAUTH_CLIENT_ID,
|
|
38
|
+
gitlabClientSecret: process.env.OAUTH_CLIENT_SECRET,
|
|
39
|
+
gitlabScopes: process.env.OAUTH_SCOPES ?? 'api,read_user',
|
|
40
40
|
tokenTtl: parseInt(process.env.OAUTH_TOKEN_TTL ?? '3600', 10),
|
|
41
41
|
refreshTokenTtl: parseInt(process.env.OAUTH_REFRESH_TOKEN_TTL ?? '604800', 10),
|
|
42
42
|
devicePollInterval: parseInt(process.env.OAUTH_DEVICE_POLL_INTERVAL ?? '5', 10),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/oauth/config.ts"],"names":[],"mappings":";;;AAqDA,0CAoCC;AA2CD,oDAKC;AAOD,wCAEC;AAKD,sDAEC;AAOD,wDAQC;AAOD,0DAEC;AAOD,gEAEC;AAnLD,6BAAwB;AACxB,sCAA8C;AAM9C,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IAEjC,OAAO,EAAE,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IAExB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,qDAAqD,CAAC;IAExF,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/oauth/config.ts"],"names":[],"mappings":";;;AAqDA,0CAoCC;AA2CD,oDAKC;AAOD,wCAEC;AAKD,sDAEC;AAOD,wDAQC;AAOD,0DAEC;AAOD,gEAEC;AAnLD,6BAAwB;AACxB,sCAA8C;AAM9C,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IAEjC,OAAO,EAAE,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IAExB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,qDAAqD,CAAC;IAExF,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,6BAA6B,CAAC;IAEhE,kBAAkB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAEzC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC;IAEjD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAA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AAgB,sBAAsB;IACpC,IAAI,cAAc,EAAE,EAAE,CAAC;QACrB,OAAO,6DAA6D,CAAC;IACvE,CAAC;IACD,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;QAC7B,OAAO,yCAAyC,CAAC;IACnD,CAAC;IACD,OAAO,yEAAyE,CAAC;AACnF,CAAC;AAOD,SAAgB,uBAAuB;IACrC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AACpC,CAAC;AAOD,SAAgB,0BAA0B;IACxC,OAAO,cAAc,EAAE,IAAI,uBAAuB,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -2,7 +2,7 @@ export { loadOAuthConfig, validateStaticConfig, ConfigurationError, isOAuthEnabl
|
|
|
2
2
|
export type { OAuthConfig } from './config';
|
|
3
3
|
export type { OAuthSession, AuthCodeFlowState, DeviceFlowState, AuthorizationCode, GitLabTokenResponse, GitLabDeviceResponse, TokenContext, GitLabUserInfo, MCPTokenResponse, OAuthErrorResponse, DeviceFlowPollStatus, DeviceFlowPollResponse, MCPTokenPayload, } from './types';
|
|
4
4
|
export { sessionStore, SessionStore } from './session-store';
|
|
5
|
-
export { createStorageBackend, getStorageType, validateStorageConfig, MemoryStorageBackend, FileStorageBackend,
|
|
5
|
+
export { createStorageBackend, getStorageType, validateStorageConfig, MemoryStorageBackend, FileStorageBackend, STORAGE_DATA_VERSION, } from './storage';
|
|
6
6
|
export type { SessionStorageBackend, StorageConfig, SessionStorageStats, StorageData, } from './storage';
|
|
7
7
|
export { runWithTokenContext, getTokenContext, getGitLabTokenFromContext, getGitLabUserIdFromContext, getGitLabUsernameFromContext, getSessionIdFromContext, getGitLabApiUrlFromContext, getInstanceLabelFromContext, isInOAuthContext, } from './token-context';
|
|
8
8
|
export { createJWT, verifyJWT, verifyMCPToken, generateCodeVerifier, generateCodeChallenge, verifyCodeChallenge, generateRandomString, generateUUID, generateAuthorizationCode, generateSessionId, generateRefreshToken, isTokenExpiringSoon, calculateTokenExpiry, } from './token-utils';
|
package/dist/src/oauth/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBaseUrl = exports.protectedResourceHandler = exports.metadataHandler = exports.buildGitLabAuthUrl = exports.exchangeGitLabAuthCode = exports.validateGitLabToken = exports.getGitLabUser = exports.refreshGitLabToken = exports.pollForToken = exports.pollDeviceFlowOnce = exports.initiateDeviceFlow = exports.calculateTokenExpiry = exports.isTokenExpiringSoon = exports.generateRefreshToken = exports.generateSessionId = exports.generateAuthorizationCode = exports.generateUUID = exports.generateRandomString = exports.verifyCodeChallenge = exports.generateCodeChallenge = exports.generateCodeVerifier = exports.verifyMCPToken = exports.verifyJWT = exports.createJWT = exports.isInOAuthContext = exports.getInstanceLabelFromContext = exports.getGitLabApiUrlFromContext = exports.getSessionIdFromContext = exports.getGitLabUsernameFromContext = exports.getGitLabUserIdFromContext = exports.getGitLabTokenFromContext = exports.getTokenContext = exports.runWithTokenContext = exports.STORAGE_DATA_VERSION = exports.
|
|
4
|
-
exports.isValidRedirectUri = exports.getRegisteredClient = exports.registerHandler = exports.tokenHandler = exports.callbackHandler = exports.pollHandler =
|
|
3
|
+
exports.authorizeHandler = exports.getBaseUrl = exports.protectedResourceHandler = exports.metadataHandler = exports.buildGitLabAuthUrl = exports.exchangeGitLabAuthCode = exports.validateGitLabToken = exports.getGitLabUser = exports.refreshGitLabToken = exports.pollForToken = exports.pollDeviceFlowOnce = exports.initiateDeviceFlow = exports.calculateTokenExpiry = exports.isTokenExpiringSoon = exports.generateRefreshToken = exports.generateSessionId = exports.generateAuthorizationCode = exports.generateUUID = exports.generateRandomString = exports.verifyCodeChallenge = exports.generateCodeChallenge = exports.generateCodeVerifier = exports.verifyMCPToken = exports.verifyJWT = exports.createJWT = exports.isInOAuthContext = exports.getInstanceLabelFromContext = exports.getGitLabApiUrlFromContext = exports.getSessionIdFromContext = exports.getGitLabUsernameFromContext = exports.getGitLabUserIdFromContext = exports.getGitLabTokenFromContext = exports.getTokenContext = exports.runWithTokenContext = exports.STORAGE_DATA_VERSION = exports.FileStorageBackend = exports.MemoryStorageBackend = exports.validateStorageConfig = exports.getStorageType = exports.createStorageBackend = exports.SessionStore = exports.sessionStore = exports.isAuthenticationConfigured = exports.isStaticTokenConfigured = exports.resetOAuthConfigCache = exports.getAuthModeDescription = exports.isOAuthEnabled = exports.ConfigurationError = exports.validateStaticConfig = exports.loadOAuthConfig = void 0;
|
|
4
|
+
exports.isValidRedirectUri = exports.getRegisteredClient = exports.registerHandler = exports.tokenHandler = exports.callbackHandler = exports.pollHandler = void 0;
|
|
5
5
|
var config_1 = require("./config");
|
|
6
6
|
Object.defineProperty(exports, "loadOAuthConfig", { enumerable: true, get: function () { return config_1.loadOAuthConfig; } });
|
|
7
7
|
Object.defineProperty(exports, "validateStaticConfig", { enumerable: true, get: function () { return config_1.validateStaticConfig; } });
|
|
@@ -20,7 +20,6 @@ Object.defineProperty(exports, "getStorageType", { enumerable: true, get: functi
|
|
|
20
20
|
Object.defineProperty(exports, "validateStorageConfig", { enumerable: true, get: function () { return storage_1.validateStorageConfig; } });
|
|
21
21
|
Object.defineProperty(exports, "MemoryStorageBackend", { enumerable: true, get: function () { return storage_1.MemoryStorageBackend; } });
|
|
22
22
|
Object.defineProperty(exports, "FileStorageBackend", { enumerable: true, get: function () { return storage_1.FileStorageBackend; } });
|
|
23
|
-
Object.defineProperty(exports, "PostgreSQLStorageBackend", { enumerable: true, get: function () { return storage_1.PostgreSQLStorageBackend; } });
|
|
24
23
|
Object.defineProperty(exports, "STORAGE_DATA_VERSION", { enumerable: true, get: function () { return storage_1.STORAGE_DATA_VERSION; } });
|
|
25
24
|
var token_context_1 = require("./token-context");
|
|
26
25
|
Object.defineProperty(exports, "runWithTokenContext", { enumerable: true, get: function () { return token_context_1.runWithTokenContext; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/oauth/index.ts"],"names":[],"mappings":";;;;AAQA,mCASkB;AARhB,yGAAA,eAAe,OAAA;AACf,8GAAA,oBAAoB,OAAA;AACpB,4GAAA,kBAAkB,OAAA;AAClB,wGAAA,cAAc,OAAA;AACd,gHAAA,sBAAsB,OAAA;AACtB,+GAAA,qBAAqB,OAAA;AACrB,iHAAA,uBAAuB,OAAA;AACvB,oHAAA,0BAA0B,OAAA;AAsB5B,iDAA6D;AAApD,6GAAA,YAAY,OAAA;AAAE,6GAAA,YAAY,OAAA;AAGnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/oauth/index.ts"],"names":[],"mappings":";;;;AAQA,mCASkB;AARhB,yGAAA,eAAe,OAAA;AACf,8GAAA,oBAAoB,OAAA;AACpB,4GAAA,kBAAkB,OAAA;AAClB,wGAAA,cAAc,OAAA;AACd,gHAAA,sBAAsB,OAAA;AACtB,+GAAA,qBAAqB,OAAA;AACrB,iHAAA,uBAAuB,OAAA;AACvB,oHAAA,0BAA0B,OAAA;AAsB5B,iDAA6D;AAApD,6GAAA,YAAY,OAAA;AAAE,6GAAA,YAAY,OAAA;AAGnC,qCAOmB;AANjB,+GAAA,oBAAoB,OAAA;AACpB,yGAAA,cAAc,OAAA;AACd,gHAAA,qBAAqB,OAAA;AACrB,+GAAA,oBAAoB,OAAA;AACpB,6GAAA,kBAAkB,OAAA;AAClB,+GAAA,oBAAoB,OAAA;AAUtB,iDAUyB;AATvB,oHAAA,mBAAmB,OAAA;AACnB,gHAAA,eAAe,OAAA;AACf,0HAAA,yBAAyB,OAAA;AACzB,2HAAA,0BAA0B,OAAA;AAC1B,6HAAA,4BAA4B,OAAA;AAC5B,wHAAA,uBAAuB,OAAA;AACvB,2HAAA,0BAA0B,OAAA;AAC1B,4HAAA,2BAA2B,OAAA;AAC3B,iHAAA,gBAAgB,OAAA;AAIlB,6CAcuB;AAbrB,wGAAA,SAAS,OAAA;AACT,wGAAA,SAAS,OAAA;AACT,6GAAA,cAAc,OAAA;AACd,mHAAA,oBAAoB,OAAA;AACpB,oHAAA,qBAAqB,OAAA;AACrB,kHAAA,mBAAmB,OAAA;AACnB,mHAAA,oBAAoB,OAAA;AACpB,2GAAA,YAAY,OAAA;AACZ,wHAAA,yBAAyB,OAAA;AACzB,gHAAA,iBAAiB,OAAA;AACjB,mHAAA,oBAAoB,OAAA;AACpB,kHAAA,mBAAmB,OAAA;AACnB,mHAAA,oBAAoB,OAAA;AAItB,2DAS8B;AAR5B,wHAAA,kBAAkB,OAAA;AAClB,wHAAA,kBAAkB,OAAA;AAClB,kHAAA,YAAY,OAAA;AACZ,wHAAA,kBAAkB,OAAA;AAClB,mHAAA,aAAa,OAAA;AACb,yHAAA,mBAAmB,OAAA;AACnB,4HAAA,sBAAsB,OAAA;AACtB,wHAAA,kBAAkB,OAAA;AAIpB,2CAW2B;AAVzB,wGAAA,eAAe,OAAA;AACf,iHAAA,wBAAwB,OAAA;AACxB,mGAAA,UAAU,OAAA;AACV,yGAAA,gBAAgB,OAAA;AAChB,oGAAA,WAAW,OAAA;AACX,wGAAA,eAAe,OAAA;AACf,qGAAA,YAAY,OAAA;AACZ,wGAAA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,2GAAA,kBAAkB,OAAA"}
|
|
@@ -5,7 +5,6 @@ exports.getStorageType = getStorageType;
|
|
|
5
5
|
exports.validateStorageConfig = validateStorageConfig;
|
|
6
6
|
const memory_1 = require("./memory");
|
|
7
7
|
const file_1 = require("./file");
|
|
8
|
-
const postgresql_1 = require("./postgresql");
|
|
9
8
|
const logger_1 = require("../../logger");
|
|
10
9
|
function createStorageBackend(config) {
|
|
11
10
|
const storageType = config?.type ?? getEnvStorageType();
|
|
@@ -45,8 +44,16 @@ function createPostgreSQLBackend() {
|
|
|
45
44
|
throw new Error('PostgreSQL storage requires a connection string. ' +
|
|
46
45
|
'Set OAUTH_STORAGE_POSTGRESQL_URL or DATABASE_URL environment variable');
|
|
47
46
|
}
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
let mod;
|
|
48
|
+
try {
|
|
49
|
+
mod = require('@structured-world/gitlab-mcp-db');
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
throw new Error("PostgreSQL storage requires the optional '@structured-world/gitlab-mcp-db' package. " +
|
|
53
|
+
'Install it with: npm install @structured-world/gitlab-mcp-db');
|
|
54
|
+
}
|
|
55
|
+
(0, logger_1.logInfo)('Using PostgreSQL session storage (via @structured-world/gitlab-mcp-db)');
|
|
56
|
+
return new mod.PostgreSQLStorageBackend();
|
|
50
57
|
}
|
|
51
58
|
function getStorageType(config) {
|
|
52
59
|
return config?.type ?? getEnvStorageType();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../src/oauth/storage/factory.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../src/oauth/storage/factory.ts"],"names":[],"mappings":";;AAwBA,oDAaC;AAiED,wCAEC;AAKD,sDA2BC;AAjID,qCAAgD;AAChD,iCAA4C;AAC5C,yCAAuC;AAevC,SAAgB,oBAAoB,CAAC,MAAsB;IAEzD,MAAM,WAAW,GAAG,MAAM,EAAE,IAAI,IAAI,iBAAiB,EAAE,CAAC;IAExD,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACnC,KAAK,YAAY;YACf,OAAO,uBAAuB,EAAE,CAAC;QACnC,KAAK,QAAQ,CAAC;QACd;YACE,OAAO,mBAAmB,EAAE,CAAC;IACjC,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB;IACxB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,WAAW,EAAE,CAAC;IAC3D,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAC7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AO,MAAM,EAAE,IAAI,IAAI,iBAAiB,EAAE,CAAC;AAC7C,CAAC;AAKD,SAAgB,qBAAqB,CAAC,MAAsB;IAC1D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAEpC,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAE1B,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QAE9F,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,MAAM,CAAC,IAAI,CACT,+FAA+F,CAChG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;QAE3E,IAAI,QAAQ,EAAE,CAAC;YAEb,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -17,6 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./types"), exports);
|
|
18
18
|
__exportStar(require("./memory"), exports);
|
|
19
19
|
__exportStar(require("./file"), exports);
|
|
20
|
-
__exportStar(require("./postgresql"), exports);
|
|
21
20
|
__exportStar(require("./factory"), exports);
|
|
22
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/oauth/storage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/oauth/storage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAUA,0CAAwB;AACxB,2CAAyB;AACzB,yCAAuB;AACvB,4CAA0B"}
|