The Databox Docker container that manages the flow of data by minting tokens and controlling store discovery. This code is not meant to be run on its own except for debug purposes.
If you are a Databox app or driver developer, skip to the relevant API documentation.
Further background info for Databox platform here.
For debug purposes:
git clone https://github.com/tsh2/core-arbiter.git
cd core-arbiter
npm install
This code should not be run as a standalone app, but rather in a Databox context. Unit tests to make sure it will work in that context can be run with:
npm test
Default port is 8080 (HTTPS only), but in case of lack of privileges, can be overridden using the PORT environment variable, i.e.:
PORT=8081 npm start
All request bodies should be application/json.
(for Databox core-component developers)
Method: GET
An endpoint required by the CM to signify if a container needs configuration. Can respond with (active|standby).
Method: POST
Upserts the record of containers and the extent of their corresponding permissions (default none) maintained by the arbiter.
NB: CM arbiter key MUST be provided as per the Hypercat 3.0 specs. The arbiter will not accept requests that don't include a key that matches that passed to it in the CM_KEY environment variable on launch.
Method: POST
Deletes a containers record by name.
NB: CM arbiter key MUST be provided as per the Hypercat 3.0 specs. The arbiter will not accept requests that don't include a key that matches that passed to it in the CM_KEY environment variable on launch.
Method: POST
Adds permissions to the record of containers maintained by the arbiter for a particular route.
Routes are encoded into tokens (as macaroon caveats). Routes are made up of a target container, an API path, and an HTTP method. The arbiter is indifferent to methods, but for the majority of APIs, GET requests map to read operations, and POST requests map to write operations.
Paths are JSON-formatted whitelists of accessible endpoints formatted as defined here and are testable here. More information here. The arbiter will mint tokens to paths (exact or RegExp) that match granted path permissions following those RegExp rules.
NB: CM arbiter key MUST be provided as per the Hypercat 3.0 specs. The arbiter will not accept requests that don't include a key that matches that passed to it in the CM_KEY environment variable on launch.
Method: POST
Does the opposite of /cm/grant-container-permissions. If the specified path is a RegExp path, then all matches will be revoked, so use wildcards carefully.
NB: CM arbiter key MUST be provided as per the Hypercat 3.0 specs. The arbiter will not accept requests that don't include a key that matches that passed to it in the CM_KEY environment variable on launch.
(for Databox developers)
Method: GET
Registers a store allowing the arbiter to mint macaroons for the store, and for the store to verify these macaroons independently.
NB: Container arbiter key (see developer guide) MUST be provided as per the Hypercat 3.0 specs. Containers without proper authorization will not be able to discover certain items, or will be able to discover them but not access them. In the latter case, they are informed as per section 7.3.1.2 of the Hypercat 3.0 specs.
(For Databox app and/or driver developers)
Method: GET
Serves a top-level Hypercat catalogue.
NB: Container arbiter key (see developer guide) MUST be provided as per the Hypercat 3.0 specs. Containers without proper authorization will not be able to discover certain items, or will be able to discover them but not access them. In the latter case, they are informed as per the Hypercat 3.0 specs.
Method: POST
Provides store tokens for containers.
NB: Container arbiter key (see developer guide) MUST be provided as per the Hypercat 3.0 specs. Containers without proper authorization will not be able to discover certain items, or will be able to discover them but not access them. In the latter case, they are informed as per section 7.3.1.2 of the Hypercat 3.0 specs.
Content type
Image
Digest
Size
37.1 MB
Last updated
over 8 years ago
docker pull databoxsystems2/arbiter