Skip to content

Commit 7a6b7a7

Browse files
committed
chore: improve 401 error messages and normalize GitProxy spelling
1 parent 1ccae5f commit 7a6b7a7

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

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: 3 additions & 3 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" },
@@ -210,7 +210,7 @@
210210
"required": []
211211
},
212212
"domains": {
213-
"description": "Provide custom URLs for the git proxy interfaces in case it cannot determine its own URL",
213+
"description": "Provide custom URLs for the GitProxy interfaces in case it cannot determine its own URL",
214214
"type": "object",
215215
"properties": {
216216
"proxy": {
@@ -448,7 +448,7 @@
448448
},
449449
"userGroup": {
450450
"type": "string",
451-
"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"
452452
},
453453
"domain": { "type": "string", "description": "Active Directory domain" },
454454
"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

docs/SSH_KEY_RETENTION.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# SSH Key Retention for Git Proxy
1+
# SSH Key Retention for GitProxy
22

33
## Overview
44

5-
This document describes the SSH key retention feature that allows Git Proxy to securely store and reuse user SSH keys during the approval process, eliminating the need for users to re-authenticate when their push is approved.
5+
This document describes the SSH key retention feature that allows GitProxy to securely store and reuse user SSH keys during the approval process, eliminating the need for users to re-authenticate when their push is approved.
66

77
## Problem Statement
88

9-
Previously, when a user pushes code via SSH to Git Proxy:
9+
Previously, when a user pushes code via SSH to GitProxy:
1010

1111
1. User authenticates with their SSH key
1212
2. Push is intercepted and requires approval

packages/git-proxy-cli/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async function authoriseGitPush(id: string) {
203203
if (error.response) {
204204
switch (error.response.status) {
205205
case 401:
206-
errorMessage = 'Error: Authorise: Authentication required';
206+
errorMessage = `Error: Authorise: Authentication required: '${error.response.data.message}'`;
207207
process.exitCode = 3;
208208
break;
209209
case 404:
@@ -250,7 +250,7 @@ async function rejectGitPush(id: string) {
250250
if (error.response) {
251251
switch (error.response.status) {
252252
case 401:
253-
errorMessage = 'Error: Reject: Authentication required';
253+
errorMessage = `Error: Reject: Authentication required: '${error.response.data.message}'`;
254254
process.exitCode = 3;
255255
break;
256256
case 404:
@@ -297,7 +297,7 @@ async function cancelGitPush(id: string) {
297297
if (error.response) {
298298
switch (error.response.status) {
299299
case 401:
300-
errorMessage = 'Error: Cancel: Authentication required';
300+
errorMessage = `Error: Cancel: Authentication required: '${error.response.data.message}'`;
301301
process.exitCode = 3;
302302
break;
303303
case 404:
@@ -372,7 +372,7 @@ async function addSSHKey(username: string, keyPath: string) {
372372
if (error.response) {
373373
switch (error.response.status) {
374374
case 401:
375-
errorMessage = 'Error: SSH key: Authentication required';
375+
errorMessage = `Error: SSH key: Authentication required: '${error.response.data.message}'`;
376376
process.exitCode = 3;
377377
break;
378378
case 404:

src/config/generated/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface GitProxyConfig {
5252
*/
5353
csrfProtection?: boolean;
5454
/**
55-
* Provide custom URLs for the git proxy interfaces in case it cannot determine its own URL
55+
* Provide custom URLs for the GitProxy interfaces in case it cannot determine its own URL
5656
*/
5757
domains?: Domains;
5858
/**
@@ -70,7 +70,7 @@ export interface GitProxyConfig {
7070
*/
7171
privateOrganizations?: any[];
7272
/**
73-
* Deprecated: Used in early versions of git proxy to configure the remote host that traffic
73+
* Deprecated: Used in early versions of GitProxy to configure the remote host that traffic
7474
* is proxied to. In later versions, the repository URL is used to determine the domain
7575
* proxied, allowing multiple hosts to be proxied by one instance.
7676
*/
@@ -184,7 +184,7 @@ export interface AuthenticationElement {
184184
*/
185185
domain?: string;
186186
/**
187-
* Group that indicates that a user should be able to login to the Git Proxy UI and can work
187+
* Group that indicates that a user should be able to login to the GitProxy UI and can work
188188
* as a reviewer
189189
*/
190190
userGroup?: string;
@@ -414,7 +414,7 @@ export interface MessageBlock {
414414
}
415415

416416
/**
417-
* Provide custom URLs for the git proxy interfaces in case it cannot determine its own URL
417+
* Provide custom URLs for the GitProxy interfaces in case it cannot determine its own URL
418418
*/
419419
export interface Domains {
420420
/**

src/service/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const corsOptions = {
2828
};
2929

3030
/**
31-
* Internal function used to bootstrap the Git Proxy API's express application.
31+
* Internal function used to bootstrap GitProxy's API express application.
3232
* @param {Proxy} proxy A reference to the proxy, used to restart it when necessary.
3333
* @return {Promise<Express>} the express application
3434
*/

0 commit comments

Comments
 (0)