mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 06:29:28 -07:00
fix: add default main branch to sourcehut provider
This commit is contained in:
parent
65ca35f197
commit
95a08fe464
7 changed files with 39 additions and 24 deletions
15
dist/doip.core.js
vendored
15
dist/doip.core.js
vendored
|
@ -6427,6 +6427,7 @@ var doip = (function (exports, openpgp$2, fetcher) {
|
|||
});
|
||||
|
||||
/*
|
||||
Copyright 2022 tianruiwei
|
||||
Copyright 2024 quaff
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@ -6450,7 +6451,7 @@ var doip = (function (exports, openpgp$2, fetcher) {
|
|||
*/
|
||||
|
||||
|
||||
const reURI = /^https:\/\/git\.sr\.ht\/~([^~]*)\/(.*)\/?/;
|
||||
const reURI = /^https:\/\/git\.sr\.ht\/~([^~/]*)\/([^/]*)(\/tree\/([^/]*))?\/?/;
|
||||
|
||||
/**
|
||||
* @function
|
||||
|
@ -6458,7 +6459,7 @@ var doip = (function (exports, openpgp$2, fetcher) {
|
|||
* @returns {ServiceProvider} The service provider information based on the claim URI
|
||||
*/
|
||||
function processURI (uri) {
|
||||
const match = uri.match(reURI);
|
||||
const [, username, repo, , branch] = uri.match(reURI);
|
||||
|
||||
return new ServiceProvider({
|
||||
about: {
|
||||
|
@ -6467,8 +6468,8 @@ var doip = (function (exports, openpgp$2, fetcher) {
|
|||
homepage: 'https://sourcehut.org'
|
||||
},
|
||||
profile: {
|
||||
display: match[1],
|
||||
uri: `https://sr.ht/~${match[1]}`,
|
||||
display: username,
|
||||
uri: `https://sr.ht/~${username}`,
|
||||
qr: null
|
||||
},
|
||||
claim: {
|
||||
|
@ -6481,7 +6482,7 @@ var doip = (function (exports, openpgp$2, fetcher) {
|
|||
fetcher: Fetcher.HTTP,
|
||||
accessRestriction: ProofAccessRestriction.NONE,
|
||||
data: {
|
||||
url: `https://git.sr.ht/~${match[1]}/${match[2]}/blob/main/proof.md`,
|
||||
url: `https://git.sr.ht/~${username}/${repo}/blob/${branch ?? 'main'}/proof.md`,
|
||||
format: ProofFormat.TEXT
|
||||
}
|
||||
},
|
||||
|
@ -6509,6 +6510,10 @@ var doip = (function (exports, openpgp$2, fetcher) {
|
|||
uri: 'https://git.sr.ht/~alice/keyoxide_proof/',
|
||||
shouldMatch: true
|
||||
},
|
||||
{
|
||||
uri: 'https://git.sr.ht/~alice/proof_repo/tree/master',
|
||||
shouldMatch: true
|
||||
},
|
||||
{
|
||||
uri: 'https://domain.org/alice/keyoxide_proof',
|
||||
shouldMatch: false
|
||||
|
|
2
dist/doip.core.min.js
vendored
2
dist/doip.core.min.js
vendored
File diff suppressed because one or more lines are too long
15
dist/doip.fetchers.js
vendored
15
dist/doip.fetchers.js
vendored
|
@ -11433,6 +11433,7 @@ var doipFetchers = (function (exports) {
|
|||
});
|
||||
|
||||
/*
|
||||
Copyright 2022 tianruiwei
|
||||
Copyright 2024 quaff
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@ -11456,7 +11457,7 @@ var doipFetchers = (function (exports) {
|
|||
*/
|
||||
|
||||
|
||||
const reURI$1 = /^https:\/\/git\.sr\.ht\/~([^~]*)\/(.*)\/?/;
|
||||
const reURI$1 = /^https:\/\/git\.sr\.ht\/~([^~/]*)\/([^/]*)(\/tree\/([^/]*))?\/?/;
|
||||
|
||||
/**
|
||||
* @function
|
||||
|
@ -11464,7 +11465,7 @@ var doipFetchers = (function (exports) {
|
|||
* @returns {ServiceProvider} The service provider information based on the claim URI
|
||||
*/
|
||||
function processURI (uri) {
|
||||
const match = uri.match(reURI$1);
|
||||
const [, username, repo, , branch] = uri.match(reURI$1);
|
||||
|
||||
return new ServiceProvider({
|
||||
about: {
|
||||
|
@ -11473,8 +11474,8 @@ var doipFetchers = (function (exports) {
|
|||
homepage: 'https://sourcehut.org'
|
||||
},
|
||||
profile: {
|
||||
display: match[1],
|
||||
uri: `https://sr.ht/~${match[1]}`,
|
||||
display: username,
|
||||
uri: `https://sr.ht/~${username}`,
|
||||
qr: null
|
||||
},
|
||||
claim: {
|
||||
|
@ -11487,7 +11488,7 @@ var doipFetchers = (function (exports) {
|
|||
fetcher: Fetcher.HTTP,
|
||||
accessRestriction: ProofAccessRestriction.NONE,
|
||||
data: {
|
||||
url: `https://git.sr.ht/~${match[1]}/${match[2]}/blob/main/proof.md`,
|
||||
url: `https://git.sr.ht/~${username}/${repo}/blob/${branch ?? 'main'}/proof.md`,
|
||||
format: ProofFormat.TEXT
|
||||
}
|
||||
},
|
||||
|
@ -11515,6 +11516,10 @@ var doipFetchers = (function (exports) {
|
|||
uri: 'https://git.sr.ht/~alice/keyoxide_proof/',
|
||||
shouldMatch: true
|
||||
},
|
||||
{
|
||||
uri: 'https://git.sr.ht/~alice/proof_repo/tree/master',
|
||||
shouldMatch: true
|
||||
},
|
||||
{
|
||||
uri: 'https://domain.org/alice/keyoxide_proof',
|
||||
shouldMatch: false
|
||||
|
|
6
dist/doip.fetchers.min.js
vendored
6
dist/doip.fetchers.min.js
vendored
File diff suppressed because one or more lines are too long
15
dist/doip.fetchers.minimal.js
vendored
15
dist/doip.fetchers.minimal.js
vendored
|
@ -11419,6 +11419,7 @@ var doipFetchers = (function (exports) {
|
|||
});
|
||||
|
||||
/*
|
||||
Copyright 2022 tianruiwei
|
||||
Copyright 2024 quaff
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@ -11442,7 +11443,7 @@ var doipFetchers = (function (exports) {
|
|||
*/
|
||||
|
||||
|
||||
const reURI$1 = /^https:\/\/git\.sr\.ht\/~([^~]*)\/(.*)\/?/;
|
||||
const reURI$1 = /^https:\/\/git\.sr\.ht\/~([^~/]*)\/([^/]*)(\/tree\/([^/]*))?\/?/;
|
||||
|
||||
/**
|
||||
* @function
|
||||
|
@ -11450,7 +11451,7 @@ var doipFetchers = (function (exports) {
|
|||
* @returns {ServiceProvider} The service provider information based on the claim URI
|
||||
*/
|
||||
function processURI (uri) {
|
||||
const match = uri.match(reURI$1);
|
||||
const [, username, repo, , branch] = uri.match(reURI$1);
|
||||
|
||||
return new ServiceProvider({
|
||||
about: {
|
||||
|
@ -11459,8 +11460,8 @@ var doipFetchers = (function (exports) {
|
|||
homepage: 'https://sourcehut.org'
|
||||
},
|
||||
profile: {
|
||||
display: match[1],
|
||||
uri: `https://sr.ht/~${match[1]}`,
|
||||
display: username,
|
||||
uri: `https://sr.ht/~${username}`,
|
||||
qr: null
|
||||
},
|
||||
claim: {
|
||||
|
@ -11473,7 +11474,7 @@ var doipFetchers = (function (exports) {
|
|||
fetcher: Fetcher.HTTP,
|
||||
accessRestriction: ProofAccessRestriction.NONE,
|
||||
data: {
|
||||
url: `https://git.sr.ht/~${match[1]}/${match[2]}/blob/main/proof.md`,
|
||||
url: `https://git.sr.ht/~${username}/${repo}/blob/${branch ?? 'main'}/proof.md`,
|
||||
format: ProofFormat.TEXT
|
||||
}
|
||||
},
|
||||
|
@ -11501,6 +11502,10 @@ var doipFetchers = (function (exports) {
|
|||
uri: 'https://git.sr.ht/~alice/keyoxide_proof/',
|
||||
shouldMatch: true
|
||||
},
|
||||
{
|
||||
uri: 'https://git.sr.ht/~alice/proof_repo/tree/master',
|
||||
shouldMatch: true
|
||||
},
|
||||
{
|
||||
uri: 'https://domain.org/alice/keyoxide_proof',
|
||||
shouldMatch: false
|
||||
|
|
6
dist/doip.fetchers.minimal.min.js
vendored
6
dist/doip.fetchers.minimal.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Copyright 2024 quaff
|
||||
Copyright 2022 tianruiwei
|
||||
Copyright 2024 quaff
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -56,7 +56,7 @@ export function processURI (uri) {
|
|||
fetcher: E.Fetcher.HTTP,
|
||||
accessRestriction: E.ProofAccessRestriction.NONE,
|
||||
data: {
|
||||
url: `https://git.sr.ht/~${username}/${repo}/blob/${branch}/proof.md`,
|
||||
url: `https://git.sr.ht/~${username}/${repo}/blob/${branch ?? 'main'}/proof.md`,
|
||||
format: E.ProofFormat.TEXT
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue