X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=README.md;h=979d35e83d06cf6e2f3561355240cd95a2cda106;hb=refs%2Ftags%2Fneedlefish%2F13.93.0;hp=5fee4ccd0281b482eeb10a15d3ec5e4ff6476ba2;hpb=99d28457a1285f1709ae0782bd3687fde77ba819;p=apps%2Fagl-service-data-persistence.git diff --git a/README.md b/README.md index 5fee4cc..979d35e 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,52 @@ -# agl-identity -## Binding +# Database Binding -This binding provide the following API: -* `login`: Try to login the specified identity. -* `logout`: Try to logout the specified identity. -* `open_session`: Try to authenticate an identity using PAM. -* `close_session`: Try to close an opened session. -* `set_data`: Store a json for an identity/application pair. -* `get_data`: Get a json for an identity/application pair. +This binding provide a database API with key/value semantics. +The backend is currently a Berkeley DB. -# PAM's module +## Verbs -This binding make use of PAM to authenticate a user. -A sample PAM module is provided, but you can write your own to allow different authentication workflows. +* **insert**: -The sample module assume there is a `identity.json` file located at the root of an usb-stick. When the user plug-in the key, an udev's rule notify the binding and make a call to the `pam_auth` verb. The binding will then call the PAM module to authenticate the user. The sample PAM module will mount and read the file and open a session if the identity is valid. + This verb insert a key/value pair in the database. + If the key already exist, the verb fails. -When the user unplug the usb-stick, udev will notify the binding which will close the session. +* **update**: -# Udev's rules + This verb update an existing record. + If the key doesn't exist, the verb fails. -The sample PAM module work with usb-stick. In order to detect plug and unplug action, some udev's rules are required. +* **delete**: + + This verb remove an existing key/value pair from the database. + If no matching record is found, the verb fails. + +* **read**: + + This verb get the value associated with the specified key. + If no matching record is found, the verb fails. + +## Arguments + +* The **read** and **delete** verbs need only a **key** to work: + +```code +{ + "key": "mykey" +} +``` + +* The **insert** and **update** verbs need a **key** and a **value** to work: + +```code +{ + "key": "mykey", + "value": "my value" +} +``` + +The **value** can be any valid json. + +## Dependencies + +You must install BerkeleyDB and GDBM \ No newline at end of file