summaryrefslogtreecommitdiffstats
path: root/custodia/store
Commit message (Collapse)AuthorAgeFilesLines
* etcdstore: prevent path traversal attacksChristian Heimes2015-10-191-6/+14
| | | | | | | | | | A new internal method _absolute_key() is used to join key name and name space. etcd treats the key space like a file system so the method checks the key for '//', '.', and '..' to prevent invalid paths and path traversal attacks. Signed-off-by: Christian Heimes <cheimes@redhat.com> Signed-off-by: Simo Sorce <simo@redhat.com>
* Implement ETCD based StoreSimo Sorce2015-10-191-0/+94
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Extend store interface to create namespacesSimo Sorce2015-10-192-0/+40
| | | | | | | | | | Use a new verb, "span" to create namespaces/containers. This will be needed for the Etcd plugin which need to distinguish between a directory and a key. The sqlite/enclite just pass the request to their set() method. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Better error handling for enclite storeSimo Sorce2015-10-191-3/+11
| | | | | | | | | The store as throwing an exception in case of an unesisting key. Now it returns None as expected on missing keys, and properly wraps encoding exceptions if the JWE can't be decoded. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Remove filter option for directory listingsSimo Sorce2015-10-191-25/+31
| | | | | | | | | | This commit removes the option to pas a filter parameter. It also changes the way database plugins are expected to return results, results are now expected to be relative to the path requested. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Make tox pep8 happySimo Sorce2015-10-192-14/+16
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Add basic debugging capabilitiesSimo Sorce2015-06-051-2/+8
| | | | | | | If debug is set to True, then custodia's own Exception handlers will print a stack trace to standard output to aid debugging. Signed-off-by: Simo Sorce <simo@redhat.com>
* Remove pylint star-args exceptionsSimo Sorce2015-05-261-1/+1
| | | | | | | | | | | Newer pylint version completely removed the star-args warning, including recognizing the exception in the source code. Remove it from all source code to avoid annoyinf pylint errors about unrecognized exceptions, and add a general exception in the pylint makefile invocation, as apparently it is ok there. This will avoid warnings if older versions of pylint are used. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add Simple encrypted store.Simo Sorce2015-04-151-0/+37
| | | | | | | | | | | This uses JWCrypto to encrypt any key stored in the sqlite database with a master key. The master key is stored in a file and must be provided by the configuration. A sample key and configuration is provided too. Signed-off-by: Simo Sorce <simo@redhat.com>
* Return only key/containers names on LIST operationSimo Sorce2015-04-081-20/+16
|
* Always initialize db on store class instantiationSimo Sorce2015-04-081-10/+15
| | | | | | | | This will precreate the default tale if it doesn't exist and fail early if there are general database issues. Also change all CSStoreError events to report a 500 error and not silently transform them into innocuous 'no such data' errors.
* Add explicit exception for storage conflictsSimo Sorce2015-04-072-2/+8
|
* Add interface to remove data from storeSimo Sorce2015-04-072-0/+30
|
* Allow caller to decide if replace is allowedSimo Sorce2015-04-072-3/+16
| | | | | | | When storing the caller decide if the DB can silently replace an existing value or not. Defaults to False
* Add Sqlite store unit testsSimo Sorce2015-04-071-0/+89
|
* Fix sqlite's list() commandSimo Sorce2015-04-061-3/+9
| | | | | | | | When listing do not add a / to the user filter it prevents matching key names with a prefix. When returning keys return a dict of key value pairs. If no values are available instead return None
* Fix sqlite store bugsSimo Sorce2015-04-011-4/+9
| | | | | | Use print statement that works in python3 Create table so that keys are unique. Return directly the bare value associated with the key, if any.
* Initial sinple store infrastructureSimo Sorce2015-03-253-0/+79