summaryrefslogtreecommitdiffstats
path: root/custodia
Commit message (Collapse)AuthorAgeFilesLines
...
* Properly handle inputs from a query stringSimo Sorce2015-05-261-9/+21
| | | | | | | parse_qs will always return lists even for single-valued parameters, check for it in the Validator and properly handle the case. Signed-off-by: Simo Sorce <simo@redhat.com>
* List special configuration names in one placeSimo Sorce2015-05-261-3/+6
| | | | | | | This way checks and hives are created from the same list and will not get out of sync (they are before this commit). Signed-off-by: Simo Sorce <simo@redhat.com>
* Add server_socket [global] configuration optionSimo Sorce2015-05-261-1/+4
| | | | | | | This allows admins to configure where the socket needs to be created ithout forcing to change the cwd of the daemon to the same place. Signed-off-by: Simo Sorce <simo@redhat.com>
* Make the socket world accessible by defaultSimo Sorce2015-05-261-0/+2
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Remove pylint star-args exceptionsSimo Sorce2015-05-263-7/+6
| | | | | | | | | | | 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 tests and fixes for 'simple' keysSimo Sorce2015-04-271-1/+3
| | | | | | | A missing query would not lead to the default 'simple' type being selected. Add tests for PUT/GET/DELETE of a simple key. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add support for signed/encrypted messagesSimo Sorce2015-04-272-2/+279
| | | | | | | | | The new 'kem' type allows the backend to authorize access to keys based on a signed request where the key mus be whitelisted in advance in a kemkeys database. The reply is encrypted with the client public key. Signed-off-by: Simo Sorce <simo@redhat.com>
* Move message parsing and validationSimo Sorce2015-04-206-39/+166
| | | | | | Create a message module to deal with message types and validation. 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>
* Allow to filter by keytype on key GETSimo Sorce2015-04-081-0/+16
|
* Return only key/containers names on LIST operationSimo Sorce2015-04-082-58/+45
|
* Always initialize db on store class instantiationSimo Sorce2015-04-082-15/+19
| | | | | | | | 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.
* Move authz checks from Secrets to own classSimo Sorce2015-04-081-72/+113
| | | | | Add a Namespace authorization class to use in the pipeline instead of performing authorization within the Secrets class
* Move pipeline from server class to request handlerSimo Sorce2015-04-081-79/+80
| | | | | Doesn't really make sense to have it on the server class, just snatch the config from it.
* Add basic framework for authorization pluginsSimo Sorce2015-04-084-34/+87
|
* Change authenticators to return a resultSimo Sorce2015-04-072-12/+23
| | | | | | | | | Authenticators will not signal anymore validity by adding a request attributes. Instead they can return on of three values: - True, indicates positive authentication - False, indicate explicit failure - None, inicates neither success nor failure, not applicable
* Python3 compatibility fixesSimo Sorce2015-04-071-8/+8
|
* Mute lintSimo Sorce2015-04-071-2/+2
|
* Add detection of conflicts when creating elementsSimo Sorce2015-04-071-1/+26
|
* Add explicit exception for storage conflictsSimo Sorce2015-04-072-2/+8
|
* Add functions to create and destroy containersSimo Sorce2015-04-071-15/+132
|
* Add code and tests to delete keysSimo Sorce2015-04-071-0/+49
|
* Add interface to remove data from storeSimo Sorce2015-04-072-0/+30
|
* Actually strip only the base containerSimo Sorce2015-04-071-11/+11
| | | | | If there are intermediate containers list them with empty strings as values.
* Defensive parsingSimo Sorce2015-04-071-0/+3
| | | | | Allow only specific commands, we do not want to allow users to end up being able to access internal functions with arbitrary names.
* Reorganize code so each main action is separateSimo Sorce2015-04-071-38/+48
| | | | | Each container or key action has its own function regardles of HTTP verbs used.
* Check that intermediate containers existSimo Sorce2015-04-071-2/+41
| | | | If a container does not exist PUTing a key should fail
* Return 201 on successful key creationSimo Sorce2015-04-071-18/+20
|
* 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
* Remove ununsed case with wrong nameSimo Sorce2015-04-071-8/+0
|
* Add Sqlite store unit testsSimo Sorce2015-04-072-1/+92
|
* Add more unit tests for SecretsSimo Sorce2015-04-061-0/+111
|
* Initial testsuite commitSimo Sorce2015-04-062-0/+57
|
* Improve secrets.pySimo Sorce2015-04-061-12/+41
| | | | | | | | | Require expicit namespace in name for GET, then check the user is authorized to access it. Return lists of keys filtering them by explicit namespace or using the default namespace. The list is returned as a dict of keys with full key names as arguments.
* Move Secrets class to its own fileSimo Sorce2015-04-062-70/+75
|
* 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
* Add simple secrets storage API to RootSimo Sorce2015-04-012-2/+77
| | | | | | | | | | | | | | This is a very simple implementation of a prototype API. Anyone that has access to the server and causes an authentication plugin to set the 'remote_user' value in the request, can retrieve and store secrets, Secrets are namespaced to the user requsteing them, so sharing secrets between multiple users is not possible. Secrets must to be of type "simple" and can only have one value. The value can be anything that can be reprsented in json format. It is recommended to pass a base64 encoded value.
* Add code to parse body and put it in the requestSimo Sorce2015-04-011-1/+19
| | | | | Accept a maximum of 10 Megabytes and relies on proper Content-length being set by the client
* Minor server.py fixesSimo Sorce2015-04-011-4/+9
| | | | | | | | Silence pylint errors due to python3 imports Switch to HTTP 1.0 by default, this terminates each request by default which make it handier for manual testing with clients like curl. Properly handle a consumer returning nothing (None) as output.
* Consumers can define entire subtreesSimo Sorce2015-04-011-3/+26
| | | | | | Each "page" is added to a parent consumer by callin add_sub() on the desired parent and provide a "page name" and the consumer class that handles it.
* 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.
* Provide more complete parsing of a request pathSimo Sorce2015-03-301-0/+24
|
* Add some documentation in form of class commentsSimo Sorce2015-03-301-0/+57
|
* Make stores directly availble to consumersSimo Sorce2015-03-252-0/+13
|
* Adjust the code to be python3 happySimo Sorce2015-03-256-11/+12
| | | | | This required the renaming of the http directory to avoid clashes with the python3 own http/server module.
* Initial sinple store infrastructureSimo Sorce2015-03-254-1/+83
|
* Require positive authentication in all casesSimo Sorce2015-03-252-8/+28
| | | | | Provide a SimpleNULLAuth class for people that want to allow unauthenticated access fto specific paths for whatever reason.
* Add simple header auth moduleSimo Sorce2015-03-231-0/+31
| | | | | | | This is useful when authentication is handled by a proxy sitting in front of custodia. Alternatively it can be used with shared secrets/bearer tokens sent in plain text in the headers.
* Add basic authentication frameworkSimo Sorce2015-03-233-10/+51
| | | | | | This kicks in before any request is parsed at all. The whole request is provided so technically it can be as complex as wanted.
* Configure consumers via config fileSimo Sorce2015-03-232-15/+68
| | | | This is how new backends and mechanism can be defined on per-instance basis