Skip to content

Commit

Permalink
use /auditor/ prefix for Auditor API
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Oct 1, 2024
1 parent 225e2ae commit c902001
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ The scanned QR code contains space-separated values in plain-text: `<domain> <us
<subscribeKey> <verifyInterval>`. The `subscribeKey` should be treated as an opaque string rather
than assuming base64 encoding. Additional fields may be added in the future.

### /challenge
### /auditor/challenge

* Request method: POST
* Request headers: n/a
Expand All @@ -109,7 +109,7 @@ can only be used once and expires in 1 minute.

The server challenge index is always zeroed out and the userId should be used instead.

### /verify
### /auditor/verify

* Request method: POST
* Request headers:
Expand Down
32 changes: 32 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,38 @@ http {
brotli_static off;
}

location = /auditor/submit {
if ($request_method != POST) {
return 405;
}
client_max_body_size 64k;
client_body_buffer_size 16k;
proxy_pass http://backend;
limit_req zone=backend-limit burst=32 nodelay;
limit_req zone=sample-limit burst=10 nodelay;
max_ranges 0;
}

location = /auditor/challenge {
if ($request_method != POST) {
return 405;
}
proxy_pass http://backend;
limit_req zone=backend-limit burst=32 nodelay;
max_ranges 0;
}

location = /auditor/verify {
if ($request_method != POST) {
return 405;
}
client_max_body_size 4k;
client_body_buffer_size 4k;
proxy_pass http://backend;
limit_req zone=backend-limit burst=32 nodelay;
max_ranges 0;
}

location = /submit {
if ($request_method != POST) {
return 405;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/app/attestation/server/AttestationServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,9 @@ public static void main(final String[] args) {
server.createContext("/api/delete-device", new DeleteDeviceHandler());
server.createContext("/api/devices.json", new DevicesHandler());
server.createContext("/api/attestation-history.json", new AttestationHistoryHandler());
server.createContext("/auditor/challenge", new ChallengeHandler());
server.createContext("/auditor/verify", new VerifyHandler());
server.createContext("/auditor/submit", new SubmitHandler());
server.createContext("/challenge", new ChallengeHandler());
server.createContext("/verify", new VerifyHandler());
server.createContext("/submit", new SubmitHandler());
Expand Down

0 comments on commit c902001

Please sign in to comment.