Skip to content

Backend specification

Jakub Ďuraš edited this page Sep 19, 2019 · 15 revisions

Octosign can use different signing backends that are dynamically loaded. The backend can be written in any language and with any directory structure and architecture. There are only three requirements:

  • File backend.yml in the root directory with information about the backend.
  • Use of plaintext communication protocol using the STDIO.
  • Mandatory end-to-end tests.

Backend information file backend.yml

Each backend provides a necessary amount of information for the application like the name, description or the executable that should be called. Here is an example of a minimal backend.yml:

name: Electronic signature
description: Advanced electronic signature usable on PDF and other documents.
repository: https://github.com/durasj/octosign-dss
version: 1.0-SNAPSHOT
author: Jakub Ďuraš <[email protected]>
license: MIT
exec: ./jdk/bin/java.exe -jar ./sign.jar

The backend can define various properties.

Property Description Required
name TBD
description TBD
repository TBD
version TBD
author TBD
license TBD
exec TBD
options TBD

Communication protocol

Backend is always called with command and file as parameters, e.g. ./sign . The backend should be stateless. Following commands need to be implemented:

  • sign - TBD
  • verify - TBD

The UI will never send anything over STDIO unless it's asked to do so from the backend. The backend can, at any moment:

  • Throw error/warning that will be displayed via STDERR.
  • Prompt for additional information via STDIO (synchronously).
  • Get the value of any option via the STDIO (synchronously).

Ending the process with the exit code 0 signals success. If code other than 0 is used, the backend should always send an error message to the STDERR.

End-to-end tests

Each backend needs to define a basic set of e2e tests for all of the commands. TBD.

Clone this wiki locally