Skip to content

Commit df87a30

Browse files
committed
chore: merge PR #987 with conflict resolution
2 parents 053d39e + 7a6b7a7 commit df87a30

File tree

129 files changed

+4040
-2485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+4040
-2485
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
- name: Check Types (Server)
5151
run: npm run check-types:server
5252

53+
- name: Build TypeScript
54+
run: npm run build-ts
55+
5356
- name: Test
5457
id: test
5558
run: |

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
# Initializes the CodeQL tools for scanning.
6262
- name: Initialize CodeQL
63-
uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3
63+
uses: github/codeql-action/init@42213152a85ae7569bdb6bec7bcd74cd691bfe41 # v3
6464
with:
6565
languages: ${{ matrix.language }}
6666
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -73,7 +73,7 @@ jobs:
7373
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
7474
# If this step fails, then you should remove it and run the build manually (see below)
7575
- name: Autobuild
76-
uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3
76+
uses: github/codeql-action/autobuild@42213152a85ae7569bdb6bec7bcd74cd691bfe41 # v3
7777

7878
# ℹ️ Command-line programs to run using the OS shell.
7979
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -86,6 +86,6 @@ jobs:
8686
# ./location_of_script_within_repo/buildscript.sh
8787

8888
- name: Perform CodeQL Analysis
89-
uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3
89+
uses: github/codeql-action/analyze@42213152a85ae7569bdb6bec7bcd74cd691bfe41 # v3
9090
with:
9191
category: '/language:${{matrix.language}}'

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: 'Checkout Repository'
1818
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
1919
- name: Dependency Review
20-
uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4
20+
uses: actions/dependency-review-action@45529485b5eb76184ced07362d2331fd9d26f03f # v4
2121
with:
2222
comment-summary-in-pr: always
2323
fail-on-severity: high

.github/workflows/sample-publish.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,32 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
build:
12+
build-and-publish:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Harden Runner
1616
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
1717
with:
1818
egress-policy: audit
19-
2019
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2120
# Setup .npmrc file to publish to npm
2221
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
2322
with:
2423
node-version: '22.x'
2524
registry-url: 'https://registry.npmjs.org'
26-
- name: publish sample package
27-
run: npm install --include peer && npm publish --access=public
25+
26+
- name: Install dependencies
27+
working-directory: plugins/git-proxy-plugin-samples
28+
run: npm ci
29+
30+
- name: Build TypeScript
31+
working-directory: plugins/git-proxy-plugin-samples
32+
run: npm run build
33+
34+
- name: Install peers and publish
2835
working-directory: plugins/git-proxy-plugin-samples
36+
run: |
37+
npm install --include=peer
38+
npm publish --provenance --access=public
2939
env:
3040
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
persist-credentials: false
4343

4444
- name: 'Run analysis'
45-
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
45+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
4646
with:
4747
results_file: results.sarif
4848
results_format: sarif
@@ -72,6 +72,6 @@ jobs:
7272

7373
# Upload the results to GitHub's code scanning dashboard.
7474
- name: 'Upload to code-scanning'
75-
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
75+
uses: github/codeql-action/upload-sarif@42213152a85ae7569bdb6bec7bcd74cd691bfe41 # v3.30.9
7676
with:
7777
sarif_file: results.sarif

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,9 @@ website/.docusaurus
274274

275275
# Test SSH keys (generated during tests)
276276
test/keys/
277+
278+
# VS COde IDE
279+
.vscode/settings.json
280+
281+
# Generated from testing
282+
/test/fixtures/test-package/package-lock.json

.npmignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# This file required to override .gitignore when publishing to npm
2+
src/
3+
tests/
4+
*.test.ts
5+
6+
tsconfig.json
7+
jest.config.js
8+
.eslintrc.js
9+
.prettierrc
10+
211
website/
312
plugins/
4-
experimental/
5-
cypress/

SSH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### SSH Git Proxy Data Flow
1+
### GitProxy SSH Data Flow
22

33
1. **Client Connection:**
44
- An SSH client (e.g., `git` command line) connects to the proxy server's listening port.

config.schema.json

