@structured-world/gitlab-mcp 6.12.0 → 6.14.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/src/main.js +44 -1
- package/dist/src/main.js.map +1 -1
- package/dist/src/profiles/applicator.d.ts +19 -0
- package/dist/src/profiles/applicator.js +250 -0
- package/dist/src/profiles/applicator.js.map +1 -0
- package/dist/src/profiles/builtin/admin.yaml +25 -0
- package/dist/src/profiles/builtin/ci.yaml +30 -0
- package/dist/src/profiles/builtin/developer.yaml +35 -0
- package/dist/src/profiles/builtin/devops.yaml +28 -0
- package/dist/src/profiles/builtin/gitlab-com.yaml +35 -0
- package/dist/src/profiles/builtin/junior-dev.yaml +30 -0
- package/dist/src/profiles/builtin/pm.yaml +31 -0
- package/dist/src/profiles/builtin/readonly.yaml +28 -0
- package/dist/src/profiles/builtin/senior-dev.yaml +36 -0
- package/dist/src/profiles/builtin/team-lead.yaml +37 -0
- package/dist/src/profiles/index.d.ts +3 -0
- package/dist/src/profiles/index.js +18 -0
- package/dist/src/profiles/index.js.map +1 -0
- package/dist/src/profiles/loader.d.ts +32 -0
- package/dist/src/profiles/loader.js +316 -0
- package/dist/src/profiles/loader.js.map +1 -0
- package/dist/src/profiles/types.d.ts +167 -0
- package/dist/src/profiles/types.js +84 -0
- package/dist/src/profiles/types.js.map +1 -0
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/structured-world-gitlab-mcp-6.14.0.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/dist/structured-world-gitlab-mcp-6.12.0.tgz +0 -0
package/dist/src/main.js
CHANGED
|
@@ -3,7 +3,50 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const server_1 = require("./server");
|
|
5
5
|
const logger_1 = require("./logger");
|
|
6
|
-
|
|
6
|
+
const profiles_1 = require("./profiles");
|
|
7
|
+
function getProfileFromArgs() {
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
let profileName;
|
|
10
|
+
let profileCount = 0;
|
|
11
|
+
for (let i = 0; i < args.length; i++) {
|
|
12
|
+
if (args[i] === "--profile") {
|
|
13
|
+
const value = args[i + 1];
|
|
14
|
+
if (!value || value.startsWith("--")) {
|
|
15
|
+
logger_1.logger.error("--profile requires a profile name (e.g., --profile work)");
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
profileCount++;
|
|
19
|
+
if (profileCount === 1) {
|
|
20
|
+
profileName = value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (profileCount > 1) {
|
|
25
|
+
logger_1.logger.warn({ count: profileCount }, "Multiple --profile flags detected, using first value");
|
|
26
|
+
}
|
|
27
|
+
return profileName;
|
|
28
|
+
}
|
|
29
|
+
async function main() {
|
|
30
|
+
const profileName = getProfileFromArgs();
|
|
31
|
+
try {
|
|
32
|
+
const result = await (0, profiles_1.tryApplyProfileFromEnv)(profileName);
|
|
33
|
+
if (result) {
|
|
34
|
+
if ("profileName" in result) {
|
|
35
|
+
logger_1.logger.info({ profile: result.profileName, host: result.host }, "Using configuration profile");
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
logger_1.logger.info({ preset: result.presetName }, "Using configuration preset");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
44
|
+
logger_1.logger.error({ error: message }, "Failed to load profile");
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
await (0, server_1.startServer)();
|
|
48
|
+
}
|
|
49
|
+
main().catch((error) => {
|
|
7
50
|
logger_1.logger.error(`Failed to start GitLab MCP Server: ${String(error)}`);
|
|
8
51
|
process.exit(1);
|
|
9
52
|
});
|
package/dist/src/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;AAEA,qCAAuC;AACvC,qCAAkC;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;AAEA,qCAAuC;AACvC,qCAAkC;AAClC,yCAAoD;AAKpD,SAAS,kBAAkB;IACzB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,WAA+B,CAAC;IACpC,IAAI,YAAY,GAAG,CAAC,CAAC;IAErB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAE1B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,eAAM,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;gBACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,YAAY,EAAE,CAAC;YACf,IAAI,YAAY,KAAK,CAAC,EAAE,CAAC;gBACvB,WAAW,GAAG,KAAK,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;QACrB,eAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,sDAAsD,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAKD,KAAK,UAAU,IAAI;IAEjB,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAsB,EAAC,WAAW,CAAC,CAAC;QACzD,IAAI,MAAM,EAAE,CAAC;YAEX,IAAI,aAAa,IAAI,MAAM,EAAE,CAAC;gBAC5B,eAAM,CAAC,IAAI,CACT,EAAE,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAClD,6BAA6B,CAC9B,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,eAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,EAAE,4BAA4B,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAEf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,eAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,wBAAwB,CAAC,CAAC;QAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAGD,MAAM,IAAA,oBAAW,GAAE,CAAC;AACtB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,eAAM,CAAC,KAAK,CAAC,sCAAsC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Profile, Preset, ProfileValidationResult } from "./types";
|
|
2
|
+
export interface ApplyProfileResult {
|
|
3
|
+
success: boolean;
|
|
4
|
+
profileName: string;
|
|
5
|
+
host: string;
|
|
6
|
+
appliedSettings: string[];
|
|
7
|
+
validation: ProfileValidationResult;
|
|
8
|
+
}
|
|
9
|
+
export interface ApplyPresetResult {
|
|
10
|
+
success: boolean;
|
|
11
|
+
presetName: string;
|
|
12
|
+
appliedSettings: string[];
|
|
13
|
+
validation: ProfileValidationResult;
|
|
14
|
+
}
|
|
15
|
+
export declare function applyProfile(profile: Profile, profileName: string): Promise<ApplyProfileResult>;
|
|
16
|
+
export declare function applyPreset(preset: Preset, presetName: string): Promise<ApplyPresetResult>;
|
|
17
|
+
export declare function loadAndApplyProfile(profileName: string): Promise<ApplyProfileResult>;
|
|
18
|
+
export declare function loadAndApplyPreset(presetName: string): Promise<ApplyPresetResult>;
|
|
19
|
+
export declare function tryApplyProfileFromEnv(cliProfileName?: string): Promise<ApplyProfileResult | ApplyPresetResult | undefined>;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyProfile = applyProfile;
|
|
4
|
+
exports.applyPreset = applyPreset;
|
|
5
|
+
exports.loadAndApplyProfile = loadAndApplyProfile;
|
|
6
|
+
exports.loadAndApplyPreset = loadAndApplyPreset;
|
|
7
|
+
exports.tryApplyProfileFromEnv = tryApplyProfileFromEnv;
|
|
8
|
+
const loader_1 = require("./loader");
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
const FEATURE_ENV_MAP = {
|
|
11
|
+
wiki: "USE_GITLAB_WIKI",
|
|
12
|
+
milestones: "USE_MILESTONE",
|
|
13
|
+
pipelines: "USE_PIPELINE",
|
|
14
|
+
labels: "USE_LABELS",
|
|
15
|
+
mrs: "USE_MRS",
|
|
16
|
+
files: "USE_FILES",
|
|
17
|
+
variables: "USE_VARIABLES",
|
|
18
|
+
workitems: "USE_WORKITEMS",
|
|
19
|
+
webhooks: "USE_WEBHOOKS",
|
|
20
|
+
snippets: "USE_SNIPPETS",
|
|
21
|
+
integrations: "USE_INTEGRATIONS",
|
|
22
|
+
};
|
|
23
|
+
async function applyProfile(profile, profileName) {
|
|
24
|
+
const appliedSettings = [];
|
|
25
|
+
const loader = new loader_1.ProfileLoader();
|
|
26
|
+
const validation = await loader.validateProfile(profile);
|
|
27
|
+
for (const warning of validation.warnings) {
|
|
28
|
+
logger_1.logger.warn({ profile: profileName }, warning);
|
|
29
|
+
}
|
|
30
|
+
if (!validation.valid) {
|
|
31
|
+
logger_1.logger.error({ profile: profileName, errors: validation.errors }, "Profile validation failed");
|
|
32
|
+
return {
|
|
33
|
+
success: false,
|
|
34
|
+
profileName,
|
|
35
|
+
host: profile.host,
|
|
36
|
+
appliedSettings,
|
|
37
|
+
validation,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const apiUrl = profile.api_url ?? `https://${profile.host}`;
|
|
41
|
+
process.env.GITLAB_API_URL = apiUrl;
|
|
42
|
+
appliedSettings.push(`GITLAB_API_URL=${apiUrl}`);
|
|
43
|
+
switch (profile.auth.type) {
|
|
44
|
+
case "pat":
|
|
45
|
+
if (profile.auth.token_env) {
|
|
46
|
+
const token = process.env[profile.auth.token_env];
|
|
47
|
+
if (token) {
|
|
48
|
+
process.env.GITLAB_TOKEN = token;
|
|
49
|
+
appliedSettings.push(`GITLAB_TOKEN=<from ${profile.auth.token_env}>`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
case "oauth":
|
|
54
|
+
if (profile.auth.client_id_env) {
|
|
55
|
+
const clientId = process.env[profile.auth.client_id_env];
|
|
56
|
+
if (clientId) {
|
|
57
|
+
process.env.GITLAB_OAUTH_CLIENT_ID = clientId;
|
|
58
|
+
appliedSettings.push(`GITLAB_OAUTH_CLIENT_ID=<from ${profile.auth.client_id_env}>`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (profile.auth.client_secret_env) {
|
|
62
|
+
const clientSecret = process.env[profile.auth.client_secret_env];
|
|
63
|
+
if (clientSecret) {
|
|
64
|
+
process.env.GITLAB_OAUTH_CLIENT_SECRET = clientSecret;
|
|
65
|
+
appliedSettings.push(`GITLAB_OAUTH_CLIENT_SECRET=<from ${profile.auth.client_secret_env}>`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
process.env.OAUTH_ENABLED = "true";
|
|
69
|
+
appliedSettings.push("OAUTH_ENABLED=true");
|
|
70
|
+
break;
|
|
71
|
+
case "cookie":
|
|
72
|
+
if (profile.auth.cookie_path) {
|
|
73
|
+
process.env.GITLAB_AUTH_COOKIE_PATH = profile.auth.cookie_path;
|
|
74
|
+
appliedSettings.push(`GITLAB_AUTH_COOKIE_PATH=${profile.auth.cookie_path}`);
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
if (profile.read_only) {
|
|
79
|
+
process.env.GITLAB_READ_ONLY_MODE = "true";
|
|
80
|
+
appliedSettings.push("GITLAB_READ_ONLY_MODE=true");
|
|
81
|
+
}
|
|
82
|
+
if (profile.allowed_projects && profile.allowed_projects.length > 0) {
|
|
83
|
+
process.env.GITLAB_ALLOWED_PROJECT_IDS = profile.allowed_projects.join(",");
|
|
84
|
+
appliedSettings.push(`GITLAB_ALLOWED_PROJECT_IDS=${profile.allowed_projects.join(",")}`);
|
|
85
|
+
}
|
|
86
|
+
if (profile.allowed_groups && profile.allowed_groups.length > 0) {
|
|
87
|
+
process.env.GITLAB_ALLOWED_GROUP_IDS = profile.allowed_groups.join(",");
|
|
88
|
+
appliedSettings.push(`GITLAB_ALLOWED_GROUP_IDS=${profile.allowed_groups.join(",")}`);
|
|
89
|
+
}
|
|
90
|
+
if (profile.allowed_tools && profile.allowed_tools.length > 0) {
|
|
91
|
+
process.env.GITLAB_ALLOWED_TOOLS = profile.allowed_tools.join(",");
|
|
92
|
+
appliedSettings.push(`GITLAB_ALLOWED_TOOLS=${profile.allowed_tools.join(",")}`);
|
|
93
|
+
}
|
|
94
|
+
if (profile.denied_tools_regex) {
|
|
95
|
+
process.env.GITLAB_DENIED_TOOLS_REGEX = profile.denied_tools_regex;
|
|
96
|
+
appliedSettings.push(`GITLAB_DENIED_TOOLS_REGEX=${profile.denied_tools_regex}`);
|
|
97
|
+
}
|
|
98
|
+
if (profile.denied_actions && profile.denied_actions.length > 0) {
|
|
99
|
+
process.env.GITLAB_DENIED_ACTIONS = profile.denied_actions.join(",");
|
|
100
|
+
appliedSettings.push(`GITLAB_DENIED_ACTIONS=${profile.denied_actions.join(",")}`);
|
|
101
|
+
}
|
|
102
|
+
if (profile.features) {
|
|
103
|
+
for (const [feature, envVar] of Object.entries(FEATURE_ENV_MAP)) {
|
|
104
|
+
const value = profile.features[feature];
|
|
105
|
+
if (value !== undefined) {
|
|
106
|
+
process.env[envVar] = value ? "true" : "false";
|
|
107
|
+
appliedSettings.push(`${envVar}=${value}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (profile.timeout_ms) {
|
|
112
|
+
process.env.GITLAB_API_TIMEOUT_MS = String(profile.timeout_ms);
|
|
113
|
+
appliedSettings.push(`GITLAB_API_TIMEOUT_MS=${profile.timeout_ms}`);
|
|
114
|
+
}
|
|
115
|
+
if (profile.skip_tls_verify) {
|
|
116
|
+
process.env.SKIP_TLS_VERIFY = "true";
|
|
117
|
+
appliedSettings.push("SKIP_TLS_VERIFY=true");
|
|
118
|
+
}
|
|
119
|
+
if (profile.ssl_cert_path) {
|
|
120
|
+
process.env.SSL_CERT_PATH = profile.ssl_cert_path;
|
|
121
|
+
appliedSettings.push(`SSL_CERT_PATH=${profile.ssl_cert_path}`);
|
|
122
|
+
}
|
|
123
|
+
if (profile.ssl_key_path) {
|
|
124
|
+
process.env.SSL_KEY_PATH = profile.ssl_key_path;
|
|
125
|
+
appliedSettings.push(`SSL_KEY_PATH=${profile.ssl_key_path}`);
|
|
126
|
+
}
|
|
127
|
+
if (profile.ca_cert_path) {
|
|
128
|
+
process.env.GITLAB_CA_CERT_PATH = profile.ca_cert_path;
|
|
129
|
+
appliedSettings.push(`GITLAB_CA_CERT_PATH=${profile.ca_cert_path}`);
|
|
130
|
+
}
|
|
131
|
+
if (profile.default_project) {
|
|
132
|
+
process.env.GITLAB_PROJECT_ID = profile.default_project;
|
|
133
|
+
appliedSettings.push(`GITLAB_PROJECT_ID=${profile.default_project}`);
|
|
134
|
+
}
|
|
135
|
+
if (profile.default_namespace) {
|
|
136
|
+
process.env.GITLAB_DEFAULT_NAMESPACE = profile.default_namespace;
|
|
137
|
+
appliedSettings.push(`GITLAB_DEFAULT_NAMESPACE=${profile.default_namespace}`);
|
|
138
|
+
}
|
|
139
|
+
logger_1.logger.info({
|
|
140
|
+
profile: profileName,
|
|
141
|
+
host: profile.host,
|
|
142
|
+
authType: profile.auth.type,
|
|
143
|
+
readOnly: profile.read_only ?? false,
|
|
144
|
+
settingsCount: appliedSettings.length,
|
|
145
|
+
}, "Profile applied successfully");
|
|
146
|
+
return {
|
|
147
|
+
success: true,
|
|
148
|
+
profileName,
|
|
149
|
+
host: profile.host,
|
|
150
|
+
appliedSettings,
|
|
151
|
+
validation,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
async function applyPreset(preset, presetName) {
|
|
155
|
+
const appliedSettings = [];
|
|
156
|
+
const loader = new loader_1.ProfileLoader();
|
|
157
|
+
const validation = await loader.validatePreset(preset);
|
|
158
|
+
for (const warning of validation.warnings) {
|
|
159
|
+
logger_1.logger.warn({ preset: presetName }, warning);
|
|
160
|
+
}
|
|
161
|
+
if (!validation.valid) {
|
|
162
|
+
logger_1.logger.error({ preset: presetName, errors: validation.errors }, "Preset validation failed");
|
|
163
|
+
return {
|
|
164
|
+
success: false,
|
|
165
|
+
presetName,
|
|
166
|
+
appliedSettings,
|
|
167
|
+
validation,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
if (!process.env.GITLAB_API_URL && !process.env.GITLAB_TOKEN) {
|
|
171
|
+
logger_1.logger.warn({ preset: presetName }, "Preset applied but GITLAB_API_URL/GITLAB_TOKEN not set - connection may fail");
|
|
172
|
+
}
|
|
173
|
+
if (preset.read_only) {
|
|
174
|
+
process.env.GITLAB_READ_ONLY_MODE = "true";
|
|
175
|
+
appliedSettings.push("GITLAB_READ_ONLY_MODE=true");
|
|
176
|
+
}
|
|
177
|
+
if (preset.denied_tools_regex) {
|
|
178
|
+
process.env.GITLAB_DENIED_TOOLS_REGEX = preset.denied_tools_regex;
|
|
179
|
+
appliedSettings.push(`GITLAB_DENIED_TOOLS_REGEX=${preset.denied_tools_regex}`);
|
|
180
|
+
}
|
|
181
|
+
if (preset.denied_actions && preset.denied_actions.length > 0) {
|
|
182
|
+
process.env.GITLAB_DENIED_ACTIONS = preset.denied_actions.join(",");
|
|
183
|
+
appliedSettings.push(`GITLAB_DENIED_ACTIONS=${preset.denied_actions.join(",")}`);
|
|
184
|
+
}
|
|
185
|
+
if (preset.allowed_tools && preset.allowed_tools.length > 0) {
|
|
186
|
+
process.env.GITLAB_ALLOWED_TOOLS = preset.allowed_tools.join(",");
|
|
187
|
+
appliedSettings.push(`GITLAB_ALLOWED_TOOLS=${preset.allowed_tools.join(",")}`);
|
|
188
|
+
}
|
|
189
|
+
if (preset.features) {
|
|
190
|
+
for (const [feature, envVar] of Object.entries(FEATURE_ENV_MAP)) {
|
|
191
|
+
const value = preset.features[feature];
|
|
192
|
+
if (value !== undefined) {
|
|
193
|
+
process.env[envVar] = value ? "true" : "false";
|
|
194
|
+
appliedSettings.push(`${envVar}=${value}`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (preset.timeout_ms) {
|
|
199
|
+
process.env.GITLAB_API_TIMEOUT_MS = String(preset.timeout_ms);
|
|
200
|
+
appliedSettings.push(`GITLAB_API_TIMEOUT_MS=${preset.timeout_ms}`);
|
|
201
|
+
}
|
|
202
|
+
logger_1.logger.info({
|
|
203
|
+
preset: presetName,
|
|
204
|
+
readOnly: preset.read_only ?? false,
|
|
205
|
+
settingsCount: appliedSettings.length,
|
|
206
|
+
}, "Preset applied successfully");
|
|
207
|
+
return {
|
|
208
|
+
success: true,
|
|
209
|
+
presetName,
|
|
210
|
+
appliedSettings,
|
|
211
|
+
validation,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
async function loadAndApplyProfile(profileName) {
|
|
215
|
+
const loader = new loader_1.ProfileLoader();
|
|
216
|
+
const profile = await loader.loadProfile(profileName);
|
|
217
|
+
return applyProfile(profile, profileName);
|
|
218
|
+
}
|
|
219
|
+
async function loadAndApplyPreset(presetName) {
|
|
220
|
+
const loader = new loader_1.ProfileLoader();
|
|
221
|
+
const preset = await loader.loadPreset(presetName);
|
|
222
|
+
return applyPreset(preset, presetName);
|
|
223
|
+
}
|
|
224
|
+
async function tryApplyProfileFromEnv(cliProfileName) {
|
|
225
|
+
const name = cliProfileName ?? process.env.GITLAB_PROFILE ?? (await getDefaultProfileName());
|
|
226
|
+
if (!name) {
|
|
227
|
+
logger_1.logger.debug("No profile specified, using environment variables directly");
|
|
228
|
+
return undefined;
|
|
229
|
+
}
|
|
230
|
+
try {
|
|
231
|
+
const loader = new loader_1.ProfileLoader();
|
|
232
|
+
const loaded = await loader.loadAny(name);
|
|
233
|
+
if (loaded.type === "profile") {
|
|
234
|
+
return await applyProfile(loaded.data, name);
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
return await applyPreset(loaded.data, name);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
242
|
+
logger_1.logger.error({ profile: name, error: message }, "Failed to apply profile/preset");
|
|
243
|
+
throw error;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
async function getDefaultProfileName() {
|
|
247
|
+
const loader = new loader_1.ProfileLoader();
|
|
248
|
+
return loader.getDefaultProfileName();
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=applicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applicator.js","sourceRoot":"","sources":["../../../src/profiles/applicator.ts"],"names":[],"mappings":";;AAkEA,oCAyKC;AAiBD,kCAkFC;AAcD,kDAIC;AAUD,gDAIC;AAWD,wDAyBC;AA1YD,qCAAyC;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AAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,MAAM,qBAAqB,EAAE,CAAC,CAAC;IAE7F,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,eAAM,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAC3E,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,sBAAa,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE1C,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,MAAM,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,OAAO,MAAM,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,eAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,gCAAgC,CAAC,CAAC;QAClF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAKD,KAAK,UAAU,qBAAqB;IAClC,MAAM,MAAM,GAAG,IAAI,sBAAa,EAAE,CAAC;IACnC,OAAO,MAAM,CAAC,qBAAqB,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Admin preset - full access to all features
|
|
2
|
+
#
|
|
3
|
+
# Use with caution - this preset enables all tools
|
|
4
|
+
# including webhooks, integrations, and variables.
|
|
5
|
+
#
|
|
6
|
+
# Recommended only for GitLab administrators.
|
|
7
|
+
#
|
|
8
|
+
# NOTE: This is a PRESET - host/auth come from environment variables.
|
|
9
|
+
|
|
10
|
+
description: "Full admin access - all features enabled"
|
|
11
|
+
|
|
12
|
+
read_only: false
|
|
13
|
+
|
|
14
|
+
features:
|
|
15
|
+
wiki: true
|
|
16
|
+
milestones: true
|
|
17
|
+
pipelines: true
|
|
18
|
+
labels: true
|
|
19
|
+
mrs: true
|
|
20
|
+
files: true
|
|
21
|
+
variables: true
|
|
22
|
+
workitems: true
|
|
23
|
+
webhooks: true
|
|
24
|
+
snippets: true
|
|
25
|
+
integrations: true
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# CI/CD Bot preset - automation
|
|
2
|
+
#
|
|
3
|
+
# Minimal tools for CI/CD automation:
|
|
4
|
+
# - Pipeline operations
|
|
5
|
+
# - File management
|
|
6
|
+
# - Variables access
|
|
7
|
+
#
|
|
8
|
+
# No access to development workflow tools.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: This is a PRESET - host/auth come from environment variables.
|
|
11
|
+
|
|
12
|
+
description: "CI/CD Bot - minimal tools for automation"
|
|
13
|
+
|
|
14
|
+
read_only: false
|
|
15
|
+
|
|
16
|
+
features:
|
|
17
|
+
wiki: false
|
|
18
|
+
milestones: false
|
|
19
|
+
pipelines: true
|
|
20
|
+
labels: false
|
|
21
|
+
mrs: false
|
|
22
|
+
files: true
|
|
23
|
+
variables: true
|
|
24
|
+
workitems: false
|
|
25
|
+
webhooks: false
|
|
26
|
+
snippets: false
|
|
27
|
+
integrations: false
|
|
28
|
+
|
|
29
|
+
# Block workflow-related operations
|
|
30
|
+
denied_tools_regex: "^manage_(work_item|mr|label|milestone|wiki)"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Developer preset - standard development workflow
|
|
2
|
+
#
|
|
3
|
+
# Full access to development-related tools including:
|
|
4
|
+
# - Code browsing and file management
|
|
5
|
+
# - Work items and merge requests
|
|
6
|
+
# - Labels and milestones
|
|
7
|
+
#
|
|
8
|
+
# Restricted access to admin-level features.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: This is a PRESET - host/auth come from environment variables.
|
|
11
|
+
|
|
12
|
+
description: "Standard developer access - no admin features"
|
|
13
|
+
|
|
14
|
+
read_only: false
|
|
15
|
+
|
|
16
|
+
features:
|
|
17
|
+
wiki: true
|
|
18
|
+
milestones: true
|
|
19
|
+
pipelines: true
|
|
20
|
+
labels: true
|
|
21
|
+
mrs: true
|
|
22
|
+
files: true
|
|
23
|
+
variables: false # Requires elevated access
|
|
24
|
+
workitems: true
|
|
25
|
+
webhooks: false # Admin only
|
|
26
|
+
snippets: true
|
|
27
|
+
integrations: false # Admin only
|
|
28
|
+
|
|
29
|
+
# Block dangerous actions
|
|
30
|
+
denied_actions:
|
|
31
|
+
- "manage_repository:delete"
|
|
32
|
+
- "manage_webhook:create"
|
|
33
|
+
- "manage_webhook:update"
|
|
34
|
+
- "manage_webhook:delete"
|
|
35
|
+
- "manage_integration:update"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# DevOps Engineer preset - CI/CD and infrastructure
|
|
2
|
+
#
|
|
3
|
+
# Focused on infrastructure and automation:
|
|
4
|
+
# - Full pipeline management
|
|
5
|
+
# - Variables and secrets
|
|
6
|
+
# - Webhooks and integrations
|
|
7
|
+
# - File operations for configs
|
|
8
|
+
#
|
|
9
|
+
# No access to development workflow tools (MRs, issues, wiki).
|
|
10
|
+
#
|
|
11
|
+
# NOTE: This is a PRESET - host/auth come from environment variables.
|
|
12
|
+
|
|
13
|
+
description: "DevOps Engineer - CI/CD pipelines, variables, infrastructure"
|
|
14
|
+
|
|
15
|
+
read_only: false
|
|
16
|
+
|
|
17
|
+
features:
|
|
18
|
+
wiki: false
|
|
19
|
+
milestones: false
|
|
20
|
+
pipelines: true
|
|
21
|
+
labels: false
|
|
22
|
+
mrs: false
|
|
23
|
+
files: true
|
|
24
|
+
variables: true
|
|
25
|
+
workitems: false
|
|
26
|
+
webhooks: true
|
|
27
|
+
snippets: false
|
|
28
|
+
integrations: true
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# gitlab.com preset - rate-limit friendly
|
|
2
|
+
#
|
|
3
|
+
# Optimized for gitlab.com public instance:
|
|
4
|
+
# - Standard development features enabled
|
|
5
|
+
# - Rate-limit friendly restrictions
|
|
6
|
+
# - Safe defaults for public projects
|
|
7
|
+
#
|
|
8
|
+
# Features that typically require elevated access are disabled.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: This is a PRESET - host/auth come from environment variables.
|
|
11
|
+
|
|
12
|
+
description: "Optimized for gitlab.com - respects rate limits, safe defaults"
|
|
13
|
+
|
|
14
|
+
read_only: false
|
|
15
|
+
|
|
16
|
+
features:
|
|
17
|
+
wiki: true
|
|
18
|
+
milestones: true
|
|
19
|
+
pipelines: true
|
|
20
|
+
labels: true
|
|
21
|
+
mrs: true
|
|
22
|
+
files: true
|
|
23
|
+
variables: false # Often restricted on public projects
|
|
24
|
+
workitems: true
|
|
25
|
+
webhooks: false # Requires maintainer+ access
|
|
26
|
+
snippets: true
|
|
27
|
+
integrations: false # Requires admin access
|
|
28
|
+
|
|
29
|
+
# Rate-limit friendly restrictions
|
|
30
|
+
denied_actions:
|
|
31
|
+
# Pagination-heavy operations
|
|
32
|
+
- "browse_commits:list"
|
|
33
|
+
- "browse_pipelines:list"
|
|
34
|
+
# Operations that can trigger many API calls
|
|
35
|
+
- "manage_pipeline:retry"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Junior Developer preset - day-to-day development
|
|
2
|
+
#
|
|
3
|
+
# Focused on core development tasks:
|
|
4
|
+
# - Code browsing and file management
|
|
5
|
+
# - Work items and merge requests
|
|
6
|
+
# - Labels and snippets
|
|
7
|
+
#
|
|
8
|
+
# No access to pipelines, variables, or admin features.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: This is a PRESET - host/auth come from environment variables.
|
|
11
|
+
|
|
12
|
+
description: "Junior Developer - code, MRs, basic issue tracking"
|
|
13
|
+
|
|
14
|
+
read_only: false
|
|
15
|
+
|
|
16
|
+
features:
|
|
17
|
+
wiki: false
|
|
18
|
+
milestones: false
|
|
19
|
+
pipelines: false
|
|
20
|
+
labels: true
|
|
21
|
+
mrs: true
|
|
22
|
+
files: true
|
|
23
|
+
variables: false
|
|
24
|
+
workitems: true
|
|
25
|
+
webhooks: false
|
|
26
|
+
snippets: true
|
|
27
|
+
integrations: false
|
|
28
|
+
|
|
29
|
+
# Block pipeline and admin operations
|
|
30
|
+
denied_tools_regex: "^manage_(pipeline|variable|webhook)"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Project Manager preset - planning and tracking
|
|
2
|
+
#
|
|
3
|
+
# Focused on project management:
|
|
4
|
+
# - Work items and milestones
|
|
5
|
+
# - Merge request status tracking
|
|
6
|
+
# - Wiki and documentation
|
|
7
|
+
# - Labels for organization
|
|
8
|
+
#
|
|
9
|
+
# No access to code operations, pipelines, or technical features.
|
|
10
|
+
#
|
|
11
|
+
# NOTE: This is a PRESET - host/auth come from environment variables.
|
|
12
|
+
|
|
13
|
+
description: "Project Manager - planning, tracking, documentation (no code ops)"
|
|
14
|
+
|
|
15
|
+
read_only: false
|
|
16
|
+
|
|
17
|
+
features:
|
|
18
|
+
wiki: true
|
|
19
|
+
milestones: true
|
|
20
|
+
pipelines: false
|
|
21
|
+
labels: true
|
|
22
|
+
mrs: true
|
|
23
|
+
files: false
|
|
24
|
+
variables: false
|
|
25
|
+
workitems: true
|
|
26
|
+
webhooks: false
|
|
27
|
+
snippets: false
|
|
28
|
+
integrations: false
|
|
29
|
+
|
|
30
|
+
# Block code and pipeline operations
|
|
31
|
+
denied_tools_regex: "^manage_(files|pipeline|variable)"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Read-only preset - safe browsing without write access
|
|
2
|
+
#
|
|
3
|
+
# Use this preset when you need to explore a GitLab instance
|
|
4
|
+
# without any risk of modifying data.
|
|
5
|
+
#
|
|
6
|
+
# All write operations (create, update, delete) are blocked.
|
|
7
|
+
#
|
|
8
|
+
# NOTE: This is a PRESET, not a full profile.
|
|
9
|
+
# It does NOT contain host or auth - those come from your
|
|
10
|
+
# environment variables (GITLAB_API_URL, GITLAB_TOKEN).
|
|
11
|
+
|
|
12
|
+
description: "Read-only access - blocks all write operations"
|
|
13
|
+
|
|
14
|
+
read_only: true
|
|
15
|
+
denied_tools_regex: "^manage_|^create_"
|
|
16
|
+
|
|
17
|
+
features:
|
|
18
|
+
wiki: true
|
|
19
|
+
milestones: true
|
|
20
|
+
pipelines: true
|
|
21
|
+
labels: true
|
|
22
|
+
mrs: true
|
|
23
|
+
files: true
|
|
24
|
+
variables: false # Variables often contain secrets
|
|
25
|
+
workitems: true
|
|
26
|
+
webhooks: false # Webhooks are admin-level
|
|
27
|
+
snippets: true
|
|
28
|
+
integrations: false # Integrations are admin-level
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Senior Developer preset - code review and pipeline monitoring
|
|
2
|
+
#
|
|
3
|
+
# Extended access for senior developers:
|
|
4
|
+
# - Full code browsing and file management
|
|
5
|
+
# - Work items and merge requests
|
|
6
|
+
# - Pipeline monitoring (read-only)
|
|
7
|
+
# - Wiki and documentation
|
|
8
|
+
#
|
|
9
|
+
# No control over pipelines, variables, or webhooks.
|
|
10
|
+
#
|
|
11
|
+
# NOTE: This is a PRESET - host/auth come from environment variables.
|
|
12
|
+
|
|
13
|
+
description: "Senior Developer - code review, discussions, pipeline monitoring"
|
|
14
|
+
|
|
15
|
+
read_only: false
|
|
16
|
+
|
|
17
|
+
features:
|
|
18
|
+
wiki: true
|
|
19
|
+
milestones: false
|
|
20
|
+
pipelines: true
|
|
21
|
+
labels: true
|
|
22
|
+
mrs: true
|
|
23
|
+
files: true
|
|
24
|
+
variables: false
|
|
25
|
+
workitems: true
|
|
26
|
+
webhooks: false
|
|
27
|
+
snippets: true
|
|
28
|
+
integrations: false
|
|
29
|
+
|
|
30
|
+
# Block pipeline control and webhook management
|
|
31
|
+
denied_actions:
|
|
32
|
+
- "manage_pipeline:cancel"
|
|
33
|
+
- "manage_pipeline:retry"
|
|
34
|
+
- "manage_webhook:create"
|
|
35
|
+
- "manage_webhook:update"
|
|
36
|
+
- "manage_webhook:delete"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Team Lead preset - planning and oversight
|
|
2
|
+
#
|
|
3
|
+
# Focused on team management:
|
|
4
|
+
# - Planning with milestones and work items
|
|
5
|
+
# - Code review via merge requests
|
|
6
|
+
# - Pipeline monitoring
|
|
7
|
+
# - Wiki and documentation
|
|
8
|
+
#
|
|
9
|
+
# No access to sensitive variables or webhooks.
|
|
10
|
+
#
|
|
11
|
+
# NOTE: This is a PRESET - host/auth come from environment variables.
|
|
12
|
+
|
|
13
|
+
description: "Team Lead - planning, milestones, team oversight, code review"
|
|
14
|
+
|
|
15
|
+
read_only: false
|
|
16
|
+
|
|
17
|
+
features:
|
|
18
|
+
wiki: true
|
|
19
|
+
milestones: true
|
|
20
|
+
pipelines: true
|
|
21
|
+
labels: true
|
|
22
|
+
mrs: true
|
|
23
|
+
files: true
|
|
24
|
+
variables: false
|
|
25
|
+
workitems: true
|
|
26
|
+
webhooks: false
|
|
27
|
+
snippets: true
|
|
28
|
+
integrations: false
|
|
29
|
+
|
|
30
|
+
# Block sensitive operations
|
|
31
|
+
denied_actions:
|
|
32
|
+
- "manage_variable:create"
|
|
33
|
+
- "manage_variable:update"
|
|
34
|
+
- "manage_variable:delete"
|
|
35
|
+
- "manage_webhook:create"
|
|
36
|
+
- "manage_webhook:update"
|
|
37
|
+
- "manage_webhook:delete"
|