You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/05/14 12:46:00 UTC

[GitHub] [couchdb] eiri opened a new pull request #2885: Add aegis info to db_info

eiri opened a new pull request #2885:
URL: https://github.com/apache/couchdb/pull/2885


   ## Overview
   
   This adds another function `get_db_info` to aegis key manager behaviour that allows to supply db_info with aegis specific information
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] eiri commented on pull request #2885: Add aegis info to db_info

Posted by GitBox <gi...@apache.org>.
eiri commented on pull request #2885:
URL: https://github.com/apache/couchdb/pull/2885#issuecomment-630785053


   @rnewson ok, I'll wait with the merge then until we add aegis key manager example module we discussed before.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] eiri closed pull request #2885: Add aegis info to db_info

Posted by GitBox <gi...@apache.org>.
eiri closed pull request #2885:
URL: https://github.com/apache/couchdb/pull/2885


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] eiri commented on pull request #2885: Add aegis info to db_info

Posted by GitBox <gi...@apache.org>.
eiri commented on pull request #2885:
URL: https://github.com/apache/couchdb/pull/2885#issuecomment-628628922


   @rnewson Can you take a look, please, if you have time?
   
   In "real" key manger this could be used with something like this:
   
   ```erlang
   get_db_info(#{} = Db) ->
       #{
           tx := Tx,
           db_prefix := DbPrefix
       } = Db,
   
       {Start, End} = erlfdb_tuple:range({?WRAPPED_KEY}, DbPrefix),
       Range = erlfdb:get_range(Tx, Start, End),
   
       lists:foldl(fun({K, V}, Acc) ->
           case erlfdb_tuple:unpack(K, DbPrefix) of
               {?WRAPPED_KEY, <<"wrapped_key">>} -> Acc;
               {?WRAPPED_KEY, Key} -> [{Key, V} | Acc]
           end
       end, [{encrypted, true}], Range).
   ```
   
   I have two things I'm not sure about:
   1. Do we want to set info from aegis key manager into special namespace in db_info, something like this:
   ```json
     "disk_size": 0,
     "instance_start_time": "0",
     "purge_seq": 0,
     "aegis": {
       "encrypted": true,
       "crk": ...
     }
     ...
   ```
   Right now this is totally up to key manager.
   
   2. Do we want to make callback `get_db_info/1` optional on `aegis_key_manger` behaviour? Then `aegis:get_db_info/1` can just check if it's exported and return `[]` otherwise, so nothing will be added to db_info.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org