diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-01-15 23:17:30 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-01-15 23:17:30 +0300 |
commit | 2862f91f6016bd07fd9adc0a0f518258a32aa274 (patch) | |
tree | 79c9e69f8e5e60955ac0c3f1962d88307d0a6220 /bpkg | |
parent | 42ae47c3033a8c9ce70f1e6fb4c88ed70ac679fb (diff) |
Adapt to adding type prefix for repository canonical name
Diffstat (limited to 'bpkg')
-rw-r--r-- | bpkg/auth.cxx | 5 | ||||
-rw-r--r-- | bpkg/rep-add.cxx | 2 | ||||
-rw-r--r-- | bpkg/repository-signing.cli | 13 |
3 files changed, 11 insertions, 9 deletions
diff --git a/bpkg/auth.cxx b/bpkg/auth.cxx index da4d0b5..82e17ec 100644 --- a/bpkg/auth.cxx +++ b/bpkg/auth.cxx @@ -699,7 +699,10 @@ namespace bpkg }; pair<string, string> c (split (cert.name)); - pair<string, string> r (split (rl.canonical_name ())); + + // Strip 'bpkg:' prefix. + // + pair<string, string> r (split (rl.canonical_name ().substr (5))); // Match the repository canonical name leading part. // diff --git a/bpkg/rep-add.cxx b/bpkg/rep-add.cxx index d18536f..7adb843 100644 --- a/bpkg/rep-add.cxx +++ b/bpkg/rep-add.cxx @@ -56,9 +56,7 @@ namespace bpkg shared_ptr<repository> root (db.load<repository> ("")); if (!root->complements.insert (lazy_shared_ptr<repository> (db, r)).second) - { fail << rn << " is already a repository of this configuration"; - } db.update (root); t.commit (); diff --git a/bpkg/repository-signing.cli b/bpkg/repository-signing.cli index d4d32a6..f6ee7fa 100644 --- a/bpkg/repository-signing.cli +++ b/bpkg/repository-signing.cli @@ -92,12 +92,13 @@ it. Also use a working email address in case users need to contact you about issues with your certificate. Note that the \cb{name:} prefix in the \cb{CN} value is not a typo. -The \cb{name} field is a canonical repository name prefix. Any repository with -a canonical name that starts with this prefix can be authenticated by this -certificate (see the repository manifest documentation for more information on -canonical names). For example, name \cb{example.com} will match any -repository hosted on \cb{{,www.,pkg.,bpkg.\}example.com}. While name -\cb{example.com/math} will match \cb{{...\}example.com/pkg/1/math} but not +The \cb{name} field is a canonical repository name prefix with the \cb{bpkg:} +type part stripped. Any repository with a canonical name that starts with this +prefix can be authenticated by this certificate (see the repository manifest +documentation for more information on canonical names). For example, name +\cb{example.com} will match any repository hosted on +\cb{{,www.,pkg.,bpkg.\}example.com}. While name \cb{example.com/math} will +match \cb{{...\}example.com/pkg/1/math} but not \cb{{...\}example.com/pkg/1/misc}. A certificate name can also contain a subdomain wildcard. A wildcard name in |