remove naive /api/v4 querying
Signed-off-by: Max Morton <mamorton@paloaltonetworks.com>
This commit is contained in:
@@ -601,12 +601,6 @@ describe('GitlabUrlReader', () => {
|
||||
'https://gitlab.com/api/v4/projects/12345/jobs/artifacts/branch/raw/my/path/to/file.yaml?job=myJob',
|
||||
);
|
||||
});
|
||||
it('should pass API urls naively', async () => {
|
||||
const apiUrl = 'https://gitlab.com/api/v4/my/api/path';
|
||||
await expect(
|
||||
(gitlabProcessor as any).getGitlabFetchUrl(apiUrl)
|
||||
).resolves.toEqual(apiUrl,);
|
||||
});
|
||||
it('should fail on unfamiliar or non-Gitlab urls', async () => {
|
||||
await expect(
|
||||
(gitlabProcessor as any).getGitlabFetchUrl(
|
||||
|
||||
@@ -258,10 +258,6 @@ export class GitlabUrlReader implements UrlReader {
|
||||
}
|
||||
|
||||
private async getGitlabFetchUrl(target: string): Promise<string> {
|
||||
// If the target is a raw API url then trust that no parsing is needed
|
||||
if (target.includes('/api/v4/')) {
|
||||
return target;
|
||||
}
|
||||
// If the target is for a job artifact then go down that path
|
||||
if (target.includes('/-/jobs/artifacts/')) {
|
||||
return this.getGitlabArtifactFetchUrl(target).then(value =>
|
||||
|
||||
Reference in New Issue
Block a user