Lines changed: 191 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"properties": {
88
"proxyUrl": {
99
"type": "string",
10-
"description": "Deprecated: Used in early versions of git proxy to configure the remote host that traffic is proxied to. In later versions, the repository URL is used to determine the domain proxied, allowing multiple hosts to be proxied by one instance.",
10+
"description": "Deprecated: Used in early versions of GitProxy to configure the remote host that traffic is proxied to. In later versions, the repository URL is used to determine the domain proxied, allowing multiple hosts to be proxied by one instance.",
1111
"deprecated": true
1212
},
1313
"cookieSecret": { "type": "string" },
@@ -30,19 +30,6 @@
3030
},
3131
"additionalProperties": false
3232
},
33-
"github": {
34-
"type": "object",
35-
"description": "Deprecated: Defunct property that was used to provide the API URL for GitHub. No longer referenced in the codebase.",
36-
"properties": {
37-
"baseUrl": {
38-
"type": "string",
39-
"format": "uri",
40-
"examples": ["https://api.github.com"],
41-
"deprecated": true
42-
}
43-
},
44-
"additionalProperties": false
45-
},
4633
"gitleaks": {
4734
"type": "object",
4835
"description": "Configuration for the gitleaks (https://github.com/gitleaks/gitleaks) plugin",
@@ -57,16 +44,188 @@
5744
"additionalProperties": false
5845
},
5946
"commitConfig": {
60-
"description": "Enforce rules and patterns on commits including e-mail and message",
61-
"type": "object"
47+
"title": "CommitConfig",
48+
"description": "Block commits based on rules defined over author/committer e-mail addresses, commit message content and diff content",
49+
"type": "object",
50+
"additionalProperties": false,
51+
"properties": {
52+
"author": {
53+
"title": "Author",
54+
"description": "Rules applied to commit authors",
55+
"type": "object",
56+
"additionalProperties": false,
57+
"properties": {
58+
"email": {
59+
"title": "Email",
60+
"description": "Rules applied to author email addresses",
61+
"type": "object",
62+
"additionalProperties": false,
63+
"properties": {
64+
"local": {
65+
"title": "Local",
66+
"description": "Rules applied to the local portion of the email address (i.e. section before the @ symbol)",
67+
"type": "object",
68+
"additionalProperties": false,
69+
"properties": {
70+
"block": {
71+
"title": "Block",
72+
"description": "Block commits with author email addresses where the first part matches this regular expression",
73+
"type": "string"
74+
}
75+
},
76+
"required": []
77+
},
78+
"domain": {
79+
"title": "Domain",
80+
"description": "Rules applied to the domain portion of the email address (i.e. section after the @ symbol)",
81+
"type": "object",
82+
"additionalProperties": false,
83+
"properties": {
84+
"allow": {
85+
"title": "Allow",
86+
"description": "Allow only commits where the domain part of the email address matches this regular expression",
87+
"type": "string"
88+
}
89+
},
90+
"required": []
91+
}
92+
},
93+
"required": []
94+
}
95+
},
96+
"required": []
97+
},
98+
"message": {
99+
"title": "Message",
100+
"description": "Rules applied to commit messages",
101+
"type": "object",
102+
"additionalProperties": false,
103+
"properties": {
104+
"block": {
105+
"title": "MessageBlock",
106+
"description": "Block commits where the commit message matches any of the given patterns",
107+
"type": "object",
108+
"additionalProperties": false,
109+
"properties": {
110+
"literals": {
111+
"title": "MessageBlockLiteral",
112+
"description": "Block commits where the commit message contains any of the given string literals",
113+
"type": "array",
114+
"items": { "type": "string" }
115+
},
116+
"patterns": {
117+
"title": "MessageBlockLiteral",
118+
"description": "Block commits where the commit message matches any of the given regular expressions",
119+
"type": "array",
120+
"items": { "type": "string" }
121+
}
122+
},
123+
"required": []
124+
}
125+
},
126+
"required": []
127+
},
128+
"diff": {
129+
"title": "Diff",
130+
"description": "Rules applied to commit diff content",
131+
"type": "object",
132+
"additionalProperties": false,
133+
"properties": {
134+
"block": {
135+
"title": "DiffBlock",
136+
"description": "Block commits where the commit diff matches any of the given patterns",
137+
"type": "object",
138+
"additionalProperties": false,
139+
"properties": {
140+
"literals": {
141+
"title": "DiffBlockLiteral",
142+
"description": "Block commits where the commit diff content contains any of the given string literals",
143+
"type": "array",
144+
"items": {
145+
"type": "string"
146+
}
147+
},
148+
"patterns": {
149+
"title": "MessageBlockPatterns",
150+
"description": "Block commits where the commit diff content matches any of the given regular expressions",
151+
"type": "array",
152+
"items": {}
153+
},
154+
"providers": {
155+
"title": "MessageBlockProviders",
156+
"description": "Block commits where the commit diff content matches any of the given regular expressions, except where the repository path (project/organisation) matches one of the listed privateOrganisations. The keys in this array are listed as the block type in logs.",
157+
"type": "object",
158+
"additionalProperties": { "type": "string" }
159+
}
160+
},
161+
"required": []
162+
}
163+
},
164+
"required": []
165+
}
166+
},
167+
"required": []
62168
},
63169
"attestationConfig": {
64-
"description": "Customisable questions to add to attestation form",
65-
"type": "object"
170+
"title": "AttestationConfig",
171+
"description": "Configuration for the attestation form displayed to reviewers. Reviewers will need to check the box next to each question in order to complete the review attestation.",
172+
"type": "object",
173+
"additionalProperties": false,
174+
"properties": {
175+
"questions": {
176+
"title": "AttestationQuestions",
177+
"description": "Customisable attestation questions to add to attestation form.",
178+
"type": "array",
179+
"items": {
180+
"type": "object",
181+
"additionalProperties": false,
182+
"properties": {
183+
"label": {
184+
"title": "QuestionLabel",
185+
"description": "The text of the question that will be displayed to the reviewer",
186+
"type": "string"
187+
},
188+
"tooltip": {
189+
"title": "QuestionTooltip",
190+
"description": "A tooltip and optional set of links that will be displayed on mouseover of the question and used to provide additional guidance to the reviewer.",
191+
"type": "object",
192+
"additionalProperties": false,
193+
"properties": {
194+
"text": {
195+
"type": "string"
196+
},
197+
"links": {
198+
"type": "array",
199+
"items": { "type": "string", "format": "url" }
200+
}
201+
},
202+
"required": ["text"]
203+
}
204+
},
205+
"required": ["label", "tooltip"],
206+
"title": "Question"
207+
}
208+
}
209+
},
210+
"required": []
66211
},
67212
"domains": {
68-
"description": "Provide domains to use alternative to the defaults",
69-
"type": "object"
213+
"description": "Provide custom URLs for the GitProxy interfaces in case it cannot determine its own URL",
214+
"type": "object",
215+
"properties": {
216+
"proxy": {
217+
"title": "ProxyUrl",
218+
"description": "Override for the default proxy URL, should include the protocol",
219+
"type": "string",
220+
"format": "url"
221+
},
222+
"service": {
223+
"title": "Service UI URL",
224+
"description": "Override for the service UI URL, should include the protocol",
225+
"type": "string",
226+
"format": "url"
227+
}
228+
}
70229
},
71230
"rateLimit": {
72231
"description": "API Rate limiting configuration.",
@@ -93,7 +252,7 @@
93252
"additionalProperties": false
94253
},
95254
"privateOrganizations": {
96-
"description": "Pattern searches for listed private organizations are disabled",
255+
"description": "Provider searches for listed private organizations are disabled, see commitConfig.diff.block.providers",
97256
"type": "array"
98257
},
99258
"urlShortener": {
@@ -122,6 +281,16 @@
122281
"$ref": "#/definitions/authorisedRepo"
123282
}
124283
},
284+
"limits": {
285+
"description": "Configuration for various limits",
286+
"type": "object",
287+
"properties": {
288+
"maxPackSizeBytes": {
289+
"type": "number",
290+
"description": "Maximum size of a pack file in bytes (default 1GB)"
291+
}
292+
}
293+
},
125294
"sink": {
126295
"description": "List of database sources. The first source in the configuration with enabled=true will be used.",
127296
"type": "array",
@@ -279,7 +448,7 @@
279448
},
280449
"userGroup": {
281450
"type": "string",
282-
"description": "Group that indicates that a user should be able to login to the Git Proxy UI and can work as a reviewer"
451+
"description": "Group that indicates that a user should be able to login to the GitProxy UI and can work as a reviewer"
283452
},
284453
"domain": { "type": "string", "description": "Active Directory domain" },
285454
"adConfig": {

cypress/e2e/login.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ describe('Login page', () => {
33
cy.visit('/login');
44
});
55

6-
it('should have git proxy logo', () => {
6+
it('should have GitProxy logo', () => {
77
cy.get('[data-test="git-proxy-logo"]').should('exist');
88
});
99

0 commit comments

Comments
 (0)