From 2862f91f6016bd07fd9adc0a0f518258a32aa274 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 15 Jan 2018 23:17:30 +0300 Subject: Adapt to adding type prefix for repository canonical name --- bpkg/auth.cxx | 5 ++++- bpkg/rep-add.cxx | 2 -- bpkg/repository-signing.cli | 13 +++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'bpkg') 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 c (split (cert.name)); - pair r (split (rl.canonical_name ())); + + // Strip 'bpkg:' prefix. + // + pair 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 root (db.load ("")); if (!root->complements.insert (lazy_shared_ptr (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 -- cgit v1.1