## Getting files

An example client to access files from this package server is available
as bash script (using curl).

See deployment project <https://git-repo.iml.unibe.ch/iml-open-source/imldeployment-client>

The download script is bin/getfile.sh.

## How does it work?

TODO: needs to be completed.

Each request to localhost/packages/ is secured.

A request will be rejected in the following cases:

* no authentication was used
* a wrong authentication was used
* an old timestamp was used (maybe the time on client or server are not synced)
* a hashed key was used twice

If a request was OK the file will be delivered.

Possible GET requests are:

* show names of phases (preview|stage|live) (1)
* show products (1)
* show files of a product (1)
* get a single file

(1) only if *showdircontent* is set to true.

If a valid request came in then the hash will be written to `[approot]/tmp/used_hashes.txt`.
This file will be cleaned up if reaching the defined file size with value of *maxlockfilesize*.