Skip to content

Commit 8309bc6

Browse files
docs(implementations): audit report [skip ci]
1 parent bad5366 commit 8309bc6

File tree

1 file changed

+119
-80
lines changed

1 file changed

+119
-80
lines changed

implementations/apollo-server_v4/README.md

Lines changed: 119 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -3,171 +3,210 @@ _* This report was auto-generated by graphql-http_
33
# GraphQL over HTTP audit report
44

55
- **73** audits in total
6-
-**44** pass
7-
- ⚠️ **29** warnings (optional)
6+
-**32** pass
7+
- ⚠️ **37** warnings (optional)
8+
-**4** errors (required)
89

910
## Passing
10-
1. MUST accept application/json and match the content-type
11-
2. MUST use utf-8 encoding when responding
12-
3. MUST accept utf-8 encoding
13-
4. MUST assume utf-8 if encoding is unspecified
14-
5. MUST accept POST requests
15-
6. MAY accept application/x-www-form-urlencoded formatted GET requests
16-
7. MUST NOT allow executing mutations on GET requests
17-
8. SHOULD respond with 4xx status code if content-type is not supplied on POST requests
18-
9. MUST accept application/json POST requests
19-
10. MUST require a request body on POST
20-
11. SHOULD use 400 status code on missing {query} parameter when accepting application/graphql-response+json
21-
12. SHOULD use 400 status code on object {query} parameter when accepting application/graphql-response+json
22-
13. SHOULD use 400 status code on number {query} parameter when accepting application/graphql-response+json
23-
14. SHOULD use 400 status code on boolean {query} parameter when accepting application/graphql-response+json
24-
15. SHOULD use 400 status code on array {query} parameter when accepting application/graphql-response+json
25-
16. SHOULD allow string {query} parameter when accepting application/graphql-response+json
26-
17. MUST allow string {query} parameter when accepting application/json
27-
18. SHOULD use 400 status code on object {operationName} parameter when accepting application/graphql-response+json
28-
19. SHOULD use 400 status code on number {operationName} parameter when accepting application/graphql-response+json
29-
20. SHOULD use 400 status code on boolean {operationName} parameter when accepting application/graphql-response+json
30-
21. SHOULD use 400 status code on array {operationName} parameter when accepting application/graphql-response+json
31-
22. SHOULD allow string {operationName} parameter when accepting application/graphql-response+json
32-
23. MUST allow string {operationName} parameter when accepting application/json
33-
24. SHOULD use 400 status code on string {variables} parameter when accepting application/graphql-response+json
34-
25. SHOULD use 400 status code on number {variables} parameter when accepting application/graphql-response+json
35-
26. SHOULD use 400 status code on boolean {variables} parameter when accepting application/graphql-response+json
36-
27. SHOULD allow map {variables} parameter when accepting application/graphql-response+json
37-
28. MUST allow map {variables} parameter when accepting application/json
38-
29. SHOULD allow URL-encoded JSON string {variables} parameter in GETs when accepting application/graphql-response+json
39-
30. MUST allow URL-encoded JSON string {variables} parameter in GETs when accepting application/json
40-
31. SHOULD use 400 status code on string {extensions} parameter when accepting application/graphql-response+json
41-
32. SHOULD allow map {extensions} parameter when accepting application/graphql-response+json
42-
33. MUST allow map {extensions} parameter when accepting application/json
43-
34. SHOULD use 4xx or 5xx status codes on JSON parsing failure when accepting application/graphql-response+json
44-
35. SHOULD use 400 status code on JSON parsing failure when accepting application/graphql-response+json
45-
36. SHOULD use 4xx or 5xx status codes if parameters are invalid when accepting application/graphql-response+json
46-
37. SHOULD use 400 status code if parameters are invalid when accepting application/graphql-response+json
47-
38. SHOULD not contain the data entry if parameters are invalid when accepting application/graphql-response+json
48-
39. SHOULD use 4xx or 5xx status codes on document parsing failure when accepting application/graphql-response+json
49-
40. SHOULD use 400 status code on document parsing failure when accepting application/graphql-response+json
50-
41. SHOULD not contain the data entry on document parsing failure when accepting application/graphql-response+json
51-
42. SHOULD use 4xx or 5xx status codes on document validation failure when accepting application/graphql-response+json
52-
43. SHOULD use 400 status code on document validation failure when accepting application/graphql-response+json
53-
44. SHOULD not contain the data entry on document validation failure when accepting application/graphql-response+json
11+
1. MUST accept utf-8 encoding
12+
2. MUST assume utf-8 if encoding is unspecified
13+
3. MUST accept POST requests
14+
4. SHOULD respond with 4xx status code if content-type is not supplied on POST requests
15+
5. MUST accept application/json POST requests
16+
6. MUST require a request body on POST
17+
7. SHOULD use 400 status code on missing {query} parameter when accepting application/graphql-response+json
18+
8. SHOULD use 400 status code on object {query} parameter when accepting application/graphql-response+json
19+
9. SHOULD use 400 status code on number {query} parameter when accepting application/graphql-response+json
20+
10. SHOULD use 400 status code on boolean {query} parameter when accepting application/graphql-response+json
21+
11. SHOULD use 400 status code on array {query} parameter when accepting application/graphql-response+json
22+
12. SHOULD allow string {query} parameter when accepting application/graphql-response+json
23+
13. MUST allow string {query} parameter when accepting application/json
24+
14. SHOULD allow string {operationName} parameter when accepting application/graphql-response+json
25+
15. MUST allow string {operationName} parameter when accepting application/json
26+
16. SHOULD use 400 status code on string {variables} parameter when accepting application/graphql-response+json
27+
17. SHOULD allow map {variables} parameter when accepting application/graphql-response+json
28+
18. MUST allow map {variables} parameter when accepting application/json
29+
19. SHOULD use 400 status code on string {extensions} parameter when accepting application/graphql-response+json
30+
20. SHOULD allow map {extensions} parameter when accepting application/graphql-response+json
31+
21. MUST allow map {extensions} parameter when accepting application/json
32+
22. SHOULD use 4xx or 5xx status codes on JSON parsing failure when accepting application/graphql-response+json
33+
23. SHOULD use 400 status code on JSON parsing failure when accepting application/graphql-response+json
34+
24. SHOULD use 4xx or 5xx status codes if parameters are invalid when accepting application/graphql-response+json
35+
25. SHOULD use 400 status code if parameters are invalid when accepting application/graphql-response+json
36+
26. SHOULD not contain the data entry if parameters are invalid when accepting application/graphql-response+json
37+
27. SHOULD use 4xx or 5xx status codes on document parsing failure when accepting application/graphql-response+json
38+
28. SHOULD use 400 status code on document parsing failure when accepting application/graphql-response+json
39+
29. SHOULD not contain the data entry on document parsing failure when accepting application/graphql-response+json
40+
30. SHOULD use 4xx or 5xx status codes on document validation failure when accepting application/graphql-response+json
41+
31. SHOULD use 400 status code on document validation failure when accepting application/graphql-response+json
42+
32. SHOULD not contain the data entry on document validation failure when accepting application/graphql-response+json
5443

