aboutsummaryrefslogtreecommitdiff
path: root/brep
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-07-12 17:26:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-07-14 18:07:18 +0300
commite60108713590ccee83da7e2581a43fd5fda5c8ce (patch)
tree59650cce83b69e527040560482bba7c8513ab17e /brep
parent8701276b3d98b5c6f927e2865ee6a915296033c1 (diff)
Add repository certificate info to the About page
Diffstat (limited to 'brep')
-rw-r--r--brep/package37
-rw-r--r--brep/package.cxx9
-rw-r--r--brep/package.xml9
3 files changed, 42 insertions, 13 deletions
diff --git a/brep/package b/brep/package
index d7b87c8..5cfbd45 100644
--- a/brep/package
+++ b/brep/package
@@ -19,9 +19,9 @@
// Used by the data migration entries.
//
-#define LIBBREP_SCHEMA_VERSION_BASE 2
+#define LIBBREP_SCHEMA_VERSION_BASE 3
-#pragma db model version(LIBBREP_SCHEMA_VERSION_BASE, 2, closed)
+#pragma db model version(LIBBREP_SCHEMA_VERSION_BASE, 3, open)
// The uint16_t value range is not fully covered by SMALLINT PostgreSQL type
// to which uint16_t is mapped by default.
@@ -279,15 +279,17 @@ namespace brep
// tricky. Can stick to just a package name until get some clarity on
// "foreign" package resolution.
//
- // 4. As we left just the the package class the dependency resolution come to
+ // 4. As we left just the package class the dependency resolution come to
// finding the best version matching package object. The question is
// if to resolve dependencies on the loading phase or in the WEB interface
// when required. The arguments in favour of doing that during loading
// phase are:
- // * WEB interface get offloaded from a possibly expensive queries
+ //
+ // - WEB interface get offloaded from a possibly expensive queries
// which otherwise have to be executed multiple times for the same
// dependency no matter the result would be the same.
- // * No need to complicate persisted object model with repository
+ //
+ // - No need to complicate persisted object model with repository
// relations otherwise required just for dependency resolution.
//
@@ -349,17 +351,30 @@ namespace brep
#pragma db map type(repository_location) as(string) \
to((?).string ()) from(brep::repository_location (?))
+ #pragma db value
+ class certificate
+ {
+ public:
+ string fingerprint; // SHA256 fingerprint.
+ string name; // CN component of Subject.
+ string organization; // O component of Subject.
+ string email; // email: in Subject Alternative Name.
+ string pem; // PEM representation.
+ };
+
#pragma db object pointer(shared_ptr) session
class repository
{
public:
using email_type = brep::email;
+ using certificate_type = brep::certificate;
// Create internal repository.
//
repository (repository_location,
string display_name,
- dir_path local_path,
+ repository_location cache_location,
+ optional<certificate_type>,
uint16_t priority);
// Create external repository.
@@ -384,10 +399,14 @@ namespace brep
optional<string> summary;
optional<string> description;
- // Non empty for internal repositories and external ones with a filesystem
- // path location.
+ // Location of the repository local cache. Non empty for internal
+ // repositories and external ones with a filesystem path location.
+ //
+ repository_location cache_location;
+
+ // Present only for internal signed repositories.
//
- dir_path local_path;
+ optional<certificate_type> certificate;
// Initialized with timestamp_nonexistent by default.
//
diff --git a/brep/package.cxx b/brep/package.cxx
index d1bbe21..9cf0783 100644
--- a/brep/package.cxx
+++ b/brep/package.cxx
@@ -141,12 +141,17 @@ namespace brep
// repository
//
repository::
- repository (repository_location l, string d, dir_path p, uint16_t r)
+ repository (repository_location l,
+ string d,
+ repository_location h,
+ optional<certificate_type> c,
+ uint16_t r)
: name (l.canonical_name ()),
location (move (l)),
display_name (move (d)),
priority (r),
- local_path (move (p)),
+ cache_location (move (h)),
+ certificate (move (c)),
internal (true)
{
}
diff --git a/brep/package.xml b/brep/package.xml
index 14598a5..98c0f02 100644
--- a/brep/package.xml
+++ b/brep/package.xml
@@ -1,5 +1,5 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" version="1">
- <model version="2">
+ <model version="3">
<table name="repository" kind="object">
<column name="name" type="TEXT" null="false"/>
<column name="location" type="TEXT" null="false"/>
@@ -10,7 +10,12 @@
<column name="email_comment" type="TEXT" null="true"/>
<column name="summary" type="TEXT" null="true"/>
<column name="description" type="TEXT" null="true"/>
- <column name="local_path" type="TEXT" null="false"/>
+ <column name="cache_location" type="TEXT" null="false"/>
+ <column name="certificate_fingerprint" type="TEXT" null="true"/>
+ <column name="certificate_name" type="TEXT" null="true"/>
+ <column name="certificate_organization" type="TEXT" null="true"/>
+ <column name="certificate_email" type="TEXT" null="true"/>
+ <column name="certificate_pem" type="TEXT" null="true"/>
<column name="packages_timestamp" type="BIGINT" null="false"/>
<column name="repositories_timestamp" type="BIGINT" null="false"/>
<column name="internal" type="BOOLEAN" null="false"/>