forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdkim.js
More file actions
54 lines (53 loc) · 2.09 KB
/
Copy pathdkim.js
File metadata and controls
54 lines (53 loc) · 2.09 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
import { GraphQLList, GraphQLObjectType, GraphQLString } from 'graphql'
import { dkimSelectorResultType } from './dkim-selector-result'
import { guidanceTagType } from '../../guidance-tag'
export const dkimType = new GraphQLObjectType({
name: 'DKIM',
fields: () => ({
status: {
type: GraphQLString,
description: `The compliance status for DKIM for the scanned domain.`,
resolve: async ({ status }) => status,
},
positiveTags: {
type: GraphQLList(guidanceTagType),
description: `List of positive tags for the scanned domain from this scan.`,
resolve: async ({ positiveTags }, _, { loaders: { loadDkimGuidanceTagByTagId } }) => {
return await loadDkimGuidanceTagByTagId({ tags: positiveTags })
},
},
neutralTags: {
type: GraphQLList(guidanceTagType),
description: `List of neutral tags for the scanned domain from this scan.`,
resolve: async ({ neutralTags }, _, { loaders: { loadDkimGuidanceTagByTagId } }) => {
return await loadDkimGuidanceTagByTagId({ tags: neutralTags })
},
},
negativeTags: {
type: GraphQLList(guidanceTagType),
description: `List of negative tags for the scanned domain from this scan.`,
resolve: async ({ negativeTags }, _, { loaders: { loadDkimGuidanceTagByTagId } }) => {
return await loadDkimGuidanceTagByTagId({ tags: negativeTags })
},
},
selectors: {
type: GraphQLList(dkimSelectorResultType),
description: 'Individual scans results for each DKIM selector.',
resolve: async ({ selectors }) => {
const selectorArray = []
for (const selector in selectors) {
selectorArray.push({
selector: selector,
...selectors[selector],
})
}
return selectorArray
},
},
}),
description: `DomainKeys Identified Mail (DKIM) permits a person, role, or
organization that owns the signing domain to claim some
responsibility for a message by associating the domain with the
message. This can be an author's organization, an operational relay,
or one of their agents.`,
})