fix: support GitPeji tags and interactive helper auth
APT build checks / build-checks (push) Has been cancelled
APT build checks / build-checks (push) Has been cancelled
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"id": 17,
|
||||
"tag_name": "v1.0.0",
|
||||
"target_commitish": "main",
|
||||
"name": "Alta Proxy Tool v1.0.0",
|
||||
"body": "Initial GitPeji release",
|
||||
"draft": false,
|
||||
"prerelease": false,
|
||||
"created_at": "2026-08-19T12:30:00Z",
|
||||
"published_at": "2026-08-19T12:34:56Z",
|
||||
"html_url": "https://git.pejicorp.com/peji/Alta-Proxy-Tool/releases/tag/v1.0.0",
|
||||
"tarball_url": "https://git.pejicorp.com/peji/Alta-Proxy-Tool/archive/v1.0.0.tar.gz",
|
||||
"zipball_url": "https://git.pejicorp.com/peji/Alta-Proxy-Tool/archive/v1.0.0.zip",
|
||||
"assets": []
|
||||
}
|
||||
@@ -65,7 +65,7 @@ test('exports the proxy manager module', () => {
|
||||
assert.doesNotThrow(() => loadModule());
|
||||
});
|
||||
|
||||
test('launches the approved helper directly with exact argv and shell disabled', () => {
|
||||
test('launches the approved helper directly in a visible interactive console', () => {
|
||||
const { manager, calls } = createHarness();
|
||||
|
||||
const result = manager.launchProxy(validRequest());
|
||||
@@ -76,7 +76,7 @@ test('launches the approved helper directly with exact argv and shell disabled',
|
||||
{
|
||||
shell: false,
|
||||
detached: true,
|
||||
stdio: 'ignore',
|
||||
stdio: 'inherit',
|
||||
windowsHide: false
|
||||
}
|
||||
]]);
|
||||
@@ -97,6 +97,8 @@ test('passes username punctuation literally in argv without invoking a shell', (
|
||||
|
||||
assert.equal(calls[0][1][3], username);
|
||||
assert.equal(calls[0][2].shell, false);
|
||||
assert.equal(calls[0][2].stdio, 'inherit');
|
||||
assert.notEqual(calls[0][2].stdio, 'ignore');
|
||||
});
|
||||
|
||||
test('rejects the CRLF calc.exe reproducer in every structured input', () => {
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
const assert = require('node:assert/strict');
|
||||
const test = require('node:test');
|
||||
const { EventEmitter } = require('node:events');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const {
|
||||
LATEST_RELEASE_URL,
|
||||
@@ -30,6 +32,24 @@ async function rejectsWithCode(promise, code) {
|
||||
});
|
||||
}
|
||||
|
||||
test('accepts a live-shape GitPeji v-tag and normalizes it to bare semver', async () => {
|
||||
const fixture = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'gitpeji-latest-release.json'),
|
||||
'utf8',
|
||||
);
|
||||
|
||||
const result = await checkForUpdate({
|
||||
currentVersion: '0.9.0',
|
||||
request: async () => response(fixture),
|
||||
platform: 'win32',
|
||||
arch: 'x64',
|
||||
});
|
||||
|
||||
assert.equal(result.status, 'update-available');
|
||||
assert.equal(result.latestVersion, '1.0.0');
|
||||
assert.equal(result.releaseName, 'Alta Proxy Tool v1.0.0');
|
||||
});
|
||||
|
||||
test('valid update returns only sanitized, check-only metadata', async () => {
|
||||
let requestOptions;
|
||||
const request = async (options) => {
|
||||
@@ -148,7 +168,20 @@ test('redirects and response host drift are rejected', async () => {
|
||||
});
|
||||
|
||||
test('invalid or non-strict semver fails closed', async () => {
|
||||
const invalidVersions = ['v1.2.3', '1.2', '01.2.3', '1.2.3.4', 'latest'];
|
||||
const invalidVersions = [
|
||||
'V1.2.3',
|
||||
'vv1.2.3',
|
||||
' v1.2.3',
|
||||
'v1.2.3 ',
|
||||
'v1.2',
|
||||
'v01.2.3',
|
||||
'v1.2.3.4',
|
||||
'vlatest',
|
||||
'1.2',
|
||||
'01.2.3',
|
||||
'1.2.3.4',
|
||||
'latest',
|
||||
];
|
||||
|
||||
for (const tag_name of invalidVersions) {
|
||||
await rejectsWithCode(
|
||||
|
||||
Reference in New Issue
Block a user