diff --git a/.clang-tidy b/.clang-tidy
index 6aaac0675bc92c0ea6f5d5e69653baacd4c8e9eb..f3693c27991647463d33f013e4a88ba354faca7d 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -6,7 +6,6 @@ Checks: clang-diagnostic-*,
-clang-analyzer-security.insecureAPI.rand,
mpi-*,
readability-braces-around-statements,
- readability-avoid-const-params-in-decls,
readability-redundant-string-init,
readability-container-size-empty,
readability-implicit-bool-conversion,
@@ -16,7 +15,7 @@ WarningsAsErrors: '*'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
-User: ExSeisDat
+User: Deimos
CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
@@ -74,6 +73,6 @@ CheckOptions:
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.MacroDefinitionPrefix
- value: EXSEISDAT_
+ value: DEIMOS_
...
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..0a2f2bd0d3505475262962d6dde83ba18575d7f0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.swp
+todo.txt
+.DS_Store
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..0c34c0701987287a7de19b70273ec8e0a1e535b0
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,132 @@
+image: ciaranorourke/fiphoboserver:debian
+
+.snippets:
+ - &start_phobos
+ /home/superfiphoboserver/tools/build_phobos.sh -r
+ - &configure
+ mkdir build
+ && pushd build
+ && (
+ set -x;
+ cmake
+ -DCMAKE_VERBOSE_MAKEFILE=ON
+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
+ -DCMAKE_C_COMPILER=${CC}
+ -DCMAKE_CXX_COMPILER=${CXX}
+ -DDEIMOS_BUILD_TESTS="${DEIMOS_BUILD_TESTS}"
+ -DCMAKE_PREFIX_PATH="${DEPS_DIR}"
+ -DCUSTOM_DOCU_PATH="${DEIMOS_DOC_DIR}"
+ -DDEIMOS_BUILD_DOCUMENTATION="${DEIMOS_BUILD_DOCUMENTATION}"
+ -DDEIMOS_AUTHORISATION="${DEIMOS_AUTHORISATION}"
+ ..
+ )
+ && popd
+ - &build
+ make -C build
+ - &unit_test
+ make -C build test ARGS=-V
+ && pushd build/test/unit_tests
+ && ../tests
+ && popd
+ - &integration_test
+ pushd build/test/integration_tests
+ && python3 -m unittest client
+ && popd
+
+.cmake_variables:
+ default_cmake_variables: &default_cmake_variables
+ CC: gcc
+ CXX: g++
+ DEPS_DIR: /home/superfiphoboserver/build/install
+ DEIMOS_DOC_DIR: ""
+ DEIMOS_BUILD_TESTS: "ON"
+ DEIMOS_AUTHORISATION: "ON"
+
+.default_job: &default_job
+ tags:
+ - docker
+ variables:
+ <<: *default_cmake_variables
+ before_script:
+ - apt-get update
+ - apt-get install -y
+ cmake
+ clang clang-tidy
+ libspdlog-dev
+ script:
+ - *start_phobos
+ - *configure
+ - *build
+ - *unit_test
+ - *integration_test
+
+stages:
+ - static analysis
+ - build
+ - test
+
+Format:
+ <<: *default_job
+ stage: static analysis
+ variables:
+ CC: clang
+ CXX: clang++
+ before_script:
+ - apt-get update
+ - apt-get install -y
+ git
+ clang-format
+ - pip3 install yapf
+ script:
+ - ./tools/run_format.sh
+ && git status
+ && git diff-index --quiet HEAD
+ || { echo "This commit contains unformatted files! Run tools/run_format.sh on the project to format them correctly."; false; }
+
+Lint:
+ <<: *default_job
+ stage: static analysis
+ variables:
+ <<: *default_cmake_variables
+ CC: clang
+ CXX: clang++
+ script:
+ - *configure
+ - *build
+ - ./tools/run_lint.sh build
+
+Documentation:
+ <<: *default_job
+ stage: build
+ variables:
+ <<: *default_cmake_variables
+ DEIMOS_BUILD_DOCUMENTATION: "ON"
+ DEIMOS_DOC_DIR: /home/superfiphoboserver/external/doxygen-xml-parser/src
+ CC: clang
+ CXX: clang++
+ before_script:
+ - apt-get update
+ - apt-get install -y
+ cmake
+ doxygen
+ graphviz
+ clang
+ libspdlog-dev
+ script:
+ - *configure
+ - make -C build/doc
+ && git status
+ && git diff-index --quiet HEAD
+ || { echo "This commit contains changes to the documentation! Run doxygen-XML-parser on the project update the documentation."; false; }
+
+
+Default:
+ <<: *default_job
+ stage: test
+
+Authorisation Disabled:
+ <<: *default_job
+ variables:
+ <<: *default_cmake_variables
+ DEIMOS_AUTHORISATION: "OFF"
+ stage: test
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 39e0cb6b9af9a4cd9ba07636acb377d75a7ddf32..2cbc3e3bab985c9a58251be53a6386aeeb15afa8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,128 @@
-project(fiphoboserver)
+cmake_minimum_required(VERSION 3.0)
+
+project(
+ deimos
+ VERSION 0.0.1
+ LANGUAGES C CXX
+)
+
+#
+# Set subdirectory options
+#
+
+option(
+ DEIMOS_BUILD_TESTS
+ "build Deimos tests. Depends on Catch2."
+ OFF
+)
+
+option(
+ DEIMOS_BUILD_DOCUMENTATION
+ "build Deimos Documentation. Depends on Doxygen."
+ OFF
+)
+
+
+#
+# Setup installation path options.
+#
+
+# Initialy set paths to GNU defaults.
+# Users can specify directories using the various DEIMOS_INSTALL_XXX
+# variables.
+# eg. setting the include install dir
+# cmake -DDEIMOS_INSTALL_INCLUDE_DIR=/path/to/include /path/to/deimos
+
+# Get some sane default install directories
+include(GNUInstallDirs)
+
+set(
+ DEIMOS_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR} CACHE STRING
+ "The install directory for Deimos executables."
+)
+
+set(
+ DEIMOS_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING
+ "The install directory for Deimos libraries."
+)
+
+set(
+ DEIMOS_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE STRING
+ "The install directory for Deimos headers."
+)
+
+set(
+ DEIMOS_INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR} CACHE STRING
+ "The install directory for Deimos data (eg. cmake scripts)."
+)
+
+
+#
+# Set build type options
+#
+
+option(
+ DEIMOS_AUTHORISATION
+ "build Deimos with AWS authorisation enabled. Default is enabled"
+ ON
+)
+
+
+#
+# Find needed libraries
+#
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
+
+# set(Boost_DEBUG 1)
+
+find_package(proxygen REQUIRED)
+find_package(phobos REQUIRED)
+find_package(spdlog REQUIRED)
+
+
+#
+# Include optional subdirectories
+#
+
+include_directories(
+ SYSTEM PUBLIC ${SPDLOG_INCLUDE_DIR}
+)
+
+#
+# Setup the Deimos library
+#
add_subdirectory(src)
+
+
+# Output project build options
+message(STATUS "Build options:")
+message(STATUS " DEIMOS_AUTHORISATION = ${DEIMOS_AUTHORISATION}")
+message(STATUS " DEIMOS_BUILD_DOCUMENTATION = ${DEIMOS_BUILD_DOCUMENTATION}")
+message(STATUS " DEIMOS_BUILD_TESTS = ${DEIMOS_BUILD_TESTS}")
+
+# Build documentation
+if(DEIMOS_BUILD_DOCUMENTATION)
+ add_subdirectory(doc)
+endif(DEIMOS_BUILD_DOCUMENTATION)
+
+# Build tests
+if(DEIMOS_BUILD_TESTS)
+ add_subdirectory(test)
+ enable_testing()
+endif(DEIMOS_BUILD_TESTS)
+
+
+#
+# Set up installation directories
+#
+
+install(
+ TARGETS deimos
+ EXPORT deimos-targets
+ RUNTIME DESTINATION ${DEIMOS_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${DEIMOS_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${DEIMOS_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${DEIMOS_INSTALL_INCLUDEDIR}
+)
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..f204b9671f4154a6f6a2675438a7bab14ceff340
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2020 Irish Centre for High End Computing (ICHEC), NUI Galway
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index b4322f9d48ac95e37863fc3d29d84fd004e84cef..d39e905042d78b6e8038a3309bbd83548785a5f7 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,136 @@
-# FIPhoboServer
+# Deimos
-Build with
+Deimos (Delivery Endpoint Interface for Managing Object Storage) is a webserver used to archive data to a [Phobos](https://github.com/cea-hpc/phobos) managed object storage.
+Deimos is implemented by using a large subset of the Amazon S3 REST API interface and therefore compatible with most software that uses S3 as an endpoint.
+
+Most importantly, it can be used as an endpoint for Lustre HSM archiving solutions using for example [Estuary](https://git.ichec.ie/oilgas/ltfs/estuary).
+
+## Dependencies Installation Instructions
+
+Deimos has dependencies that require a little patience to build. It may be simpler to invoke a prebuilt Docker image using a Dockerfile such as;
+
+```
+FROM ciaranorourke/deimos:centos
+
+RUN apt-get -y update && apt-get -y upgrade
+RUN apt-get -y install \
+ [personal installation preferences]
+```
+
+Alternatively, see [SuperDeimos](https://git.ichec.ie/oilgas/ltfs/superdeimos) for instructions on how to create your own build environment.
+
+It is recommended to run the Docker image mentioned above by mounting your local branch of the Deimos project with `docker run -it -v /path/to/local/deimos:/home/superdeimos/external/deimos [name]:[tag]`
+
+To use the Phobos raid1 layout which is compatible with FIFOs, the following environment variables must be set;
+
+```
+export PHOBOS_STORE_layout=raid1
+export PHOBOS_LAYOUT_RAID1_repl_count={1,2,3,...}
+```
+
+## Build Instructions
+
+To configure and build Deimos, a C++14 compatible compiler is required, and CMake >= 3.0.
+
+```
+# Make a directory to hold the temporary build files
+mkdir -p build
+
+# Change directory to the build directory
+cd build
+
+# Configure the Deimos build using CMake
+cmake \
+ -DCMAKE_PREFIX_PATH=/path/to/proxygen \
+ [more options below] \
+ /path/to/deimos/project
+
+cd /path/to/deimos/project
+
+# Build the Deimos project
+make -C build
+
+# Install the Deimos executable
+make -C build install
```
-cmake -DDEBUG=ON -DCMAKE_PREFIX_PATH=/path/to/proxygen /path/to/CMakeLists/file/
-make
+A build script executing these commands and also building the dependencies can be found in the project [SuperDeimos](https://git.ichec.ie/oilgas/ltfs/superdeimos).
+
+### Useful Options
+
+#### Setting Compile/Link Flags
+Option | Effect
+------ | ------
+`-DCMAKE_CXX_COMPILER=...` | Set the C++ compiler.
+`-DCMAKE_CXX_FLAGS=...` | Set the flags to pass to the C++ compiler. Overrides the default flags.
+`-DCMAKE_BUILD_TYPE=...` | Set to `Release` or `Debug` for release or debug builds. Sets a number of flags by default.
+
+#### Enabling/Disabling Sections of Deimos
+Option | Effect
+------ | ------
+`-DDEIMOS_BUILD_TESTS=...` | Set to `ON` to build Deimos tests and enable the `make test` target, or `OFF` to skip (Default `OFF`).
+`-DDEIMOS_AUTHORISATION=...` | Set to `OFF` to disable AWS V4 authorisation (= letting everything through), or `ON` to authorise requests (Default `ON`).
+`-DDEIMOS_BUILD_DOCUMENTATION=...` | Set to `ON` to build Deimos Doxygen documentation, or `OFF` to skip (Default `OFF`).
+`-DCUSTOM_DOCU_PATH=...` | Set to the path to the `src` folder in [DoxygenXMLParser](https://git.ichec.ie/sophie.wenzel-teuber/doxygen-xml-parser) to create the Markdown output from the Doxygen XML, that can also be found [here](doc/Markdown/deimos) or don't set to skip (Default `not set`).
+
+#### Setting installation directories
+Option | Effect
+------ | ------
+`-DDEIMOS_INSTALL_PREFIX=...` | Set to the root install directory for the compiled libraries and programs.
+`-DDEIMOS_INSTALL_BINDIR=...` | Set the install directory for the `deimos` executable. Use a relative path to set the path relative to `${CMAKE_INSTALL_PREFIX}`. (Default `bin`).
+`-DDEIMOS_INSTALL_LIBDIR=...` | Set the install directory for `deimos` libraries. Use a relative path to set the path relative to `${CMAKE_INSTALL_PREFIX}`. (Default `lib`).
+
+## Testing
+
+Units test can be run with `make -C build tests`, given `DEIMOS_BUILD_TESTS` was set to `ON` during the build process.
+Integration tests can be run from the `test/integration_tests/` directory with `python -m unittest client`.
+
+## Documentation
+
+The Doxygen documentation can be found [here](doc/Markdown/deimos).
+
+## Usage
+
+The `deimos` executable requires exactly one subcommand.
+
+#### Subcommands
+Subcommand | Effect
+---------- | ------
+`start [hostname]` | Start the server daemon, listening to `hostname`.
+`stop` | Stop the server daemon.
+
+The `start` subcommand supports a number of optional flags and options.
+
+#### Flags/Options
+Flag/Option | Effect
+----------- | ------
+`--http INT` | Set the port to listen on with HTTP protocol (Default `11000`).
+`--http2 INT` | Set the port to listen on with HTTP2 protocol (Default `11002`).
+`-t,--threads INT` | Set the number of threads to listen on, <= 0 will use number of available cores (Default `0`).
+`-w,--write-config TEXT` | Write the configuration to `TEXT`.
+`-l,--logfile` | Set the filename to write logs to (Default `/tmp/deimos_log.txt").
+
+Options can also be given to the `start` subcommand using `--config [config_filename]`. Note that if `hostname` is specified in the configuration file then the `--config` options must be suppied before the `start` subcommand;
+```
+deimos --config [config_filename] start
+```
+
+### Authentication
+The server uses the [Amazon S3 Authentication](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) to ensure the requests that are reaching it are from legitimate users.
+
+Since we do not have a proper database for users yet, they are currently stored along with their keys in [users.txt](test/users.txt). This file is copied into the `/tmp` folder by CMake and then read from there for authentication.
+
+Since the authentication is checked for every request, you need to use one of the users and keys from that file for testing the server!
+
+Either you set the correct credentials using the SDK directly or let the SDK find them automatically using the file `~/.aws/credentials` similar to:
+
+```
+[default]
+aws_access_key_id = OPEN_KEY
+aws_secret_access_key = SECRET_KEY
```
-from any directory you want and hope for the best! ;)
-Oh, make sure Phobos include directories are under `../phobos/src/include` from the main `CMakeLists.txt`, or change that path in there
+---
+Copyright 2020 Irish Centre for High End Computing (ICHEC), NUI Galway.
\ No newline at end of file
diff --git a/cmake/Findphobos.cmake b/cmake/Findphobos.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..5f1ede791e6aaea66da6df4ef9296a75f946fffd
--- /dev/null
+++ b/cmake/Findphobos.cmake
@@ -0,0 +1,89 @@
+include(FindPackageHandleStandardArgs)
+
+# message("Looking for Phobos")
+
+if(NOT PHOBOS_FOUND)
+ find_path( PHOBOS_INCLUDE_DIR
+ HINTS ./
+ ../phobos/include/
+ ../include/phobos/
+ ../../phobos/include/
+ ../../include/phobos/
+ ../../../phobos/include/
+ ../../../include/phobos/
+ /usr/include/
+ /usr/include/phobos/
+ /usr/local/include/
+ /usr/local/include/phobos/
+ ${CMAKE_PREFIX_PATH}/include/phobos/
+ ${CMAKE_PREFIX_PATH}/phobos/include/
+ ${CMAKE_INSTALL_PREFIX}/../include/phobos/
+ ${CMAKE_INSTALL_PREFIX}/../phobos/include/
+ ${CMAKE_INSTALL_PREFIX}/include/phobos/
+ ${CMAKE_INSTALL_PREFIX}/phobos/include/
+ NAMES phobos_store.h pho_attrs.h
+ DOC "Phobos headers"
+ )
+
+ find_path( GLIB_INCLUDE_DIR
+ HINTS ./
+ ../
+ ../glib-2.0/
+ ../include/glib-2.0/
+ ../../
+ ../../glib-2.0/
+ ../../include/glib-2.0/
+ /usr/include/
+ /usr/include/glib-2.0/
+ NAMES glib.h
+ DOC "Glib header"
+ )
+
+ find_path( GLIB_CONFIG_INCLUDE_DIR
+ HINTS ./
+ ../
+ ../glib-2.0/
+ ../lib64/glib-2.0/
+ ../../
+ ../../glib-2.0/
+ ../../lib64/glib-2.0/
+ /usr/include/
+ /usr/include/glib-2.0/
+ /usr/lib64/
+ /usr/lib64/glib-2.0/
+ /usr/lib64/include/
+ /usr/lib64/glib-2.0/include/
+ NAMES glibconfig.h
+ DOC "Glib config"
+ )
+
+ find_path( PHOBOS_LIBRARY_DIR
+ HINTS ./
+ ../phobos/lib/
+ ../lib/phobos/
+ ../../phobos/lib/
+ ../../lib/phobos/
+ ../../../phobos/lib/
+ ../../../lib/phobos/
+ /usr/lib/
+ /usr/lib/phobos/
+ /usr/local/lib/
+ /usr/local/lib/phobos/
+ ${CMAKE_PREFIX_PATH}/lib/phobos/
+ ${CMAKE_PREFIX_PATH}/phobos/lib/
+ ${CMAKE_INSTALL_PREFIX}/../lib/phobos/
+ ${CMAKE_INSTALL_PREFIX}/../phobos/lib/
+ ${CMAKE_INSTALL_PREFIX}/lib/phobos/
+ ${CMAKE_INSTALL_PREFIX}/phobos/lib/
+ NAMES libphobos_store.so libphobos_store.la
+ DOC "Phobos library"
+ )
+
+ find_package_handle_standard_args(phobos
+ REQUIRED_VARS PHOBOS_INCLUDE_DIR PHOBOS_LIBRARY_DIR GLIB_INCLUDE_DIR
+ GLIB_CONFIG_INCLUDE_DIR
+ HANDLE_COMPONENTS)
+
+ set(GLIB_INCLUDE_DIR ${GLIB_INCLUDE_DIR} ${GLIB_CONFIG_INCLUDE_DIR})
+
+endif()
\ No newline at end of file
diff --git a/cmake/Findspdlog.cmake b/cmake/Findspdlog.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..66bb445863fd7e5326c53b0825ede34314f3d756
--- /dev/null
+++ b/cmake/Findspdlog.cmake
@@ -0,0 +1,29 @@
+include(FindPackageHandleStandardArgs)
+
+# message("Looking for SpdLog")
+
+if(NOT SPDLOG_FOUND)
+ find_path( SPDLOG_INCLUDE_DIR
+ HINTS ./
+ ./spdlog/include/
+ ../spdlog/include/
+ ../../spdlog/include/
+ ../../../spdlog/include/
+ /usr/spdlog/include/
+ /usr/local/include/
+ /usr/local/spdlog/include/
+ ${CMAKE_PREFIX_PATH}/include/spdlog/include/
+ ${CMAKE_PREFIX_PATH}/spdlog/include/
+ ${CMAKE_INSTALL_PREFIX}/../include/spdlog/include/
+ ${CMAKE_INSTALL_PREFIX}/../spdlog/include/
+ ${CMAKE_INSTALL_PREFIX}/include/spdlog/include/
+ ${CMAKE_INSTALL_PREFIX}/spdlog/include/
+ NAMES spdlog/spdlog.h
+ DOC "SpdLog headers"
+ )
+
+ find_package_handle_standard_args(spdlog
+ REQUIRED_VARS SPDLOG_INCLUDE_DIR
+ HANDLE_COMPONENTS)
+
+endif()
\ No newline at end of file
diff --git a/cmake/development_flags.cmake b/cmake/development_flags.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..40a108959081050b81fd68744f17468419f5a3c0
--- /dev/null
+++ b/cmake/development_flags.cmake
@@ -0,0 +1,39 @@
+add_library(development_flags INTERFACE)
+
+option(DEIMOS_ENABLE_SANITIZERS "Enable address and undefined behavior sanitizers." ON)
+
+if(DEIMOS_CXX_COMPILER_ID MATCHES "Clang|GNU")
+ target_compile_options(
+ development_flags
+ INTERFACE
+ -Wall -Wextra -Wpedantic -pedantic
+ -Wno-error=unknown-pragmas
+ -Wswitch-enum
+ -Wimplicit-fallthrough
+ -Werror
+ -0g
+ )
+
+ if(DEIMOS_ENABLE_SANITIZERS)
+ target_compile_options(
+ development_flags
+ INTERFACE
+ -fsanitize=address,undefined
+ -fno-sanitize=recover=all
+ -fno-omit-frame-pointer
+ )
+ target_link_libraries(
+ development_flags
+ INTERFACE
+ -fsanitize=address,undefined
+ )
+ endif(DEIMOS_ENABLE_SANITIZERS)
+endif()
+
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ target_compile_options(development_flags INTERFACE -ferror-limit=1)
+endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ target_compile_options(development_flags INTERFACE -fmax-errors=1)
+endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e7b0a0831cc0454bb4ec1de7cf6c0da0b3e5ad8b
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,58 @@
+find_package(Doxygen REQUIRED)
+
+# Write a Doxyfile including the main doc/Doxyfile.
+# This sets the @INCLUDE_PATH variable to the project root.
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+ @ONLY
+)
+
+set(INCLUDE_DOXYFILE "@INCLUDE = ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
+
+# Custom command to run doxygen on build/doc/Doxyfile in the build/doc dir.
+# Running doxygen is tied to the html/index.html file.
+# TODO: The main dependency is currently doc/Doxyfile, but there should be
+# a depencency on *every* file being documented!
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml
+ COMMAND ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile"
+ MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Building the documentation..."
+)
+
+if(CUSTOM_DOCU_PATH)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/docu.json
+ COMMAND python3
+ ARGS "${CUSTOM_DOCU_PATH}/xml_to_json_parser/xml_to_json_parser.py" "${CMAKE_CURRENT_BINARY_DIR}/xml" docu.json
+ MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Parsing the documentation XML..."
+ )
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Markdown/index.md
+ COMMAND python3
+ ARGS "${CUSTOM_DOCU_PATH}/json_to_Markdown_converter/json_to_Markdown_converter.py" docu.json "${CMAKE_CURRENT_SOURCE_DIR}/Markdown"
+ MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/docu.json
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Creating the Markdown documentation..."
+ )
+ # Target to wire up building the documentation to the ALL target.
+ add_custom_target(
+ doc ALL
+ DEPENDS
+ ${CMAKE_CURRENT_SOURCE_DIR}/Markdown/index.md
+ )
+else(CUSTOM_DOCU_PATH)
+ # Target to wire up building the documentation to the ALL target.
+ add_custom_target(
+ doc ALL
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml
+ )
+
+endif(CUSTOM_DOCU_PATH)
+
+
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
new file mode 100644
index 0000000000000000000000000000000000000000..0112ddcb98176eba5ae6d7e2551507f315554ed7
--- /dev/null
+++ b/doc/Doxyfile.in
@@ -0,0 +1,52 @@
+# Doxyfile 1.8.13
+
+#
+# This is a template file used for configuration in doc/CMakeLists.txt.
+#
+
+PROJECT_NAME = Deimos
+
+# Extraction options
+EXTRACT_PRIVATE = YES
+EXTRACT_PACKAGE = YES
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_METHODS = YES
+EXTRACT_ANON_NSPACES = YES
+EXCLUDE_SYMBOLS = detail
+
+# Generate case sensitive filenames
+CASE_SENSE_NAMES = YES
+
+# Warning options
+# Warn on everything possible, and fail on warning
+QUIET = YES
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = NO
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = YES
+WARN_AS_ERROR = YES
+
+# Input directories
+INPUT = @CMAKE_SOURCE_DIR@/src
+
+EXCLUDE = @CMAKE_SOURCE_DIR@/src/main.cc
+EXCLUDE_PATTERNS = */phobos_cpp_wrapper/*
+
+RECURSIVE = YES
+
+# HTML output options
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+GENERATE_TREEVIEW = YES
+
+# Latex font size
+FORMULA_FONTSIZE = 10
+
+# Macro options
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+PREDEFINED = __cplusplus
+SEARCH_INCLUDES = YES
+
+GENERATE_XML = YES
diff --git a/doc/Markdown/deimos/DeimosException.md b/doc/Markdown/deimos/DeimosException.md
new file mode 100644
index 0000000000000000000000000000000000000000..230b043075f14bbe1944ad9bf079230a617d95a3
--- /dev/null
+++ b/doc/Markdown/deimos/DeimosException.md
@@ -0,0 +1,144 @@
+# public deimos::DeimosException
+
+exception class for all user defined exceptions in Deimos
+
+
+
+
+## Inheritance:
+Is inherited by [deimos::IOException][deimos-IOException], [deimos::storage::PhobosException][deimos-storage-PhobosException].
+
+## Protected Attributes
+| Name | Description |
+| ---- | ---- |
+| [m_message](#deimos-DeimosException-m_message) | the internal message |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [DeimosException](#deimos-DeimosException-DeimosException) | default constructor |
+| [DeimosException](#deimos-DeimosException-DeimosException-1) | constructor for a message with information on the exception |
+| [what](#deimos-DeimosException-what) | get information on this exception |
+| [get_inner_error](#deimos-DeimosException-get_inner_error) | return the inner error value that caused this exception |
+
+
+
+## Protected Attributes
+### protected deimos::DeimosException::m_message
+
+the internal message
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-DeimosException)
+
+## Public Functions
+### public deimos::DeimosException::DeimosException ()
+
+default constructor
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-DeimosException)
+
+### public deimos::DeimosException::DeimosException (const char *message)
+
+constructor for a message with information on the exception
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const char * | message | message explaining what went wrong such that this exception was thrown. |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-DeimosException)
+
+### public const char * deimos::DeimosException::what () const noexcept override
+
+get information on this exception
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| const char * | A message explaining what this exception is about |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+* virtual
+
+
+[Go to Top](#deimos-DeimosException)
+
+### public int deimos::DeimosException::get_inner_error () const noexcept
+
+return the inner error value that caused this exception
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| int | |
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+* virtual
+
+
+[Go to Top](#deimos-DeimosException)
+
+[deimos-IOException]:./IOException.md
+[deimos-storage-PhobosException]:./storage/PhobosException.md
diff --git a/doc/Markdown/deimos/GetRequestHandler.md b/doc/Markdown/deimos/GetRequestHandler.md
new file mode 100644
index 0000000000000000000000000000000000000000..c7db0f97dd822f2e03aa726da7be0d712139028a
--- /dev/null
+++ b/doc/Markdown/deimos/GetRequestHandler.md
@@ -0,0 +1,232 @@
+# public deimos::GetRequestHandler
+
+proxygen class implementation for handling GET requests
+
+
+
+
+## Inheritance:
+Inherits from RequestHandler.
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [onRequest](#deimos-GetRequestHandler-onRequest) | first function to be called when a new request comes in |
+| [onBody](#deimos-GetRequestHandler-onBody) | function called on every body chunk belonging to this message |
+| [onEOM](#deimos-GetRequestHandler-onEOM) | function called when the incoming message is finished |
+| [onUpgrade](#deimos-GetRequestHandler-onUpgrade) | function called on upgrade |
+| [requestComplete](#deimos-GetRequestHandler-requestComplete) | function ... |
+| [onError](#deimos-GetRequestHandler-onError) | function called when an error occurred |
+| [onEgressPaused](#deimos-GetRequestHandler-onEgressPaused) | called when the queue is full. |
+| [onEgressResumed](#deimos-GetRequestHandler-onEgressResumed) | called when the queue is not longer full. |
+| [GetRequestHandler](#deimos-GetRequestHandler-GetRequestHandler) | Constructor for stream class initialization. |
+
+
+
+## Public Functions
+### public void deimos::GetRequestHandler::onRequest (std::unique_ptr< proxygen::HTTPMessage > headers) noexcept override
+
+first function to be called when a new request comes in
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< proxygen::HTTPMessage > | headers | headers of the HTTP message this handler was created for |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-GetRequestHandler)
+
+### public void deimos::GetRequestHandler::onBody (std::unique_ptr< folly::IOBuf > body) noexcept override
+
+function called on every body chunk belonging to this message
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< folly::IOBuf > | body | buffer for the body |
+
+
+
+
+
+
+
+This is not used in this case because GET requests don't usually have a body
+
+
+
+
+[Go to Top](#deimos-GetRequestHandler)
+
+### public void deimos::GetRequestHandler::onEOM () noexcept override
+
+function called when the incoming message is finished
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-GetRequestHandler)
+
+### public void deimos::GetRequestHandler::onUpgrade (proxygen::UpgradeProtocol proto) noexcept override
+
+function called on upgrade
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| proxygen::UpgradeProtocol | proto | the new protocol |
+
+
+
+
+
+
+
+
+Not supported in our case!
+
+
+
+
+[Go to Top](#deimos-GetRequestHandler)
+
+### public void deimos::GetRequestHandler::requestComplete () noexcept override
+
+function ...
+
+
+
+
+
+
+
+
+
+
+> **[Todo][todo]:** find out what this does?
+
+
+
+
+[Go to Top](#deimos-GetRequestHandler)
+
+### public void deimos::GetRequestHandler::onError (proxygen::ProxygenError err) noexcept override
+
+function called when an error occurred
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| proxygen::ProxygenError | err | the error |
+
+
+
+
+
+
+
+
+Not supported in our case!
+
+
+
+
+[Go to Top](#deimos-GetRequestHandler)
+
+### public void deimos::GetRequestHandler::onEgressPaused () noexcept override
+
+called when the queue is full.
+
+
+
+
+
+
+
+
+
+
+Contents are copies from a proxygen example
+
+
+
+
+[Go to Top](#deimos-GetRequestHandler)
+
+### public void deimos::GetRequestHandler::onEgressResumed () noexcept override
+
+called when the queue is not longer full.
+
+
+
+
+
+
+
+
+
+
+Contents are copies from a proxygen example
+
+
+
+
+[Go to Top](#deimos-GetRequestHandler)
+
+### public deimos::GetRequestHandler::GetRequestHandler (std::unique_ptr< stream::Stream > input_stream)
+
+Constructor for stream class initialization.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< [stream::Stream][deimos-stream-Stream] > | input_stream | [stream::Stream][deimos-stream-Stream] class instance to initialize the server |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-GetRequestHandler)
+
+[deimos-stream-Stream]:./stream/Stream.md
+[todo]:./../todo.md#todo
diff --git a/doc/Markdown/deimos/GetmdRequestHandler.md b/doc/Markdown/deimos/GetmdRequestHandler.md
new file mode 100644
index 0000000000000000000000000000000000000000..9f0cb1a304547971f66b77979bfab4f01d8ff166
--- /dev/null
+++ b/doc/Markdown/deimos/GetmdRequestHandler.md
@@ -0,0 +1,190 @@
+# public deimos::GetmdRequestHandler
+
+proxygen class implementation for handling HEAD requests
+
+
+
+
+## Inheritance:
+Inherits from RequestHandler.
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [onRequest](#deimos-GetmdRequestHandler-onRequest) | first function to be called when a new request comes in |
+| [onBody](#deimos-GetmdRequestHandler-onBody) | function called on every body chunk belonging to this message |
+| [onEOM](#deimos-GetmdRequestHandler-onEOM) | function called when the incoming message is finished |
+| [onUpgrade](#deimos-GetmdRequestHandler-onUpgrade) | function called on upgrade |
+| [requestComplete](#deimos-GetmdRequestHandler-requestComplete) | function ... |
+| [onError](#deimos-GetmdRequestHandler-onError) | function called when an error occurred |
+| [GetmdRequestHandler](#deimos-GetmdRequestHandler-GetmdRequestHandler) | Constructor for stream class initialization. |
+
+
+
+## Public Functions
+### public void deimos::GetmdRequestHandler::onRequest (std::unique_ptr< proxygen::HTTPMessage > headers) noexcept override
+
+first function to be called when a new request comes in
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< proxygen::HTTPMessage > | headers | headers of the HTTP message this handler was created for |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-GetmdRequestHandler)
+
+### public void deimos::GetmdRequestHandler::onBody (std::unique_ptr< folly::IOBuf > body) noexcept override
+
+function called on every body chunk belonging to this message
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< folly::IOBuf > | body | buffer for the body |
+
+
+
+
+
+
+
+This is not used in this case because GET requests don't usually have a body
+
+
+
+
+[Go to Top](#deimos-GetmdRequestHandler)
+
+### public void deimos::GetmdRequestHandler::onEOM () noexcept override
+
+function called when the incoming message is finished
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-GetmdRequestHandler)
+
+### public void deimos::GetmdRequestHandler::onUpgrade (proxygen::UpgradeProtocol proto) noexcept override
+
+function called on upgrade
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| proxygen::UpgradeProtocol | proto | the new protocol |
+
+
+
+
+
+
+
+
+Not supported in our case!
+
+
+
+
+[Go to Top](#deimos-GetmdRequestHandler)
+
+### public void deimos::GetmdRequestHandler::requestComplete () noexcept override
+
+function ...
+
+
+
+
+
+
+
+
+
+
+> **[Todo][todo]:** find out what this does?
+
+
+
+
+[Go to Top](#deimos-GetmdRequestHandler)
+
+### public void deimos::GetmdRequestHandler::onError (proxygen::ProxygenError err) noexcept override
+
+function called when an error occurred
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| proxygen::ProxygenError | err | the error |
+
+
+
+
+
+
+
+
+Not supported in our case!
+
+
+
+
+[Go to Top](#deimos-GetmdRequestHandler)
+
+### public deimos::GetmdRequestHandler::GetmdRequestHandler (std::unique_ptr< stream::Stream > input_stream)
+
+Constructor for stream class initialization.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< [stream::Stream][deimos-stream-Stream] > | input_stream | [stream::Stream][deimos-stream-Stream] class instance to initialize the server |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-GetmdRequestHandler)
+
+[deimos-stream-Stream]:./stream/Stream.md
+[todo]:./../todo.md#todo
diff --git a/doc/Markdown/deimos/HandlerFactory.md b/doc/Markdown/deimos/HandlerFactory.md
new file mode 100644
index 0000000000000000000000000000000000000000..6217e359bf8ed73fa5cb7159ff58e5d9320ba244
--- /dev/null
+++ b/doc/Markdown/deimos/HandlerFactory.md
@@ -0,0 +1,107 @@
+# public deimos::HandlerFactory
+
+factory to create the handlers for incoming HTTP requests
+
+
+
+Depending on the method (GET, PUT, HEAD) this class creates an object of the corresponding request handler.
+
+All other requests result in an object of [UnsupportedRequestHandler][deimos-UnsupportedRequestHandler], that will then send an 400 Bad request response.
+
+
+
+
+## Inheritance:
+Inherits from RequestHandlerFactory.
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [onServerStart](#deimos-HandlerFactory-onServerStart) | function that gets called when the server starts |
+| [onServerStop](#deimos-HandlerFactory-onServerStop) | function that gets called when the server stops |
+| [onRequest](#deimos-HandlerFactory-onRequest) | this function gets called whenever a request reaches the server |
+
+
+
+## Public Functions
+### public void deimos::HandlerFactory::onServerStart (folly::EventBase *) noexcept override
+
+function that gets called when the server starts
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-HandlerFactory)
+
+### public void deimos::HandlerFactory::onServerStop () noexcept override
+
+function that gets called when the server stops
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-HandlerFactory)
+
+### public proxygen::RequestHandler * deimos::HandlerFactory::onRequest (proxygen::RequestHandler *, proxygen::HTTPMessage *headers) noexcept override
+
+this function gets called whenever a request reaches the server
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| proxygen::HTTPMessage * | headers | The headers of the HTTP message that reached the server |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| proxygen::RequestHandler * | A handler for the incoming request |
+
+
+
+
+
+
+
+
+This function creates the follosing request handlers:
+
+- GET: [GetRequestHandler][deimos-GetRequestHandler]
+
+- PUT: [PutRequestHandler][deimos-PutRequestHandler]
+
+- HEAD: [GetmdRequestHandler][deimos-GetmdRequestHandler]
+
+- or [UnsupportedRequestHandler][deimos-UnsupportedRequestHandler] in all other cases
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-HandlerFactory)
+
+[deimos-GetRequestHandler]:./GetRequestHandler.md
+[deimos-GetmdRequestHandler]:./GetmdRequestHandler.md
+[deimos-PutRequestHandler]:./PutRequestHandler.md
+[deimos-UnsupportedRequestHandler]:./UnsupportedRequestHandler.md
diff --git a/doc/Markdown/deimos/IOException.md b/doc/Markdown/deimos/IOException.md
new file mode 100644
index 0000000000000000000000000000000000000000..baa3e78fce2bb45a13ea9cb975f7a25dfc34bbfb
--- /dev/null
+++ b/doc/Markdown/deimos/IOException.md
@@ -0,0 +1,95 @@
+# public deimos::IOException
+
+exceptions specifically for errors in I/O
+
+
+
+
+## Inheritance:
+Inherits from [deimos::DeimosException][deimos-DeimosException].
+
+## Private Attributes
+| Name | Description |
+| ---- | ---- |
+| [m_inner_value](#deimos-IOException-m_inner_value) | the value of the error that caused this exception |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [IOException](#deimos-IOException-IOException) | constructor |
+| [get_inner_error](#deimos-IOException-get_inner_error) | return the inner error value that caused this exception |
+
+
+
+## Private Attributes
+### private deimos::IOException::m_inner_value = 0
+
+the value of the error that caused this exception
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-IOException)
+
+## Public Functions
+### public deimos::IOException::IOException (const char *caller, const char *function_name, int return_value)
+
+constructor
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const char * | caller | the function that threw this exception |
+| const char * | function_name | the io function that returned an error |
+| int | return_value | the return value of the io function |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-IOException)
+
+### public int deimos::IOException::get_inner_error () const noexcept override
+
+return the inner error value that caused this exception
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| int | |
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+* virtual
+
+
+[Go to Top](#deimos-IOException)
+
+[deimos-DeimosException]:./DeimosException.md
diff --git a/doc/Markdown/deimos/PutRequestHandler.md b/doc/Markdown/deimos/PutRequestHandler.md
new file mode 100644
index 0000000000000000000000000000000000000000..da7f9bd59cdc1ec0b99f253cb655015c43b429b1
--- /dev/null
+++ b/doc/Markdown/deimos/PutRequestHandler.md
@@ -0,0 +1,190 @@
+# public deimos::PutRequestHandler
+
+proxygen class implementation for handling PUT requests
+
+
+
+
+## Inheritance:
+Inherits from RequestHandler.
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [onRequest](#deimos-PutRequestHandler-onRequest) | first function to be called when a new request comes in |
+| [onBody](#deimos-PutRequestHandler-onBody) | ccalled with each chunk of the body coming in for the request |
+| [onEOM](#deimos-PutRequestHandler-onEOM) | function called when the incoming message is finished |
+| [onUpgrade](#deimos-PutRequestHandler-onUpgrade) | function called on upgrade |
+| [requestComplete](#deimos-PutRequestHandler-requestComplete) | function ... |
+| [onError](#deimos-PutRequestHandler-onError) | function called when an error occurred |
+| [PutRequestHandler](#deimos-PutRequestHandler-PutRequestHandler) | Constructor for stream class initialization. |
+
+
+
+## Public Functions
+### public void deimos::PutRequestHandler::onRequest (std::unique_ptr< proxygen::HTTPMessage > headers) noexcept override
+
+first function to be called when a new request comes in
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< proxygen::HTTPMessage > | headers | headers of the HTTP message this handler was created for |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-PutRequestHandler)
+
+### public void deimos::PutRequestHandler::onBody (std::unique_ptr< folly::IOBuf > body) noexcept override
+
+ccalled with each chunk of the body coming in for the request
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< folly::IOBuf > | body | chunk of data to be added to the file |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-PutRequestHandler)
+
+### public void deimos::PutRequestHandler::onEOM () noexcept override
+
+function called when the incoming message is finished
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-PutRequestHandler)
+
+### public void deimos::PutRequestHandler::onUpgrade (proxygen::UpgradeProtocol proto) noexcept override
+
+function called on upgrade
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| proxygen::UpgradeProtocol | proto | the new protocol |
+
+
+
+
+
+
+
+
+Not supported in our case!
+
+
+
+
+[Go to Top](#deimos-PutRequestHandler)
+
+### public void deimos::PutRequestHandler::requestComplete () noexcept override
+
+function ...
+
+
+
+
+
+
+
+
+
+
+> **[Todo][todo]:** find out what this does?
+
+
+
+
+[Go to Top](#deimos-PutRequestHandler)
+
+### public void deimos::PutRequestHandler::onError (proxygen::ProxygenError err) noexcept override
+
+function called when an error occurred
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| proxygen::ProxygenError | err | the error |
+
+
+
+
+
+
+
+
+Not supported in our case!
+
+
+
+
+[Go to Top](#deimos-PutRequestHandler)
+
+### public deimos::PutRequestHandler::PutRequestHandler (std::unique_ptr< stream::Stream > input_stream)
+
+Constructor for stream class initialization.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< [stream::Stream][deimos-stream-Stream] > | input_stream | [stream::Stream][deimos-stream-Stream] class instance to initialize the server |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-PutRequestHandler)
+
+[deimos-stream-Stream]:./stream/Stream.md
+[todo]:./../todo.md#todo
diff --git a/doc/Markdown/deimos/UnsupportedRequestHandler.md b/doc/Markdown/deimos/UnsupportedRequestHandler.md
new file mode 100644
index 0000000000000000000000000000000000000000..cc4ce3a82701018941d39bf4e25b470e5dca9245
--- /dev/null
+++ b/doc/Markdown/deimos/UnsupportedRequestHandler.md
@@ -0,0 +1,11 @@
+# public deimos::UnsupportedRequestHandler
+
+proxygen class implementation for handling all requests that we don't support
+
+
+
+
+## Inheritance:
+Inherits from RequestHandler.
+
+
diff --git a/doc/Markdown/deimos/index.md b/doc/Markdown/deimos/index.md
new file mode 100644
index 0000000000000000000000000000000000000000..8679e030485c0ce1fe37b3d78126f92a60718d5f
--- /dev/null
+++ b/doc/Markdown/deimos/index.md
@@ -0,0 +1,33 @@
+# deimos
+
+
+
+
+## Classes
+| Name | Description |
+| ---- | ---- |
+| [DeimosException](./DeimosException.md) | exception class for all user defined exceptions in Deimos |
+| [GetmdRequestHandler](./GetmdRequestHandler.md) | proxygen class implementation for handling HEAD requests |
+| [GetRequestHandler](./GetRequestHandler.md) | proxygen class implementation for handling GET requests |
+| [HandlerFactory](./HandlerFactory.md) | factory to create the handlers for incoming HTTP requests |
+| [IOException](./IOException.md) | exceptions specifically for errors in I/O |
+| [PutRequestHandler](./PutRequestHandler.md) | proxygen class implementation for handling PUT requests |
+| [UnsupportedRequestHandler](./UnsupportedRequestHandler.md) | proxygen class implementation for handling all requests that we don't support |
+
+
+## Namespaces
+| Name | Description |
+| ---- | ---- |
+| [s3_utilities](./s3_utilities/index.md) | namespace for S3 specific utilities |
+| [storage](./storage/index.md) | namespace for storage classes that belong to / inherit from from [deimos::storage::Storage][deimos-storage-Storage] |
+| [stream](./stream/index.md) | namespace for stream classes that belong to / inherit from from [deimos::stream::Stream][deimos-stream-Stream] |
+| [util](./util/index.md) | namespace for utility classes |
+
+
+
+[deimos-DeimosException]:./DeimosException.md
+[deimos-IOException]:./IOException.md
+[deimos-UnsupportedRequestHandler]:./UnsupportedRequestHandler.md
+[deimos-storage-PhobosException]:./storage/PhobosException.md
+[deimos-storage-Storage]:./storage/Storage.md
+[deimos-stream-Stream]:./stream/Stream.md
diff --git a/doc/Markdown/deimos/s3_utilities/S3_authorisation.md b/doc/Markdown/deimos/s3_utilities/S3_authorisation.md
new file mode 100644
index 0000000000000000000000000000000000000000..44891eaa4d40784cd0dd139514f331ab45f88660
--- /dev/null
+++ b/doc/Markdown/deimos/s3_utilities/S3_authorisation.md
@@ -0,0 +1,761 @@
+# public deimos::s3_utilities::S3_authorisation
+
+class to perform an authorisation of an S3 request.
+
+
+
+The implementation of this class follows the guidelines from [https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html)
+
+
+
+
+
+
+## Helper functions
+| Name | Description |
+| ---- | ---- |
+| [search_for_user](#deimos-s3_utilities-S3_authorisation-search_for_user) | checks whether the user id saved in [m_user_identifier][deimos-s3_utilities-S3_authorisation-m_user_identifier] exists in the user database |
+| [has_signed_payload](#deimos-s3_utilities-S3_authorisation-has_signed_payload) | check if this message has a signed content body |
+| [print_info](#deimos-s3_utilities-S3_authorisation-print_info) | print current state of member variables |
+
+
+## Extract header information
+| Name | Description |
+| ---- | ---- |
+| [set_authorisation_info](#deimos-s3_utilities-S3_authorisation-set_authorisation_info) | get the information about authorisation from the header and save it to member variables |
+| [extract_string_part](#deimos-s3_utilities-S3_authorisation-extract_string_part) | Extract information from a string. |
+| [split_signed_headers](#deimos-s3_utilities-S3_authorisation-split_signed_headers) | split up the "SignedHeaders" value of the HTTP request |
+| [split_queries](#deimos-s3_utilities-S3_authorisation-split_queries) | split up the queries string of the HTTP request (thats the part of the request path after '?') |
+| [split_credentials](#deimos-s3_utilities-S3_authorisation-split_credentials) | split up the "Credential" value of the HTTP request |
+
+
+## Signature creation
+| Name | Description |
+| ---- | ---- |
+| [check](#deimos-s3_utilities-S3_authorisation-check) | checks the signature of the message |
+| [create_canonical_request](#deimos-s3_utilities-S3_authorisation-create_canonical_request) | create a canonical request |
+| [create_string_to_sign](#deimos-s3_utilities-S3_authorisation-create_string_to_sign) | create a string to sign |
+| [get_signature](#deimos-s3_utilities-S3_authorisation-get_signature) | create the signature |
+
+
+## Private Attributes
+| Name | Description |
+| ---- | ---- |
+| [m_status](#deimos-s3_utilities-S3_authorisation-m_status) | the current status of the authorisation |
+| [m_user_identifier](#deimos-s3_utilities-S3_authorisation-m_user_identifier) | the public key / identifier of the user that send the request |
+| [m_user_key](#deimos-s3_utilities-S3_authorisation-m_user_key) | the key that belongs to [m_user_identifier][deimos-s3_utilities-S3_authorisation-m_user_identifier] |
+| [m_date](#deimos-s3_utilities-S3_authorisation-m_date) | the date as saved in the credentials of the request |
+| [m_region](#deimos-s3_utilities-S3_authorisation-m_region) | the S3 region as saved in the credentials of the request |
+| [m_signed_headers](#deimos-s3_utilities-S3_authorisation-m_signed_headers) | a (sorted) list of the headers that have been used to sign the request |
+| [m_queries](#deimos-s3_utilities-S3_authorisation-m_queries) | a (sorted) list of all queries split up into key and value |
+| [m_signature](#deimos-s3_utilities-S3_authorisation-m_signature) | the signature stored in the request |
+| [m_payload](#deimos-s3_utilities-S3_authorisation-m_payload) | the payload of the request |
+| [m_error](#deimos-s3_utilities-S3_authorisation-m_error) | the error description if one occurred |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [authorise](#deimos-s3_utilities-S3_authorisation-authorise) | main method to run the authorisation algorithm |
+| [add_chunk](#deimos-s3_utilities-S3_authorisation-add_chunk) | add a chunk of data to the payload |
+| [is_valid](#deimos-s3_utilities-S3_authorisation-is_valid) | checks if the authorisation was successful |
+| [get_status](#deimos-s3_utilities-S3_authorisation-get_status) | returns the current status of the authorisation |
+| [get_error](#deimos-s3_utilities-S3_authorisation-get_error) | returns the internal error |
+
+
+
+## Helper functions
+### private bool deimos::s3_utilities::S3_authorisation::search_for_user ()
+
+checks whether the user id saved in [m_user_identifier][deimos-s3_utilities-S3_authorisation-m_user_identifier] exists in the user database
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | true if the user has been found, false otherwise |
+
+
+
+
+
+
+
+
+
+Sets
+[m_user_key][deimos-s3_utilities-S3_authorisation-m_user_key] on success
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private bool deimos::s3_utilities::S3_authorisation::has_signed_payload (const S3_header &headers) const
+
+check if this message has a signed content body
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const [S3_header][deimos-s3_utilities-S3_header] & | headers | the headers of the message to check |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | true if the message contains a signed body, false if it doesn't have any body of if it is unsigned |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private void deimos::s3_utilities::S3_authorisation::print_info () const
+
+print current state of member variables
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+## Extract header information
+### private bool deimos::s3_utilities::S3_authorisation::set_authorisation_info (const S3_header &headers)
+
+get the information about authorisation from the header and save it to member variables
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const [S3_header][deimos-s3_utilities-S3_header] & | headers | the header to extract the information from |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | true if all information was found, false if an error occurred |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private std::string deimos::s3_utilities::S3_authorisation::extract_string_part (std::string complete, std::string identifier, std::string delimiter) const
+
+Extract information from a string.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | complete | the complete string will all information |
+| std::string | identifier | the identifier of the specific piece of information required |
+| std::string | delimiter | the delimiter between the parts of information |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | required information as string |
+
+
+
+
+
+
+
+
+
+
+
+If there is for example a string of the form "id=info;id2=info2" then ';' is the delimiter, 'id' is the identifier and this function will return "info".
+
+
+
+
+#### Qualifiers:
+* const
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private void deimos::s3_utilities::S3_authorisation::split_signed_headers (std::string all_signed_headers)
+
+split up the "SignedHeaders" value of the HTTP request
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | all_signed_headers | the value of the SignedHeaders header |
+
+
+
+
+
+
+
+
+This function saves the headers into
+[m_signed_headers][deimos-s3_utilities-S3_authorisation-m_signed_headers]
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private void deimos::s3_utilities::S3_authorisation::split_queries (std::string queries)
+
+split up the queries string of the HTTP request (thats the part of the request path after '?')
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | queries | the complete query string |
+
+
+
+
+
+
+
+
+This function saves each query into
+[m_queries][deimos-s3_utilities-S3_authorisation-m_queries]
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private void deimos::s3_utilities::S3_authorisation::split_credentials (std::string credentials)
+
+split up the "Credential" value of the HTTP request
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | credentials | the value of the Credential header |
+
+
+
+
+
+
+
+
+This function saves the credentials into
+[m_user_identifier][deimos-s3_utilities-S3_authorisation-m_user_identifier],
+[m_date][deimos-s3_utilities-S3_authorisation-m_date] and
+[m_region][deimos-s3_utilities-S3_authorisation-m_region]
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+## Signature creation
+### private bool deimos::s3_utilities::S3_authorisation::check (const S3_header &headers) const
+
+checks the signature of the message
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const [S3_header][deimos-s3_utilities-S3_header] & | headers | the headers of the message to check |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | true if the signature was valid, false otherwise |
+
+
+
+
+
+
+
+
+
+
+
+This function splits the message's contents into the needed parts, creates a signature and compares it with the one saved in the headers
+
+
+
+
+#### Qualifiers:
+* const
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private std::string deimos::s3_utilities::S3_authorisation::create_canonical_request (const S3_header &headers) const
+
+create a canonical request
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const [S3_header][deimos-s3_utilities-S3_header] & | headers | the headers of the message to create the request from |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the canonical request |
+
+
+
+
+
+
+
+
+
+
+
+For more information what this means, see:
+[https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html)
+
+
+
+
+
+
+#### Qualifiers:
+* const
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private std::string deimos::s3_utilities::S3_authorisation::create_string_to_sign (const S3_header &headers, std::string canonical_request) const
+
+create a string to sign
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const [S3_header][deimos-s3_utilities-S3_header] & | headers | the headers of the message to create the request from |
+| std::string | canonical_request | the canonical request from [create_canonical_request][deimos-s3_utilities-S3_authorisation-create_canonical_request] |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the string to sign |
+
+
+
+
+
+
+
+
+
+
+
+For more information what this means, see:
+[https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html)
+
+
+
+
+
+
+#### Qualifiers:
+* const
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private std::string deimos::s3_utilities::S3_authorisation::get_signature (std::string string_to_sign) const
+
+create the signature
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | string_to_sign | the string to sign from [create_string_to_sign][deimos-s3_utilities-S3_authorisation-create_string_to_sign] |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the signature |
+
+
+
+
+
+
+
+
+
+
+
+For more information what this means, see:
+[https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html)
+
+
+
+
+
+
+#### Qualifiers:
+* const
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+## Private Attributes
+### private deimos::s3_utilities::S3_authorisation::m_status =
+
+the current status of the authorisation
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private deimos::s3_utilities::S3_authorisation::m_user_identifier
+
+the public key / identifier of the user that send the request
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private deimos::s3_utilities::S3_authorisation::m_user_key
+
+the key that belongs to [m_user_identifier][deimos-s3_utilities-S3_authorisation-m_user_identifier]
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private deimos::s3_utilities::S3_authorisation::m_date
+
+the date as saved in the credentials of the request
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private deimos::s3_utilities::S3_authorisation::m_region
+
+the S3 region as saved in the credentials of the request
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private deimos::s3_utilities::S3_authorisation::m_signed_headers
+
+a (sorted) list of the headers that have been used to sign the request
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private deimos::s3_utilities::S3_authorisation::m_queries
+
+a (sorted) list of all queries split up into key and value
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private deimos::s3_utilities::S3_authorisation::m_signature
+
+the signature stored in the request
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private deimos::s3_utilities::S3_authorisation::m_payload = ""
+
+the payload of the request
+
+
+
+
+
+
+
+
+
+
+This is the whole body since we do not support multiple chunked signatures
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### private deimos::s3_utilities::S3_authorisation::m_error = access_denied
+
+the error description if one occurred
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+## Public Functions
+### public [Authorisation_status][deimos-s3_utilities-Authorisation_status] deimos::s3_utilities::S3_authorisation::authorise (const S3_header &headers)
+
+main method to run the authorisation algorithm
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const [S3_header][deimos-s3_utilities-S3_header] & | headers | of the message to authenticate |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [Authorisation_status][deimos-s3_utilities-Authorisation_status] | status of the authorisation |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### public void deimos::s3_utilities::S3_authorisation::add_chunk (std::string chunk)
+
+add a chunk of data to the payload
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | chunk | the string to add |
+
+
+
+
+
+
+
+
+Since the whole body has to be hashed in order to verify the signature of the message each chunk of data has to be added here in order.
+
+Otherwise the authentication will fail!
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### public bool deimos::s3_utilities::S3_authorisation::is_valid () const
+
+checks if the authorisation was successful
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | true if it has been valid, false if it hasn't started, it is in progress, or if an error occurred. |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### public [Authorisation_status][deimos-s3_utilities-Authorisation_status] deimos::s3_utilities::S3_authorisation::get_status () const
+
+returns the current status of the authorisation
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [Authorisation_status][deimos-s3_utilities-Authorisation_status] | the current status of the authorisaton |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+### public [s3_error_info][deimos-s3_utilities-s3_error_info] deimos::s3_utilities::S3_authorisation::get_error () const
+
+returns the internal error
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [s3_error_info][deimos-s3_utilities-s3_error_info] | the error that might have occurred in the process |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_authorisation)
+
+[deimos-s3_utilities-Authorisation_status]:./index.md#deimos-s3_utilities-Authorisation_status
+[deimos-s3_utilities-S3_authorisation-create_canonical_request]:./S3_authorisation.md#deimos-s3_utilities-S3_authorisation-create_canonical_request
+[deimos-s3_utilities-S3_authorisation-create_string_to_sign]:./S3_authorisation.md#deimos-s3_utilities-S3_authorisation-create_string_to_sign
+[deimos-s3_utilities-S3_authorisation-m_date]:./S3_authorisation.md#deimos-s3_utilities-S3_authorisation-m_date
+[deimos-s3_utilities-S3_authorisation-m_queries]:./S3_authorisation.md#deimos-s3_utilities-S3_authorisation-m_queries
+[deimos-s3_utilities-S3_authorisation-m_region]:./S3_authorisation.md#deimos-s3_utilities-S3_authorisation-m_region
+[deimos-s3_utilities-S3_authorisation-m_signed_headers]:./S3_authorisation.md#deimos-s3_utilities-S3_authorisation-m_signed_headers
+[deimos-s3_utilities-S3_authorisation-m_user_identifier]:./S3_authorisation.md#deimos-s3_utilities-S3_authorisation-m_user_identifier
+[deimos-s3_utilities-S3_authorisation-m_user_key]:./S3_authorisation.md#deimos-s3_utilities-S3_authorisation-m_user_key
+[deimos-s3_utilities-S3_header]:./S3_header.md
+[deimos-s3_utilities-s3_error_info]:./s3_error_info.md
diff --git a/doc/Markdown/deimos/s3_utilities/S3_header.md b/doc/Markdown/deimos/s3_utilities/S3_header.md
new file mode 100644
index 0000000000000000000000000000000000000000..3f23d8b2885151c2541f07d35b52a35ac119a5c8
--- /dev/null
+++ b/doc/Markdown/deimos/s3_utilities/S3_header.md
@@ -0,0 +1,348 @@
+# public deimos::s3_utilities::S3_header
+
+class to extract the S3 specific information from proxygens HTTPMessage headers
+
+
+
+
+## Private Attributes
+| Name | Description |
+| ---- | ---- |
+| [m_headers](#deimos-s3_utilities-S3_header-m_headers) | inner pointer to the proxygen header object |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [set_headers](#deimos-s3_utilities-S3_header-set_headers) | sets the internal header instance to the given header object |
+| [get_bucket](#deimos-s3_utilities-S3_header-get_bucket) | extracts the name of the S3 bucket requested in the HTTP message |
+| [get_key_without_bucket](#deimos-s3_utilities-S3_header-get_key_without_bucket) | extracts the name of the key id requested in the HTTP message |
+| [get_key](#deimos-s3_utilities-S3_header-get_key) | extracts the name of the key id requested in the HTTP message |
+| [is_bucket_only_request](#deimos-s3_utilities-S3_header-is_bucket_only_request) | checks if the message we got is only concerning a bucket or a key inside a bucket |
+| [get_body_length](#deimos-s3_utilities-S3_header-get_body_length) | gets the total length of all body chunks that is expected |
+| [get_meta_data](#deimos-s3_utilities-S3_header-get_meta_data) | gets the S3 metadata stored in the HTTP headers |
+| [get_header_by_name](#deimos-s3_utilities-S3_header-get_header_by_name) | extract one header value from the headers |
+| [get_queries](#deimos-s3_utilities-S3_header-get_queries) | extract the query string from the headers |
+| [get_method](#deimos-s3_utilities-S3_header-get_method) | get the HTTP method the header belongs to |
+
+
+
+## Private Attributes
+### private deimos::s3_utilities::S3_header::m_headers
+
+inner pointer to the proxygen header object
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+## Public Functions
+### public void deimos::s3_utilities::S3_header::set_headers (std::unique_ptr< proxygen::HTTPMessage > new_m_headers)
+
+sets the internal header instance to the given header object
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< proxygen::HTTPMessage > | new_m_headers | headers that should be read out in this instance |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+### public std::string deimos::s3_utilities::S3_header::get_bucket () const
+
+extracts the name of the S3 bucket requested in the HTTP message
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | name of the bucket |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+### public std::string deimos::s3_utilities::S3_header::get_key_without_bucket () const
+
+extracts the name of the key id requested in the HTTP message
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | name of the key |
+
+
+
+
+
+
+
+This will only return the key itself without the leading bucket name!
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+### public std::string deimos::s3_utilities::S3_header::get_key () const
+
+extracts the name of the key id requested in the HTTP message
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | name of the key |
+
+
+
+
+
+
+
+This is the whole path argument without the leading '/' but including the bucket name!
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+### public bool deimos::s3_utilities::S3_header::is_bucket_only_request () const
+
+checks if the message we got is only concerning a bucket or a key inside a bucket
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | true if the path in these headers only has a bucket name false if it contains a key |
+
+
+
+
+
+
+
+The way this is decided currently is by checking if there is a '/' in the path as this would split the bucket name from the key. This might not be ideal...
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+### public size_t deimos::s3_utilities::S3_header::get_body_length () const
+
+gets the total length of all body chunks that is expected
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| size_t | the length of the total body to be expected |
+
+
+
+
+
+
+
+This reads out the header "Content-Length"
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+### public std::map< std::string, std::string > deimos::s3_utilities::S3_header::get_meta_data () const
+
+gets the S3 metadata stored in the HTTP headers
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::map< std::string, std::string > | a map consisting of all key value pairs found in the header |
+
+
+
+
+
+
+
+In S3 arbitrary metadata can be defined. This has the form x-amx-meta-KEY: VALUE for for example a KEY:VALUE pair.
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+### public std::string deimos::s3_utilities::S3_header::get_header_by_name (const std::string header_name) const
+
+extract one header value from the headers
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const std::string | header_name | the name of the header that should be extracted |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the value of the requested header or an empty_string if it is not found |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+### public std::string deimos::s3_utilities::S3_header::get_queries () const
+
+extract the query string from the headers
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the query string of the request or an empty_string if it doesn't have one |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
+### public std::string deimos::s3_utilities::S3_header::get_method () const
+
+get the HTTP method the header belongs to
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the method as a string |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-S3_header)
+
diff --git a/doc/Markdown/deimos/s3_utilities/index.md b/doc/Markdown/deimos/s3_utilities/index.md
new file mode 100644
index 0000000000000000000000000000000000000000..90c953c3eb27f8faaa70a982b92963b6546627a6
--- /dev/null
+++ b/doc/Markdown/deimos/s3_utilities/index.md
@@ -0,0 +1,242 @@
+# deimos::s3_utilities
+
+namespace for S3 specific utilities
+
+
+
+
+## Classes
+| Name | Description |
+| ---- | ---- |
+| [S3_authorisation](./S3_authorisation.md) | class to perform an authorisation of an S3 request. |
+| [s3_error_info](./s3_error_info.md) | class to contain all the information needed to send a proper s3 error message |
+| [S3_header](./S3_header.md) | class to extract the S3 specific information from proxygens HTTPMessage headers |
+
+
+## Enumerations
+| Name | Description |
+| ---- | ---- |
+| [Authorisation_status](#deimos-s3_utilities-Authorisation_status) | enum to store all the different states a [deimos::s3_utilities::S3_authorisation][deimos-s3_utilities-S3_authorisation] object can be in |
+
+
+## Functions
+| Name | Description |
+| ---- | ---- |
+| [create_s3_error](#deimos-s3_utilities-create_s3_error) | create a [s3_error_info][deimos-s3_utilities-s3_error_info] depending on the error value |
+| [uri_encode](#deimos-s3_utilities-uri_encode) | create a uri encoding of a string |
+| [openssl_sha256](#deimos-s3_utilities-openssl_sha256) | create a sha256 hash from the data |
+| [openssl_sha256](#deimos-s3_utilities-openssl_sha256-1) | shortcut for openssl_sha256(void*, unsigned int) |
+| [openssl_hmac](#deimos-s3_utilities-openssl_hmac) | create a key hashed message |
+| [openssl_hmac_hex](#deimos-s3_utilities-openssl_hmac_hex) | create a key hashed message |
+
+
+
+## Enumerations
+### public deimos::s3_utilities::Authorisation_status
+
+enum to store all the different states a [deimos::s3_utilities::S3_authorisation][deimos-s3_utilities-S3_authorisation] object can be in
+
+
+
+
+
+
+#### Enum Values:
+| Name | Description | Value |
+| ---- | ---- | ---- |
+| undefined | authorisation has not yet started | |
+| waiting_for_payload | members have been set up and payload can be added | |
+| failed | the authorisation was invalid or some error occurred | |
+| valid | authorisation successful | |
+
+
+
+[Go to Top](#deimos-s3_utilities)
+
+## Functions
+### public [s3_error_info][deimos-s3_utilities-s3_error_info] deimos::s3_utilities::create_s3_error (const int return_value)
+
+create a [s3_error_info][deimos-s3_utilities-s3_error_info] depending on the error value
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const int | return_value | the error code (errno, etc) that the function returned that raised the exception that preceded the call to this function |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [s3_error_info][deimos-s3_utilities-s3_error_info] | an [s3_error_info][deimos-s3_utilities-s3_error_info] struct containing readable information on the error |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities)
+
+### public std::string deimos::s3_utilities::uri_encode (const std::string string_to_encode, const bool encode_slash)
+
+create a uri encoding of a string
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const std::string | string_to_encode | the string that should be encoded |
+| const bool | encode_slash | bool to signalise if the / should be encoded |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the URI encoded string |
+
+
+
+
+
+
+
+for more information see [https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html)
+
+
+
+
+[Go to Top](#deimos-s3_utilities)
+
+### public std::string deimos::s3_utilities::openssl_sha256 (const void *data, const unsigned int length)
+
+create a sha256 hash from the data
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const void * | data | buffer to the data to hash |
+| const unsigned int | length | number of byte in the buffer |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the resulting hash as string or "" in case of error |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities)
+
+### public std::string deimos::s3_utilities::openssl_sha256 (const std::string msg)
+
+shortcut for openssl_sha256(void*, unsigned int)
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const std::string | msg | the string to hash |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the resulting hash as string or "" in case of error |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities)
+
+### public std::string deimos::s3_utilities::openssl_hmac (const std::string key, const std::string msg)
+
+create a key hashed message
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const std::string | key | the key to sign the message with |
+| const std::string | msg | the message to sign |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | a string representation of the signed message (unreadable) |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities)
+
+### public std::string deimos::s3_utilities::openssl_hmac_hex (const std::string key, const std::string msg)
+
+create a key hashed message
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const std::string | key | the key to sign the message with |
+| const std::string | msg | the message to sign |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | the signed message in HEX format |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities)
+
+[deimos-s3_utilities-S3_authorisation]:./S3_authorisation.md
+[deimos-s3_utilities-s3_error_info]:./s3_error_info.md
diff --git a/doc/Markdown/deimos/s3_utilities/s3_error_info.md b/doc/Markdown/deimos/s3_utilities/s3_error_info.md
new file mode 100644
index 0000000000000000000000000000000000000000..2c74198b81476133ab8d0a692ee332f48bfca4a4
--- /dev/null
+++ b/doc/Markdown/deimos/s3_utilities/s3_error_info.md
@@ -0,0 +1,173 @@
+# public deimos::s3_utilities::s3_error_info
+
+class to contain all the information needed to send a proper s3 error message
+
+
+
+
+## Public Attributes
+| Name | Description |
+| ---- | ---- |
+| [https_error_code](#deimos-s3_utilities-s3_error_info-https_error_code) | https error code (400s or 500s) |
+| [https_error_identifier](#deimos-s3_utilities-s3_error_info-https_error_identifier) | readable string for the code [https_error_code][deimos-s3_utilities-s3_error_info-https_error_code] |
+| [https_error_message](#deimos-s3_utilities-s3_error_info-https_error_message) | human readable message with information on the error |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [get_xml](#deimos-s3_utilities-s3_error_info-get_xml) | created a XML message containing all the error information |
+| [operator==](#deimos-s3_utilities-s3_error_info-operator==) | equality operator |
+| [operator!=](#deimos-s3_utilities-s3_error_info-operator!=) | inequality operator |
+
+
+
+## Public Attributes
+### public deimos::s3_utilities::s3_error_info::https_error_code
+
+https error code (400s or 500s)
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-s3_error_info)
+
+### public deimos::s3_utilities::s3_error_info::https_error_identifier
+
+readable string for the code [https_error_code][deimos-s3_utilities-s3_error_info-https_error_code]
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-s3_error_info)
+
+### public deimos::s3_utilities::s3_error_info::https_error_message
+
+human readable message with information on the error
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-s3_utilities-s3_error_info)
+
+## Public Functions
+### public std::string deimos::s3_utilities::s3_error_info::get_xml (const std::string request) const
+
+created a XML message containing all the error information
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const std::string | request | the request that was processed when this error occurred |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::string | a string containg an S3 compatible XML error message |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+
+
+[Go to Top](#deimos-s3_utilities-s3_error_info)
+
+### public bool deimos::s3_utilities::s3_error_info::operator== (const s3_error_info &other) const
+
+equality operator
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const [s3_error_info][deimos-s3_utilities-s3_error_info] & | other | the other error info object to compare |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | |
+
+
+
+
+
+
+
+
+return true if all inner members are equal, false otherwise
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-s3_error_info)
+
+### public bool deimos::s3_utilities::s3_error_info::operator!= (const s3_error_info &other) const
+
+inequality operator
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const [s3_error_info][deimos-s3_utilities-s3_error_info] & | other | the other error info object to compare |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | |
+
+
+
+
+
+
+
+
+return true if any inner member is different, false otherwise (all equal)
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-s3_utilities-s3_error_info)
+
+[deimos-s3_utilities-s3_error_info]:./s3_error_info.md
+[deimos-s3_utilities-s3_error_info-https_error_code]:./s3_error_info.md#deimos-s3_utilities-s3_error_info-https_error_code
diff --git a/doc/Markdown/deimos/storage/PhobosException.md b/doc/Markdown/deimos/storage/PhobosException.md
new file mode 100644
index 0000000000000000000000000000000000000000..937973d45a24b7404a4836736b6579c8550e754d
--- /dev/null
+++ b/doc/Markdown/deimos/storage/PhobosException.md
@@ -0,0 +1,95 @@
+# public deimos::storage::PhobosException
+
+exceptions specifically for the phobos backend library
+
+
+
+
+## Inheritance:
+Inherits from [deimos::DeimosException][deimos-DeimosException].
+
+## Private Attributes
+| Name | Description |
+| ---- | ---- |
+| [m_inner_value](#deimos-storage-PhobosException-m_inner_value) | the value of the error that caused this exception |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [PhobosException](#deimos-storage-PhobosException-PhobosException) | constructor |
+| [get_inner_error](#deimos-storage-PhobosException-get_inner_error) | return the inner error value that caused this exception |
+
+
+
+## Private Attributes
+### private deimos::storage::PhobosException::m_inner_value = 0
+
+the value of the error that caused this exception
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-storage-PhobosException)
+
+## Public Functions
+### public deimos::storage::PhobosException::PhobosException (const char *caller, const char *function_name, int return_value)
+
+constructor
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const char * | caller | the function that threw this exception |
+| const char * | function_name | the phobos function that returned an error |
+| int | return_value | the return value of the phobos function |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-storage-PhobosException)
+
+### public int deimos::storage::PhobosException::get_inner_error () const noexcept override
+
+return the inner error value that caused this exception
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| int | |
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+* virtual
+
+
+[Go to Top](#deimos-storage-PhobosException)
+
+[deimos-DeimosException]:./../DeimosException.md
diff --git a/doc/Markdown/deimos/storage/Phobos_file.md b/doc/Markdown/deimos/storage/Phobos_file.md
new file mode 100644
index 0000000000000000000000000000000000000000..fc4af11848ab2005785b23f60beb26fcb5f34ebc
--- /dev/null
+++ b/doc/Markdown/deimos/storage/Phobos_file.md
@@ -0,0 +1,393 @@
+# public deimos::storage::Phobos_file
+
+Phobos specific mplementation of the [Storage][deimos-storage-Storage] class.
+
+
+
+This class uses the phobos library as a backend to store and retrieve files in chunks.
+
+
+
+
+## Inheritance:
+Inherits from [deimos::storage::Storage][deimos-storage-Storage].
+
+## Private Attributes
+| Name | Description |
+| ---- | ---- |
+| [m_descriptor](#deimos-storage-Phobos_file-m_descriptor) | struct to contain information for phobos |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [Phobos_file](#deimos-storage-Phobos_file-Phobos_file) | default constructor |
+| [~Phobos_file](#deimos-storage-Phobos_file-~Phobos_file) | default destructor |
+| [Phobos_file](#deimos-storage-Phobos_file-Phobos_file-1) | default move contructor |
+| [operator=](#deimos-storage-Phobos_file-operator=) | default assignment operator for rvalue references |
+| [Phobos_file](#deimos-storage-Phobos_file-Phobos_file-2) | copy constructor deleted |
+| [operator=](#deimos-storage-Phobos_file-operator=-1) | assignment operator deleted |
+| [set_meta_data](#deimos-storage-Phobos_file-set_meta_data) | set the metadata that an object that is added to the database should get |
+| [get_meta_data](#deimos-storage-Phobos_file-get_meta_data) | get the metadata associated to the current object as a map of key:value pairs |
+| [db_put](#deimos-storage-Phobos_file-db_put) | Puts data to the databse. |
+| [db_get](#deimos-storage-Phobos_file-db_get) | Gets data from the databse. |
+| [prepare_put](#deimos-storage-Phobos_file-prepare_put) | Starts a put operation to the database. |
+| [prepare_get](#deimos-storage-Phobos_file-prepare_get) | Starts a get operation to the database. |
+
+
+## Private Functions
+| Name | Description |
+| ---- | ---- |
+| [set_bucket_name](#deimos-storage-Phobos_file-set_bucket_name) | set the name for the bucket an object blongs to |
+| [close_file](#deimos-storage-Phobos_file-close_file) | close the file opened for phobos |
+
+
+
+## Private Attributes
+### private deimos::storage::Phobos_file::m_descriptor = {0}
+
+struct to contain information for phobos
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+## Public Functions
+### public deimos::storage::Phobos_file::Phobos_file ()
+
+default constructor
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public deimos::storage::Phobos_file::~Phobos_file ()
+
+default destructor
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public deimos::storage::Phobos_file::Phobos_file (Phobos_file &&input)
+
+default move contructor
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| [Phobos_file][deimos-storage-Phobos_file] && | input | |
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public [Phobos_file][deimos-storage-Phobos_file] & deimos::storage::Phobos_file::operator= (Phobos_file &&input)
+
+default assignment operator for rvalue references
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| [Phobos_file][deimos-storage-Phobos_file] && | input | |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [Phobos_file][deimos-storage-Phobos_file] & | |
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public deimos::storage::Phobos_file::Phobos_file (const Phobos_file &)=delete
+
+copy constructor deleted
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public [Phobos_file][deimos-storage-Phobos_file] & deimos::storage::Phobos_file::operator= (const Phobos_file &)=delete
+
+assignment operator deleted
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [Phobos_file][deimos-storage-Phobos_file] & | |
+
+
+
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public void deimos::storage::Phobos_file::set_meta_data (std::map< std::string, std::string > meta_data) override
+
+set the metadata that an object that is added to the database should get
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::map< std::string, std::string > | meta_data | a map of all key:value pairs that should be added to the data |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public std::map< std::string, std::string > deimos::storage::Phobos_file::get_meta_data (std::string object_id) override
+
+get the metadata associated to the current object as a map of key:value pairs
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | object_id | The object id of the requested object |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::map< std::string, std::string > | a map of the key:value metadata pairs |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public ssize_t deimos::storage::Phobos_file::db_put (size_t size) override
+
+Puts data to the databse.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| size_t | size | the number of bytes to add to the file in the database |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| ssize_t | |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public ssize_t deimos::storage::Phobos_file::db_get () override
+
+Gets data from the databse.
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| ssize_t | the number of bytes read from the database |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public void deimos::storage::Phobos_file::prepare_put (int file_descriptor, std::string object_id) override
+
+Starts a put operation to the database.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| int | file_descriptor | the descriptor of the open file, which contents should be added to the database |
+| std::string | object_id | the internal storage id the data should get |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### public void deimos::storage::Phobos_file::prepare_get (int file_descriptor, std::string object_id) override
+
+Starts a get operation to the database.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| int | file_descriptor | the descriptor of the open file, to which the contents of the database should be written |
+| std::string | object_id | the internal storage id from the data that should be retrieved |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+## Private Functions
+### private void deimos::storage::Phobos_file::set_bucket_name (std::string bucket_name)
+
+set the name for the bucket an object blongs to
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | bucket_name | name of the bucket |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+### private void deimos::storage::Phobos_file::close_file ()
+
+close the file opened for phobos
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-storage-Phobos_file)
+
+[deimos-storage-Phobos_file]:./Phobos_file.md
+[deimos-storage-Storage]:./Storage.md
diff --git a/doc/Markdown/deimos/storage/Storage.md b/doc/Markdown/deimos/storage/Storage.md
new file mode 100644
index 0000000000000000000000000000000000000000..4b7cd578478383180a7497ca5b8e7004a6c11517
--- /dev/null
+++ b/doc/Markdown/deimos/storage/Storage.md
@@ -0,0 +1,269 @@
+# public deimos::storage::Storage
+
+virtual storage class to be implemented by backend storage
+
+
+
+This class is a prototype for every class that handles to internal database that should be accessed by the Deimos. This class represents exactly one object file in the internal database
+
+
+
+
+## Inheritance:
+Is inherited by [deimos::storage::Phobos_file][deimos-storage-Phobos_file].
+
+## Metadata functions
+| Name | Description |
+| ---- | ---- |
+| [set_meta_data](#deimos-storage-Storage-set_meta_data) | set the metadata that an object that is added to the database should get |
+| [get_meta_data](#deimos-storage-Storage-get_meta_data) | get the metadata associated to the current object as a map of key:value pairs |
+
+
+## PUT functions
+| Name | Description |
+| ---- | ---- |
+| [prepare_put](#deimos-storage-Storage-prepare_put) | Starts a put operation to the database. |
+| [db_put](#deimos-storage-Storage-db_put) | Puts data to the databse. |
+
+
+## GET functions
+| Name | Description |
+| ---- | ---- |
+| [prepare_get](#deimos-storage-Storage-prepare_get) | Starts a get operation to the database. |
+| [db_get](#deimos-storage-Storage-db_get) | Gets data from the databse. |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [Storage](#deimos-storage-Storage-Storage) | default constructor |
+| [~Storage](#deimos-storage-Storage-~Storage) | default destructor |
+
+
+
+## Metadata functions
+### public void deimos::storage::Storage::set_meta_data (std::map< std::string, std::string > meta_data)=0
+
+set the metadata that an object that is added to the database should get
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::map< std::string, std::string > | meta_data | a map of all key:value pairs that should be added to the data |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Storage)
+
+### public std::map< std::string, std::string > deimos::storage::Storage::get_meta_data (std::string object_id)=0
+
+get the metadata associated to the current object as a map of key:value pairs
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | object_id | The object id of the requested object |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::map< std::string, std::string > | a map of the key:value metadata pairs |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Storage)
+
+## PUT functions
+### public void deimos::storage::Storage::prepare_put (int file_descriptor, std::string object_id)=0
+
+Starts a put operation to the database.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| int | file_descriptor | the descriptor of the open file, which contents should be added to the database |
+| std::string | object_id | the internal storage id the data should get |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Storage)
+
+### public ssize_t deimos::storage::Storage::db_put (size_t size)=0
+
+Puts data to the databse.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| size_t | size | the number of bytes to add to the file in the database |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| ssize_t | |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Storage)
+
+## GET functions
+### public void deimos::storage::Storage::prepare_get (int file_descriptor, std::string object_id)=0
+
+Starts a get operation to the database.
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| int | file_descriptor | the descriptor of the open file, to which the contents of the database should be written |
+| std::string | object_id | the internal storage id from the data that should be retrieved |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Storage)
+
+### public ssize_t deimos::storage::Storage::db_get ()=0
+
+Gets data from the databse.
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| ssize_t | the number of bytes read from the database |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-storage-Storage)
+
+## Public Functions
+### public deimos::storage::Storage::Storage ()
+
+default constructor
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-storage-Storage)
+
+### public deimos::storage::Storage::~Storage ()
+
+default destructor
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+* virtual
+
+
+[Go to Top](#deimos-storage-Storage)
+
+[deimos-storage-Phobos_file]:./Phobos_file.md
diff --git a/doc/Markdown/deimos/storage/index.md b/doc/Markdown/deimos/storage/index.md
new file mode 100644
index 0000000000000000000000000000000000000000..fabe07cabbae243d8e1f519c96bd55e998ac1000
--- /dev/null
+++ b/doc/Markdown/deimos/storage/index.md
@@ -0,0 +1,19 @@
+# deimos::storage
+
+namespace for storage classes that belong to / inherit from from [deimos::storage::Storage][deimos-storage-Storage]
+
+
+
+
+## Classes
+| Name | Description |
+| ---- | ---- |
+| [Phobos_file](./Phobos_file.md) | Phobos specific mplementation of the [Storage][deimos-storage-Storage] class. |
+| [PhobosException](./PhobosException.md) | exceptions specifically for the phobos backend library |
+| [Storage](./Storage.md) | virtual storage class to be implemented by backend storage |
+
+
+
+[deimos-DeimosException]:./../DeimosException.md
+[deimos-storage-Phobos_file]:./Phobos_file.md
+[deimos-storage-Storage]:./Storage.md
diff --git a/doc/Markdown/deimos/stream/Fifo.md b/doc/Markdown/deimos/stream/Fifo.md
new file mode 100644
index 0000000000000000000000000000000000000000..a9b2c395a40c7b1ec7417632052340141c227551
--- /dev/null
+++ b/doc/Markdown/deimos/stream/Fifo.md
@@ -0,0 +1,487 @@
+# public deimos::stream::Fifo
+
+FIFO specific implementation of the [Stream][deimos-stream-Stream] class.
+
+
+
+This class uses a fifo to stream data from the server to a backend storage class. Therefore, all data gets written to the fifo and the implementation of the internal [storage::Storage][deimos-storage-Storage] class can read and process it from the other end of the fifo.
+
+
+
+
+## Inheritance:
+Inherits from [deimos::stream::Stream][deimos-stream-Stream].
+
+## Implementation specific details
+| Name | Description |
+| ---- | ---- |
+| [get_fifo_descriptors](#deimos-stream-Fifo-get_fifo_descriptors) | get the descriptor of the fifo |
+
+
+## Private Attributes
+| Name | Description |
+| ---- | ---- |
+| [m_fifo_descriptor[2]](#deimos-stream-Fifo-m_fifo_descriptor) | the file descriptors for the FIFO. |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [Fifo](#deimos-stream-Fifo-Fifo) | default constructor |
+| [~Fifo](#deimos-stream-Fifo-~Fifo) | default destructor |
+| [Fifo](#deimos-stream-Fifo-Fifo-1) | move contructor |
+| [operator=](#deimos-stream-Fifo-operator=) | assignment operator for rvalue references |
+| [Fifo](#deimos-stream-Fifo-Fifo-2) | copy constructor deleted |
+| [operator=](#deimos-stream-Fifo-operator=-1) | assignment operator deleted |
+| [set_storage_meta_data](#deimos-stream-Fifo-set_storage_meta_data) | setting the metadata that the created object should get |
+| [get_meta_data](#deimos-stream-Fifo-get_meta_data) | get the metadata associated to the current object as a map of key:value pairs |
+| [start_put](#deimos-stream-Fifo-start_put) | start a put operation |
+| [put](#deimos-stream-Fifo-put) | add a chunk of data to the object |
+| [start_get](#deimos-stream-Fifo-start_get) | start a gett operation |
+| [get](#deimos-stream-Fifo-get) | gets a chunk of data of the object |
+| [finish_io](#deimos-stream-Fifo-finish_io) | end an I/O operation |
+
+
+## Private Functions
+| Name | Description |
+| ---- | ---- |
+| [create_fifo](#deimos-stream-Fifo-create_fifo) | create a fifo by using the pipe command on the m_fifo_descriptor |
+
+
+
+## Implementation specific details
+### public const int * deimos::stream::Fifo::get_fifo_descriptors () const
+
+get the descriptor of the fifo
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| const int * | the descriptor of the fifo |
+
+
+
+
+
+
+
+
+
+
+> **[Todo][todo]:** Do we use this? should this really be public?
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+## Private Attributes
+### private deimos::stream::Fifo::m_fifo_descriptor[2] [2] = {-1, -1}
+
+the file descriptors for the FIFO.
+
+
+
+
+
+
+
+
+
+
+
+- Index 0 for read end
+
+- Index 1 for write end
+
+
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+## Public Functions
+### public deimos::stream::Fifo::Fifo (std::unique_ptr< storage::Storage > input_storage)
+
+default constructor
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< [storage::Storage][deimos-storage-Storage] > | input_storage | |
+
+
+
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public deimos::stream::Fifo::~Fifo ()
+
+default destructor
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public deimos::stream::Fifo::Fifo (Fifo &&input)
+
+move contructor
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| [Fifo][deimos-stream-Fifo] && | input | the other object to be moved |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public [Fifo][deimos-stream-Fifo] & deimos::stream::Fifo::operator= (Fifo &&input)
+
+assignment operator for rvalue references
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| [Fifo][deimos-stream-Fifo] && | input | the other object to assign |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [Fifo][deimos-stream-Fifo] & | reference to newly created object |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public deimos::stream::Fifo::Fifo (const Fifo &)=delete
+
+copy constructor deleted
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public [Fifo][deimos-stream-Fifo] & deimos::stream::Fifo::operator= (const Fifo &)=delete
+
+assignment operator deleted
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [Fifo][deimos-stream-Fifo] & | |
+
+
+
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public void deimos::stream::Fifo::set_storage_meta_data (std::map< std::string, std::string > meta_data) const override
+
+setting the metadata that the created object should get
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::map< std::string, std::string > | meta_data | a map of all key:value pairs that should be added to the data |
+
+
+
+
+
+
+
+
+
+> **warning:** this function is responsible for getting metadata to the storage implementation
+
+
+
+
+Just passes the data along to the backend
+
+
+
+
+#### Qualifiers:
+* const
+* virtual
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public std::map< std::string, std::string > deimos::stream::Fifo::get_meta_data (std::string object_id) const override
+
+get the metadata associated to the current object as a map of key:value pairs
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | object_id | The object id of the requested object |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::map< std::string, std::string > | a map of the key:value metadata pairs |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* virtual
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public void deimos::stream::Fifo::start_put (ssize_t size, std::string object_id) override
+
+start a put operation
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| ssize_t | size | amount of bytes that shall be added to the internal storage |
+| std::string | object_id | the identifier the object should get |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public ssize_t deimos::stream::Fifo::put (const void *data, size_t count) const override
+
+add a chunk of data to the object
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const void * | data | the chunked data to add |
+| size_t | count | the size of the buffer / chunk |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| ssize_t | the amount of bytes written to internal storage |
+
+
+
+
+
+
+
+This function can be called repeatedly until the server's message body is depleted
+
+
+
+
+#### Qualifiers:
+* const
+* virtual
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public void deimos::stream::Fifo::start_get (std::string object_id) override
+
+start a gett operation
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | object_id | the identifier of the object to retrieve |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public ssize_t deimos::stream::Fifo::get (void *buf, size_t count) const override
+
+gets a chunk of data of the object
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| void * | buf | a buffer for the data to be filled in this function |
+| size_t | count | the size of the buffer / chunk |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| ssize_t | the number of bytes the buffer has been filled with |
+
+
+
+
+
+
+
+
+
+
+
+Repeatedly called to read from FIFO into buffer until the FIFO is empty and closed on the writing end
+
+
+
+
+#### Qualifiers:
+* const
+* virtual
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+### public void deimos::stream::Fifo::finish_io () override
+
+end an I/O operation
+
+
+
+
+
+
+
+
+
+
+This will throw a [storage::PhobosException][deimos-storage-PhobosException] in case an error occurred in
+[storage::Phobos_file][deimos-storage-Phobos_file] during I/O.
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+## Private Functions
+### private void deimos::stream::Fifo::create_fifo ()
+
+create a fifo by using the pipe command on the m_fifo_descriptor
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-stream-Fifo)
+
+[deimos-storage-PhobosException]:./../storage/PhobosException.md
+[deimos-storage-Phobos_file]:./../storage/Phobos_file.md
+[deimos-storage-Storage]:./../storage/Storage.md
+[deimos-stream-Fifo]:./Fifo.md
+[deimos-stream-Stream]:./Stream.md
+[todo]:./../../todo.md#todo
diff --git a/doc/Markdown/deimos/stream/Stream.md b/doc/Markdown/deimos/stream/Stream.md
new file mode 100644
index 0000000000000000000000000000000000000000..3b727a3d0b7502c7be51996f016ff47de309bd94
--- /dev/null
+++ b/doc/Markdown/deimos/stream/Stream.md
@@ -0,0 +1,360 @@
+# public deimos::stream::Stream
+
+virtual [Stream][deimos-stream-Stream] class to be implemented for streaming chunks of data between the server and a backend
+[storage::Storage][deimos-storage-Storage] class
+
+
+
+
+## Inheritance:
+Is inherited by [deimos::stream::Fifo][deimos-stream-Fifo].
+
+## PUT functions
+| Name | Description |
+| ---- | ---- |
+| [start_put](#deimos-stream-Stream-start_put) | start a put operation |
+| [put](#deimos-stream-Stream-put) | add a chunk of data to the object |
+| [start_get](#deimos-stream-Stream-start_get) | start a gett operation |
+| [get](#deimos-stream-Stream-get) | gets a chunk of data of the object |
+| [finish_io](#deimos-stream-Stream-finish_io) | end an I/O operation |
+
+
+## Protected Attributes
+| Name | Description |
+| ---- | ---- |
+| [m_storage](#deimos-stream-Stream-m_storage) | an implementation of [storage::Storage][deimos-storage-Storage] that will be used as a database for the objects |
+| [m_db_result](#deimos-stream-Stream-m_db_result) | a future object that can be used to get the results from the asynchronous backend |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [Stream](#deimos-stream-Stream-Stream) | default constructor |
+| [Stream](#deimos-stream-Stream-Stream-1) | constructor with storage implementation |
+| [~Stream](#deimos-stream-Stream-~Stream) | default destructor |
+| [set_storage_meta_data](#deimos-stream-Stream-set_storage_meta_data) | setting the metadata that the created object should get |
+| [get_meta_data](#deimos-stream-Stream-get_meta_data) | get the metadata associated to the current object as a map of key:value pairs |
+
+
+
+## PUT functions
+### public void deimos::stream::Stream::start_put (ssize_t size, std::string object_id)=0
+
+start a put operation
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| ssize_t | size | amount of bytes that shall be added to the internal storage |
+| std::string | object_id | the identifier the object should get |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-stream-Stream)
+
+### public ssize_t deimos::stream::Stream::put (const void *data, size_t count) const =0
+
+add a chunk of data to the object
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| const void * | data | the chunked data to add |
+| size_t | count | the size of the buffer / chunk |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| ssize_t | the amount of bytes written to internal storage |
+
+
+
+
+
+
+
+This function can be called repeatedly until the server's message body is depleted
+
+
+
+
+#### Qualifiers:
+* const
+* virtual
+
+
+[Go to Top](#deimos-stream-Stream)
+
+### public void deimos::stream::Stream::start_get (std::string object_id)=0
+
+start a gett operation
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | object_id | the identifier of the object to retrieve |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-stream-Stream)
+
+### public ssize_t deimos::stream::Stream::get (void *buf, size_t count) const =0
+
+gets a chunk of data of the object
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| void * | buf | a buffer for the data to be filled in this function |
+| size_t | count | the size of the buffer / chunk |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| ssize_t | the number of bytes the buffer has been filled with |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* virtual
+
+
+[Go to Top](#deimos-stream-Stream)
+
+### public void deimos::stream::Stream::finish_io ()=0
+
+end an I/O operation
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* virtual
+
+
+[Go to Top](#deimos-stream-Stream)
+
+## Protected Attributes
+### protected deimos::stream::Stream::m_storage
+
+an implementation of [storage::Storage][deimos-storage-Storage] that will be used as a database for the objects
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-stream-Stream)
+
+### protected deimos::stream::Stream::m_db_result
+
+a future object that can be used to get the results from the asynchronous backend
+
+
+
+
+
+
+
+
+
+
+> **[Todo][todo]:** should this really be a protected member in the interface? Isn't it the decision of the implementation to make this asynchronous?
+
+
+
+
+[Go to Top](#deimos-stream-Stream)
+
+## Public Functions
+### public deimos::stream::Stream::Stream ()
+
+default constructor
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-stream-Stream)
+
+### public deimos::stream::Stream::Stream (std::unique_ptr< storage::Storage > input_storage)
+
+constructor with storage implementation
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::unique_ptr< [storage::Storage][deimos-storage-Storage] > | input_storage | pointer to a implementation of the [storage::Storage][deimos-storage-Storage] class that will be used to store the data |
+
+
+
+
+
+
+
+
+
+> **warning:** every class that inherits this interface must have an internal [storage::Storage][deimos-storage-Storage] implementation and initialize this here.
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-stream-Stream)
+
+### public deimos::stream::Stream::~Stream ()
+
+default destructor
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+* virtual
+
+
+[Go to Top](#deimos-stream-Stream)
+
+### public void deimos::stream::Stream::set_storage_meta_data (std::map< std::string, std::string > meta_data) const =0
+
+setting the metadata that the created object should get
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::map< std::string, std::string > | meta_data | a map of all key:value pairs that should be added to the data |
+
+
+
+
+
+
+
+
+
+> **warning:** this function is responsible for getting metadata to the storage implementation
+
+
+
+
+#### Qualifiers:
+* const
+* virtual
+
+
+[Go to Top](#deimos-stream-Stream)
+
+### public std::map< std::string, std::string > deimos::stream::Stream::get_meta_data (std::string object_id) const =0
+
+get the metadata associated to the current object as a map of key:value pairs
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| std::string | object_id | The object id of the requested object |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| std::map< std::string, std::string > | a map of the key:value metadata pairs |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* virtual
+
+
+[Go to Top](#deimos-stream-Stream)
+
+[deimos-storage-Storage]:./../storage/Storage.md
+[deimos-stream-Fifo]:./Fifo.md
+[deimos-stream-Stream]:./Stream.md
+[todo]:./../../todo.md#todo
diff --git a/doc/Markdown/deimos/stream/index.md b/doc/Markdown/deimos/stream/index.md
new file mode 100644
index 0000000000000000000000000000000000000000..ae0a04490d32174e50126d1f7f1dd2070a1030ff
--- /dev/null
+++ b/doc/Markdown/deimos/stream/index.md
@@ -0,0 +1,19 @@
+# deimos::stream
+
+namespace for stream classes that belong to / inherit from from [deimos::stream::Stream][deimos-stream-Stream]
+
+
+
+
+## Classes
+| Name | Description |
+| ---- | ---- |
+| [Fifo](./Fifo.md) | FIFO specific implementation of the [Stream][deimos-stream-Stream] class. |
+| [Stream](./Stream.md) | virtual [Stream][deimos-stream-Stream] class to be implemented for streaming chunks of data between the server and a backend
+[storage::Storage][deimos-storage-Storage] class |
+
+
+
+[deimos-storage-Storage]:./../storage/Storage.md
+[deimos-stream-Fifo]:./Fifo.md
+[deimos-stream-Stream]:./Stream.md
diff --git a/doc/Markdown/deimos/util/Config.md b/doc/Markdown/deimos/util/Config.md
new file mode 100644
index 0000000000000000000000000000000000000000..8a3e1c9f117f91ee73e04b3ef844cb93df02f2bb
--- /dev/null
+++ b/doc/Markdown/deimos/util/Config.md
@@ -0,0 +1,376 @@
+# public deimos::util::Config
+
+class for handling command line arguments and configuration files
+
+
+
+
+## Private Attributes
+| Name | Description |
+| ---- | ---- |
+| [m_parser](#deimos-util-Config-m_parser) | CLI11 class to handle parsing. |
+| [m_start](#deimos-util-Config-m_start) | CLI11 class for start subcommand. |
+| [m_stop](#deimos-util-Config-m_stop) | CLI11 class for stop subcommand. |
+| [m_restart](#deimos-util-Config-m_restart) | CLI11 class for restart subcommand. |
+| [m_http_port](#deimos-util-Config-m_http_port) | port to listen on with HTTP protocol |
+| [m_http2_port](#deimos-util-Config-m_http2_port) | port to listen on with HTTP2 protocol |
+| [m_hostname](#deimos-util-Config-m_hostname) | IP/Hostname to bind to. |
+| [m_thread_count](#deimos-util-Config-m_thread_count) | Number of threads to listen on. |
+| [m_config_filename](#deimos-util-Config-m_config_filename) | filename to write configuration options to |
+| [m_log_filename](#deimos-util-Config-m_log_filename) | filename to write logs to |
+
+
+## Public Functions
+| Name | Description |
+| ---- | ---- |
+| [Config](#deimos-util-Config-Config) | default constructor |
+| [~Config](#deimos-util-Config-~Config) | default destructor |
+| [parse](#deimos-util-Config-parse) | parse command line arguments |
+| [start_daemon](#deimos-util-Config-start_daemon) | query if the server daemon should be started |
+| [stop_daemon](#deimos-util-Config-stop_daemon) | query if the server daemon should be stopped |
+| [restart_daemon](#deimos-util-Config-restart_daemon) | query if the server daemon should be restarted |
+
+
+## Private Functions
+| Name | Description |
+| ---- | ---- |
+| [define_options](#deimos-util-Config-define_options) | define the supported command line options |
+| [handle_arguments](#deimos-util-Config-handle_arguments) | perform any required adjustments to options |
+
+
+
+## Private Attributes
+### private deimos::util::Config::m_parser
+
+CLI11 class to handle parsing.
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private deimos::util::Config::m_start
+
+CLI11 class for start subcommand.
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private deimos::util::Config::m_stop
+
+CLI11 class for stop subcommand.
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private deimos::util::Config::m_restart
+
+CLI11 class for restart subcommand.
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private deimos::util::Config::m_http_port = 11000
+
+port to listen on with HTTP protocol
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private deimos::util::Config::m_http2_port = 11002
+
+port to listen on with HTTP2 protocol
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private deimos::util::Config::m_hostname
+
+IP/Hostname to bind to.
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private deimos::util::Config::m_thread_count = 0
+
+Number of threads to listen on.
+
+
+
+
+
+
+
+
+
+
+
+- default 0 uses the number of available cores
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private deimos::util::Config::m_config_filename
+
+filename to write configuration options to
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private deimos::util::Config::m_log_filename = "/tmp/deimos_log.txt"
+
+filename to write logs to
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+## Public Functions
+### public deimos::util::Config::Config ()
+
+default constructor
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-util-Config)
+
+### public deimos::util::Config::~Config ()
+
+default destructor
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* inline
+
+
+[Go to Top](#deimos-util-Config)
+
+### public [cli_options][deimos-util-cli_options] deimos::util::Config::parse (int argc, char *argv[])
+
+parse command line arguments
+
+
+
+
+#### Parameters:
+| Type | Name | Description |
+| ---- | ---- | ---- |
+| int | argc | number of command line arguments |
+| char * | argv | array of command line arguments |
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [cli_options][deimos-util-cli_options] | struct of command line options or error code |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### public bool deimos::util::Config::start_daemon () const
+
+query if the server daemon should be started
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | whether the start subcommand has been parsed |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-util-Config)
+
+### public bool deimos::util::Config::stop_daemon () const
+
+query if the server daemon should be stopped
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | whether the stop subcommand has been parsed |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-util-Config)
+
+### public bool deimos::util::Config::restart_daemon () const
+
+query if the server daemon should be restarted
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| bool | whether the restart subcommand has been parsed |
+
+
+
+
+
+
+
+
+
+
+
+
+#### Qualifiers:
+* const
+* inline
+
+
+[Go to Top](#deimos-util-Config)
+
+## Private Functions
+### private void deimos::util::Config::define_options ()
+
+define the supported command line options
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+### private [cli_options][deimos-util-cli_options] deimos::util::Config::handle_arguments ()
+
+perform any required adjustments to options
+
+
+
+
+#### Returns:
+| Type | Description |
+| ---- | ---- |
+| [cli_options][deimos-util-cli_options] | struct of command line options or error code |
+
+
+
+
+
+
+
+
+
+
+
+
+[Go to Top](#deimos-util-Config)
+
+[deimos-util-cli_options]:./cli_options.md#deimos-util-cli_options
diff --git a/doc/Markdown/deimos/util/cli_options.md b/doc/Markdown/deimos/util/cli_options.md
new file mode 100644
index 0000000000000000000000000000000000000000..642bda407c4f8408d0e1372c1a0ba144c72715a9
--- /dev/null
+++ b/doc/Markdown/deimos/util/cli_options.md
@@ -0,0 +1,8 @@
+# public deimos::util::cli_options
+
+struct for conveniently passing command line options to main program
+
+
+
+
+
diff --git a/doc/Markdown/deimos/util/index.md b/doc/Markdown/deimos/util/index.md
new file mode 100644
index 0000000000000000000000000000000000000000..563f112c254b7dedace331d1f7dfcb5ff4a4a987
--- /dev/null
+++ b/doc/Markdown/deimos/util/index.md
@@ -0,0 +1,15 @@
+# deimos::util
+
+namespace for utility classes
+
+
+
+
+## Classes
+| Name | Description |
+| ---- | ---- |
+| [cli_options](./cli_options.md) | struct for conveniently passing command line options to main program |
+| [Config](./Config.md) | class for handling command line arguments and configuration files |
+
+
+
diff --git a/doc/Markdown/todo.md b/doc/Markdown/todo.md
new file mode 100644
index 0000000000000000000000000000000000000000..3002ed7e89654c3bc1e748db25f812735edb4474
--- /dev/null
+++ b/doc/Markdown/todo.md
@@ -0,0 +1,21 @@
+# Todo List
+
+
+
+* Member
+[deimos::GetRequestHandler::requestComplete][deimos-GetRequestHandler-requestComplete] () noexcept override
+ * find out what this does?
+* Member
+[deimos::stream::Fifo::get_fifo_descriptors][deimos-stream-Fifo-get_fifo_descriptors] () const
+ * Do we use this? should this really be public?
+* Member
+[deimos::stream::Stream::m_db_result][deimos-stream-Stream-m_db_result]
+ * should this really be a protected member in the interface? Isn't it the decision of the implementation to make this asynchronous?
+
+
+
+
+
+[deimos-GetRequestHandler-requestComplete]:./deimos/GetRequestHandler.md#deimos-GetRequestHandler-requestComplete
+[deimos-stream-Fifo-get_fifo_descriptors]:./deimos/stream/Fifo.md#deimos-stream-Fifo-get_fifo_descriptors
+[deimos-stream-Stream-m_db_result]:./deimos/stream/Stream.md#deimos-stream-Stream-m_db_result
diff --git a/doc/openapi.yaml b/doc/openapi.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..b40be5ed5a806b95da72c0a37213e86a9dabd817
--- /dev/null
+++ b/doc/openapi.yaml
@@ -0,0 +1,283 @@
+openapi: 3.0.1
+info:
+ title: Deimos
+ description: >-
+ Server to accept S3 requests to store and retrieve data and use the phobos
+ tape library as storage.
+ version: 1.0.1
+tags:
+ - name: bucket
+ description: Operations on the buckets
+ - name: object
+ description: Operations on the objects inside buckets
+servers:
+ - url: 'http://localhost:11000/'
+ description: Local host server for testing purposes
+paths:
+ '/{bucket}':
+ parameters:
+ - name: bucket
+ in: path
+ description: Name of the bucket
+ required: true
+ schema:
+ type: string
+ minimum: 1
+ get:
+ tags:
+ - bucket
+ summary: Lists all objects in the bucket (not yet implemented)
+ operationId: getBucket
+ responses:
+ '200':
+ description: Success
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/ListObjectsV2Output'
+ '403':
+ description: Access denied
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+
+ '404':
+ description: No such bucket
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+ '500':
+ description: Internal Server Error
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+ put:
+ tags:
+ - bucket
+ summary: Creates a new bucket (not yet implemented)
+ operationId: putBucket
+ requestBody:
+ description: Information on the bucket that should be created
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/CreateBucketInfo'
+ required: true
+ responses:
+ '200':
+ description: Success
+ '403':
+ description: Access denied
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+ '500':
+ description: Internal Server Error
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+ '/{bucket}/{key}':
+ parameters:
+ - name: bucket
+ in: path
+ description: Name of the bucket
+ required: true
+ schema:
+ type: string
+ minimum: 1
+ - name: key
+ in: path
+ description: Identifier of the object to store
+ required: true
+ schema:
+ type: string
+ minimum: 1
+ get:
+ tags:
+ - object
+ summary: Retrieves an object from the storage
+ operationId: getObject
+ description: >-
+ The object `key` will be searched in bucket `bucket` and the contents
+ returned in chunks to the user
+ responses:
+ '200':
+ description: Success
+ content:
+ application/text:
+ schema:
+ type: string
+ '403':
+ description: Access denied
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+ '404':
+ description: Not found (No such key)
+ content:
+ application/xml:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/Error'
+ - example:
+ Code: NoSuchKey
+ Message: The resource you requested does not exist!
+ Resource: key
+ '500':
+ description: Internal Server Error
+ content:
+ application/xml:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/Error'
+ - example:
+ Code: InternalServerPhobosError
+ Message: The Phobos database is not running correctly on the server
+ Resource: key
+ put:
+ tags:
+ - object
+ summary: Add an object to the storage
+ operationId: putObject
+ description: >-
+ The contents of the body will be added as a new object with id `key` to
+ the bucket `bucket`
+ parameters:
+ - in: header
+ name: Content-Length
+ schema:
+ type: integer
+ required: true
+ requestBody:
+ description: File contents to add
+ content:
+ application/text:
+ schema:
+ type: string
+ required: true
+ responses:
+ '100':
+ description: Continue
+ '200':
+ description: Success
+ '400':
+ description: Bad Request
+ content:
+ application/xml:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/Error'
+ - example:
+ Code: InvalidArgument
+ Message: Some arguments given to the storage were invalid!
+ Resource: key
+ '403':
+ description: Access denied
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+ '500':
+ description: Internal Server Error
+ content:
+ application/xml:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/Error'
+ - example:
+ Code: InternalServerPhobosError
+ Message: The Phobos database is not running correctly on the server
+ Resource: key
+ delete:
+ tags:
+ - object
+ summary: Delete an object
+ operationId: deleteObject
+ description: Deletes an object from the internal storage (not yet implemented)
+ responses:
+ '204':
+ description: No Content
+ '403':
+ description: Access denied
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+ '500':
+ description: Internal Server Error
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+ '501':
+ description: Not Implemented
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Error'
+components:
+ schemas:
+ CreateBucketInfo:
+ type: object
+ properties:
+ xmlns:
+ type: string
+ default: 'http://s3.amazonaws.com/doc/2006-03-01/'
+ xml:
+ attribute: true
+ LocationContraint:
+ type: string
+ xml:
+ name: CreateBucketConfiguration
+ Error:
+ type: object
+ properties:
+ Code:
+ type: string
+ Message:
+ type: string
+ Resouce:
+ type: string
+ xml:
+ name: Error
+ ListObjectsV2Output:
+ type: object
+ properties:
+ IsTruncated:
+ type: boolean
+ Contents:
+ type: array
+ items:
+ properties:
+ ETag:
+ type: string
+ Key:
+ type: string
+ LastModified:
+ type: string
+ Owner:
+ properties:
+ DisplayName:
+ type: string
+ ID:
+ type: string
+ Size:
+ type: integer
+ Name:
+ type: string
+ Delimiter:
+ type: string
+ MaxKeys:
+ type: string
+ EncodingType:
+ type: string
+ KeyCount:
+ type: string
+ xml:
+ name: ListObjectsV2Output
\ No newline at end of file
diff --git a/include/CLI/CLI11.hpp b/include/CLI/CLI11.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..8f958076a811278c37860a3b64dd03b62ad07c6d
--- /dev/null
+++ b/include/CLI/CLI11.hpp
@@ -0,0 +1,8223 @@
+#pragma once
+
+// CLI11: Version 1.9.0
+// Originally designed by Henry Schreiner
+// https://github.com/CLIUtils/CLI11
+//
+// This is a standalone header file generated by MakeSingleHeader.py in CLI11/scripts
+// from: v1.9.0
+//
+// From LICENSE:
+//
+// CLI11 1.8 Copyright (c) 2017-2019 University of Cincinnati, developed by Henry
+// Schreiner under NSF AWARD 1414736. All rights reserved.
+//
+// Redistribution and use in source and binary forms of CLI11, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holder nor the names of its contributors
+// may be used to endorse or promote products derived from this software without
+// specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+// Standard combined includes:
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include