summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-10-02 11:32:55 +0200
committermh <mh@immerda.ch>2013-10-02 11:32:55 +0200
commit3c6000621f04c314876a22b6908cbde24ae40f13 (patch)
tree0e17caa8ec26731965ac36613504b615b3b4e9bc
parent2446ca831ff1a8609333d820a920a37e842ac852 (diff)
add documentation of the existing functions
-rw-r--r--README.md58
1 files changed, 58 insertions, 0 deletions
diff --git a/README.md b/README.md
index 64dd756..98668d5 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,64 @@ clients if you do not want to use trocla on the clients itself.
If you want to do your own very custom setup, you should look into the other
classes.
+## Functions
+
+### trocla
+
+
+Usage:
+
+ trocla(KEY, FORMAT, [optional options])
+
+This is the main function you will use. This is similar to a
+
+ trocla create foo FORMAT
+
+on the cli. This means, that *if* a password for this key and format
+exists, it will return this one, otherwise will create one automatically
+and return the generated password. So you might want to do something like:
+
+ user{'foobar':
+ password => trocla('user_foobar','plain')
+ }
+
+If you want to pass down encrypted passwords, you might use:
+
+
+ user{'foobar':
+ password => trocla('user_foobar','sha512crypt')
+ }
+
+As descriped further in trocla's docs.
+
+The optional options, can be used to pass options to the format, like
+overriding the default length for passwords that are being created:
+
+ user{'foobar':
+ password => trocla('user_foobar','sha512crypt','length: 32')
+ }
+
+### trocla_get
+
+Usage:
+
+ trocla_get(KEY, FORMAT)
+
+This will return the value of the passed key and format. If nothing is
+found an error will be raised. This is interesting if you want do not
+want to autogenerate a password and rather be sure that it's already
+existing in trocla's database.
+
+### trocla_set
+
+Usage:
+
+ trocla_set(KEY, FORMAT,PASSWORD)
+
+This will set the passed password for the key/format pair and return it
+as well. This is mainly interesting if you want to migrate existing manifests
+with plenty of passwords in it to trocla.
+
## Other classes
### trocla::config