forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttps-sub.js
More file actions
49 lines (48 loc) · 1.6 KB
/
Copy pathhttps-sub.js
File metadata and controls
49 lines (48 loc) · 1.6 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
import { GraphQLObjectType, GraphQLString, GraphQLList } from 'graphql'
import { guidanceTagType } from '../../guidance-tag/objects'
export const httpsSubType = new GraphQLObjectType({
name: 'HttpsSub',
description:
'HTTPS gql object containing the fields for the `dkimScanData` subscription.',
fields: () => ({
implementation: {
type: GraphQLString,
description: `State of the HTTPS implementation on the server and any issues therein.`,
resolve: ({ implementation }) => implementation,
},
enforced: {
type: GraphQLString,
description: `Degree to which HTTPS is enforced on the server based on behaviour.`,
resolve: ({ enforced }) => enforced,
},
hsts: {
type: GraphQLString,
description: `Presence and completeness of HSTS implementation.`,
resolve: ({ hsts }) => hsts,
},
hstsAge: {
type: GraphQLString,
description: `Denotes how long the domain should only be accessed using HTTPS`,
resolve: ({ hstsAge }) => hstsAge,
},
preloaded: {
type: GraphQLString,
description: `Denotes whether the domain has been submitted and included within HSTS preload list.`,
resolve: ({ preloaded }) => preloaded,
},
guidanceTags: {
type: GraphQLList(guidanceTagType),
description: `Key tags found during scan.`,
resolve: async (
{ guidanceTags },
_args,
{ loaders: { loadHttpsGuidanceTagByTagId } },
) => {
const httpsTags = await loadHttpsGuidanceTagByTagId.loadMany(
guidanceTags,
)
return httpsTags
},
},
}),
})