io7m | single-page | multi-page | epub | Stonesignal User Manual 1.0.0-beta0001
3. Configuration
Previous
Front Matter
Up
5. Monitoring
Next

# 4. Model

- 4.1. Overview
- 4.2. Device
  - 4.2.1. Overview
  - 4.2.2. ID
  - 4.2.3. Key
- 4.3. Device API
- 4.4. Admin API
- 4.5. Data API
- 4.6. Audit Log

## 4.1. Overview

1
The stonesignal package provides a server-based application to record location data sent from devices.
2
This section of the documentation describes the internal stonesignal model.

## 4.2. Device

## 4.2.1. Overview

1
A device is a piece of GPS (or other location technology) enabled electronic equipment. In the typical use case, a device will be a smartphone.

## 4.2.2. ID

1
Devices are assigned device IDs. A device ID is a public UUID value that identifies the device.

## 4.2.3. Key

1
Devices are assigned device keys. A device key is a secret 32-byte random value that the device uses to authenticate itself to the device API.
2
The text encoding for a device key is given by the pattern [A-F0-9]{64}. So, for example, the string 02210D83680AC0F4A50C47F51DCCE35610DE59717623A0D9408067279A63D511 is a well-formed device key, whilst 02210d83680ac0f4a50c47f51dcce35610de59717623a0d9408067279a63d511 is not.

## 4.3. Device API

1
The device API is the interface exposed to devices. The device API serves only one purpose: It accepts location updates from devices and records them into the database.

## 4.4. Admin API

1
The admin API is the interface exposed to administrators. The API allows for enrolling and editing devices.

## 4.5. Data API

1
The data API is the interface exposed to data analysis applications. It provides a read-only view of devices and locations, but it deliberately does not have access to secret values such as device keys.

## 4.6. Audit Log

1
The server maintains an append-only audit log consisting of a series of audit events. An audit event has an integer id, an owner (represented by an account UUID), a timestamp, a type, and a message consisting of a set of key/value pairs.
2
Each operation that changes the underlying database typically results in an event being logged to the audit log.
3. Configuration
Previous
Front Matter
Up
5. Monitoring
Next
io7m | single-page | multi-page | epub | Stonesignal User Manual 1.0.0-beta0001