-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtanium-rules.yml
More file actions
75 lines (68 loc) · 2.08 KB
/
Copy pathtanium-rules.yml
File metadata and controls
75 lines (68 loc) · 2.08 KB
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
extends: spectral:oas
rules:
tanium-operation-ids-camel-case:
description: All operationIds must use camelCase
severity: warn
given: "$.paths[*][*].operationId"
then:
function: pattern
functionOptions:
match: "^[a-z][a-zA-Z0-9]*$"
tanium-summary-title-case:
description: All operation summaries must use Title Case (no leading vendor prefix)
severity: warn
given: "$.paths[*][*].summary"
then:
function: pattern
functionOptions:
notMatch: "^Tanium "
tanium-session-header-auth:
description: API token authentication must use the session header
severity: info
given: "$.components.securitySchemes[*][?(@.type == 'apiKey')]"
then:
field: name
function: pattern
functionOptions:
match: "^session$"
tanium-paths-api-versioned:
description: Tanium Platform API paths must be versioned under /api/v2/
severity: hint
given: "$.paths[*]~"
then:
function: pattern
functionOptions:
match: "^(/api/v2/|/plugin/products/)"
tanium-responses-have-data-wrapper:
description: Successful responses should use a data wrapper object
severity: hint
given: "$.paths[*][*].responses['200'].content['application/json'].schema"
then:
function: schema
functionOptions:
schema:
properties:
data: {}
tanium-parameters-have-descriptions:
description: All path and query parameters must have descriptions
severity: warn
given: "$.paths[*][*].parameters[*]"
then:
field: description
function: truthy
tanium-operations-have-tags:
description: All operations must have at least one tag
severity: warn
given: "$.paths[*][*]"
then:
field: tags
function: truthy
tanium-error-schema-consistent:
description: 4xx/5xx responses should reference the shared Error schema
severity: warn
given: "$.paths[*][*].responses[?(@property >= 400)].content['application/json'].schema"
then:
function: schema
functionOptions:
schema:
required: ["$ref"]