5544
## Warnings
5645
The server _SHOULD_ support these, but is not required.
5746
1. SHOULD accept application/graphql-response+json and match the content-type<br />
5847
```
59-
Content-Type header "application/json; charset=utf-8" does not contain "application/graphql-response+json"
48+
Status code 400 is not 200
6049
```
6150
2. SHOULD accept \*/\* and use application/graphql-response+json for the content-type<br />
6251
```
63-
Content-Type header "application/json; charset=utf-8" does not contain "application/graphql-response+json"
52+
Status code 400 is not 200
6453
```
6554
3. SHOULD assume application/graphql-response+json content-type when accept is missing<br />
6655
```
67-
Content-Type header "application/json; charset=utf-8" does not contain "application/graphql-response+json"
56+
Status code 400 is not 200
6857
```
69-
4. SHOULD use 200 status code with errors field on missing {query} parameter when accepting application/json<br />
58+
4. MAY accept application/x-www-form-urlencoded formatted GET requests<br />
7059
```
7160
Status code 400 is not 200
7261
```
73-
5. SHOULD use 200 status code with errors field on object {query} parameter when accepting application/json<br />
62+
5. SHOULD use 200 status code with errors field on missing {query} parameter when accepting application/json<br />
7463
```
7564
Status code 400 is not 200
7665
```
77-
6. SHOULD use 200 status code with errors field on number {query} parameter when accepting application/json<br />
66+
6. SHOULD use 200 status code with errors field on object {query} parameter when accepting application/json<br />
7867
```
7968
Status code 400 is not 200
8069
```
81-
7. SHOULD use 200 status code with errors field on boolean {query} parameter when accepting application/json<br />
70+
7. SHOULD use 200 status code with errors field on number {query} parameter when accepting application/json<br />
8271
```
8372
Status code 400 is not 200
8473
```
85-
8. SHOULD use 200 status code with errors field on array {query} parameter when accepting application/json<br />
74+
8. SHOULD use 200 status code with errors field on boolean {query} parameter when accepting application/json<br />
8675
```
8776
Status code 400 is not 200
8877
```
89-
9. SHOULD use 200 status code with errors field on object {operationName} parameter when accepting application/json<br />
78+
9. SHOULD use 200 status code with errors field on array {query} parameter when accepting application/json<br />
9079
```
9180
Status code 400 is not 200
9281
```
93-
10. SHOULD use 200 status code with errors field on number {operationName} parameter when accepting application/json<br />
82+
10. SHOULD use 400 status code on object {operationName} parameter when accepting application/graphql-response+json<br />
9483
```
95-
Status code 400 is not 200
84+
Status code 200 is not 400
9685
```
97-
11. SHOULD use 200 status code with errors field on boolean {operationName} parameter when accepting application/json<br />
86+
11. SHOULD use 400 status code on number {operationName} parameter when accepting application/graphql-response+json<br />
9887
```
99-
Status code 400 is not 200
88+
Status code 200 is not 400
10089
```
101-
12. SHOULD use 200 status code with errors field on array {operationName} parameter when accepting application/json<br />
90+
12. SHOULD use 400 status code on boolean {operationName} parameter when accepting application/graphql-response+json<br />
10291
```
103-
Status code 400 is not 200
92+
Status code 200 is not 400
10493
```
105-
13. SHOULD use 400 status code on array {variables} parameter when accepting application/graphql-response+json<br />
94+
13. SHOULD use 400 status code on array {operationName} parameter when accepting application/graphql-response+json<br />
10695
```
10796
Status code 200 is not 400
10897
```
109-
14. SHOULD use 200 status code with errors field on string {variables} parameter when accepting application/json<br />
98+
14. SHOULD use 200 status code with errors field on object {operationName} parameter when accepting application/json<br />
11099
```
111-
Status code 400 is not 200
100+
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
112101
```
113-
15. SHOULD use 200 status code with errors field on number {variables} parameter when accepting application/json<br />
102+
15. SHOULD use 200 status code with errors field on number {operationName} parameter when accepting application/json<br />
114103
```
115-
Status code 400 is not 200
104+
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
105+
```
106+
16. SHOULD use 200 status code with errors field on boolean {operationName} parameter when accepting application/json<br />
107+
```
108+
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
109+
```
110+
17. SHOULD use 200 status code with errors field on array {operationName} parameter when accepting application/json<br />
111+
```
112+
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
113+
```
114+
18. SHOULD use 400 status code on number {variables} parameter when accepting application/graphql-response+json<br />
115+
```
116+
Status code 200 is not 400
117+
```
118+
19. SHOULD use 400 status code on boolean {variables} parameter when accepting application/graphql-response+json<br />
119+
```
120+
Status code 200 is not 400
121+
```
122+
20. SHOULD use 400 status code on array {variables} parameter when accepting application/graphql-response+json<br />
123+
```
124+
Status code 200 is not 400
116125
```
117-
16. SHOULD use 200 status code with errors field on boolean {variables} parameter when accepting application/json<br />
126+
21. SHOULD use 200 status code with errors field on string {variables} parameter when accepting application/json<br />
118127
```
119128
Status code 400 is not 200
120129
```
121-
17. SHOULD use 200 status code with errors field on array {variables} parameter when accepting application/json<br />
130+
22. SHOULD use 200 status code with errors field on number {variables} parameter when accepting application/json<br />
131+
```
132+
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
133+
```
134+
23. SHOULD use 200 status code with errors field on boolean {variables} parameter when accepting application/json<br />
135+
```
136+
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
137+
```
138+
24. SHOULD use 200 status code with errors field on array {variables} parameter when accepting application/json<br />
122139
```
123140
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
124141
```
125-
18. SHOULD use 400 status code on number {extensions} parameter when accepting application/graphql-response+json<br />
142+
25. SHOULD allow URL-encoded JSON string {variables} parameter in GETs when accepting application/graphql-response+json<br />
143+
```
144+
Status code 400 is not 200
145+
```
146+
26. SHOULD use 400 status code on number {extensions} parameter when accepting application/graphql-response+json<br />
126147
```
127148
Status code 200 is not 400
128149
```
129-
19. SHOULD use 400 status code on boolean {extensions} parameter when accepting application/graphql-response+json<br />
150+
27. SHOULD use 400 status code on boolean {extensions} parameter when accepting application/graphql-response+json<br />
130151
```
131152
Status code 200 is not 400
132153
```
133-
20. SHOULD use 400 status code on array {extensions} parameter when accepting application/graphql-response+json<br />
154+
28. SHOULD use 400 status code on array {extensions} parameter when accepting application/graphql-response+json<br />
134155
```
135156
Status code 200 is not 400
136157
```
137-
21. SHOULD use 200 status code with errors field on string {extensions} parameter when accepting application/json<br />
158+
29. SHOULD use 200 status code with errors field on string {extensions} parameter when accepting application/json<br />
138159
```
139160
Status code 400 is not 200
140161
```
141-
22. SHOULD use 200 status code with errors field on number {extensions} parameter when accepting application/json<br />
162+
30. SHOULD use 200 status code with errors field on number {extensions} parameter when accepting application/json<br />
142163
```
143164
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
144165
```
145-
23. SHOULD use 200 status code with errors field on boolean {extensions} parameter when accepting application/json<br />
166+
31. SHOULD use 200 status code with errors field on boolean {extensions} parameter when accepting application/json<br />
146167
```
147168
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
148169
```
149-
24. SHOULD use 200 status code with errors field on array {extensions} parameter when accepting application/json<br />
170+
32. SHOULD use 200 status code with errors field on array {extensions} parameter when accepting application/json<br />
150171
```
151172
Execution result {"data":{"__typename":"Query"}} does not have a property 'errors'
152173
```
153-
25. SHOULD use 200 status code on JSON parsing failure when accepting application/json<br />
174+
33. SHOULD use 200 status code on JSON parsing failure when accepting application/json<br />
154175
```
155176
Status code 400 is not 200
156177
```
157-
26. SHOULD use 200 status code if parameters are invalid when accepting application/json<br />
178+
34. SHOULD use 200 status code if parameters are invalid when accepting application/json<br />
158179
```
159180
Status code 400 is not 200
160181
```
161-
27. SHOULD use 200 status code on document parsing failure when accepting application/json<br />
182+
35. SHOULD use 200 status code on document parsing failure when accepting application/json<br />
162183
```
163184
Status code 400 is not 200
164185
```
165-
28. SHOULD use 200 status code on document validation failure when accepting application/json<br />
186+
36. SHOULD use 200 status code on document validation failure when accepting application/json<br />
166187
```
167188
Status code 400 is not 200
168189
```
169-
29. SHOULD not contain the data entry on JSON parsing failure when accepting application/graphql-response+json<br />
190+
37. SHOULD not contain the data entry on JSON parsing failure when accepting application/graphql-response+json<br />
170191
```
171192
Response body is not valid JSON. Got "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>SyntaxError: Unexpected end of JSON input<br> &nbsp; &nbsp;at JSON.parse (&lt;anonymous&gt;)<br> &nbsp; &nbsp;at parse (/home/runner/work/graphql-http/graphql-http/node_modules/body-parser/lib/types/json.js:89:19)<br> &nbsp; &nbsp;at /home/runner/work/graphql-http/graphql-http/node_modules/body-parser/lib/read.js:128:18<br> &nbsp; &nbsp;at AsyncResource.runInAsyncScope (node:async_hooks:203:9)<br> &nbsp; &nbsp;at invokeCallback (/home/runner/work/graphql-http/graphql-http/node_modules/raw-body/index.js:231:16)<br> &nbsp; &nbsp;at done (/home/runner/work/graphql-http/graphql-http/node_modules/raw-body/index.js:220:7)<br> &nbsp; &nbsp;at IncomingMessage.onEnd (/home/runner/work/graphql-http/graphql-http/node_modules/raw-body/index.js:280:7)<br> &nbsp; &nbsp;at IncomingMessage.emit (node:events:513:28)<br> &nbsp; &nbsp;at endReadableNT (node:internal/streams/rea...
172193
```
173194

195+
## Errors
196+
The server _MUST_ support these.
197+
1. MUST accept application/json and match the content-type<br />
198+
```
199+
Status code 400 is not 200
200+
```
201+
2. MUST use utf-8 encoding when responding<br />
202+
```
203+
Status code 400 is not 200
204+
```
205+
3. MUST NOT allow executing mutations on GET requests<br />
206+
```
207+
Status code 400 is not 405
208+
```
209+
4. MUST allow URL-encoded JSON string {variables} parameter in GETs when accepting application/json<br />
210+
```
211+
Status code 400 is not 200
212+
```

0 commit comments

Comments
 (0)