From eb72827887911361817111afba2b4185a6149f66 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Wed, 18 Jan 2023 13:56:37 +0100 Subject: [PATCH] Remove gitea repo name restriction --- src/claimDefinitions/gitea.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/claimDefinitions/gitea.js b/src/claimDefinitions/gitea.js index cc8110e..6cecc72 100644 --- a/src/claimDefinitions/gitea.js +++ b/src/claimDefinitions/gitea.js @@ -15,7 +15,7 @@ limitations under the License. */ const E = require('../enums') -const reURI = /^https:\/\/(.*)\/(.*)\/gitea_proof\/?/ +const reURI = /^https:\/\/(.*)\/(.*)\/(.*)\/?/ const processURI = (uri) => { const match = uri.match(reURI) @@ -41,7 +41,7 @@ const processURI = (uri) => { access: E.ProofAccess.NOCORS, format: E.ProofFormat.JSON, data: { - url: `https://${match[1]}/api/v1/repos/${match[2]}/gitea_proof`, + url: `https://${match[1]}/api/v1/repos/${match[2]}/${match[3]}`, format: E.ProofFormat.JSON } } @@ -65,6 +65,10 @@ const tests = [ }, { uri: 'https://domain.org/alice/other_proof', + shouldMatch: true + }, + { + uri: 'https://domain.org/alice', shouldMatch: false } ]