feat(auth): Implement HMAC-SHA256 OCI JWTs; enhance PyPI & RubyGems uploads and normalize responses

This commit is contained in:
2025-11-25 14:28:19 +00:00
parent 2d6059ba7f
commit 547c262578
14 changed files with 765 additions and 158 deletions

View File

@@ -99,7 +99,7 @@ tap.test('PyPI: should retrieve Simple API root index HTML (GET /simple/)', asyn
});
expect(response.status).toEqual(200);
expect(response.headers['Content-Type']).toEqual('text/html');
expect(response.headers['Content-Type']).toStartWith('text/html');
expect(response.body).toBeTypeOf('string');
const html = response.body as string;
@@ -125,8 +125,10 @@ tap.test('PyPI: should retrieve Simple API root index JSON (GET /simple/ with Ac
const json = response.body as any;
expect(json).toHaveProperty('meta');
expect(json).toHaveProperty('projects');
expect(json.projects).toBeTypeOf('object');
expect(json.projects).toHaveProperty(normalizedPackageName);
expect(json.projects).toBeInstanceOf(Array);
// Check that the package is in the projects list (PEP 691 format: array of { name } objects)
const packageNames = json.projects.map((p: any) => p.name);
expect(packageNames).toContain(normalizedPackageName);
});
tap.test('PyPI: should retrieve Simple API package HTML (GET /simple/{package}/)', async () => {
@@ -140,7 +142,7 @@ tap.test('PyPI: should retrieve Simple API package HTML (GET /simple/{package}/)
});
expect(response.status).toEqual(200);
expect(response.headers['Content-Type']).toEqual('text/html');
expect(response.headers['Content-Type']).toStartWith('text/html');
expect(response.body).toBeTypeOf('string');
const html = response.body as string;