summaryrefslogtreecommitdiff
path: root/hagrid-subplot.md
blob: aa7d203b26b302469cc8683ad7e2b816e219aaca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
title: System tests for Hagrid
template: python
bindings:
- subplot.yaml
- lib/files.yaml
functions:
- subplot.py
- lib/files.py
...

# Introduction

This document documents the acceptance criteria for Hagrid, an OpenPGP
key server. The criteria are expressed against a system running
Hagrid, on its HTTP API. The [Subplot][] tool can be used to generate
code that verifies that a Hagrid system works as required.

[Subplot]: https://subplot.tech/


# VKS interface

## Lookup certificate by fingerprint

### We can look up an existing certificate

_Requirement: We can retrieve a certificate whose fingerprint we
have._

FIXME: a well-known test cert must be injected into the running Hagrid
instance prior to the test, and `EXAMPLEFP` must be replaced with its
fingerprint.

~~~scenario
given a running Hagrid system
given file well-known.pgp
when I make request GET /vks/v1/by-fingerprint/EXAMPLEFP
then response HTTP status code is 200
then response has header content-type: application/octet-stream
then response body matches file well-known.pgp
~~~

~~~{#well-known.pgp .file}
certificate
~~~

### We get an error if using lower case hexadecimal

_Requirement: we get an error if we use a fingerprint with lowercase
hexadecimal digits._

~~~scenario
given a running Hagrid system
when I make request GET /vks/v1/by-fingerprint/EXAMPLEFP
then response HTTP status code is 400
~~~

### We get an error for a malformed fingerprint

_Requirement: we get an error if we try to retrieve a certificate
using a string that is not a syntactically valid fingerprint._

~~~scenario
given a running Hagrid system
when I make request GET /vks/v1/by-fingerprint/IMPOSSIBLE
then response HTTP status code is 400
~~~

### We get an error for a missing fingerprint

_Requirement: we get an error if we try to retrieve a certificate
that isn't on the server._

~~~scenario
given a running Hagrid system
when I make request GET /vks/v1/by-fingerprint/010203
then response HTTP status code is 400
~~~