Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature mx record diff frontend #4792

Merged
merged 6 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions frontend/mocking/faked_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,33 @@ export const getTypeNames = () => gql`
last: Int
): DNSScanConnection

# List of MX record diffs for a given domain.
mxRecordDiff(
# Start date for date filter.
startDate: DateTime

# End date for date filter.
endDate: DateTime

# Ordering options for MX connections.
orderBy: DNSOrder

# Number of MX scans to retrieve.
limit: Int

# Returns the items in the list that come after the specified cursor.
after: String

# Returns the first n items from the list.
first: Int

# Returns the items in the list that come before the specified cursor.
before: String

# Returns the last n items from the list.
last: Int
): MXRecordDiffConnection

# HTTPS, and TLS scan results.
web(
# Start date for date filter.
Expand Down Expand Up @@ -1042,6 +1069,9 @@ export const getTypeNames = () => gql`
# Label for tagging domains that are possibly blocked by a firewall.
BLOCKED

# Label for tagging domains that have a wildcard sibling.
WILDCARD_SIBLING

# Label for tagging domains that have a pending web scan.
SCAN_PENDING

Expand Down Expand Up @@ -1563,6 +1593,38 @@ export const getTypeNames = () => gql`
TIMESTAMP
}

# A connection to a list of items.
type MXRecordDiffConnection {
# Information to aid in pagination.
pageInfo: PageInfo!

# A list of edges.
edges: [MXRecordDiffEdge]

# The total amount of DNS scans related to a given domain.
totalCount: Int
}

# An edge in a connection.
type MXRecordDiffEdge {
# The item at the end of the edge
node: MXRecordDiff

# A cursor for use in pagination
cursor: String!
}

type MXRecordDiff {
# The ID of an object
id: ID!

# The time when the scan was initiated.
timestamp: DateTime

# The MX records for the domain (if they exist).
mxRecords: MXRecord
}

# A connection to a list of items.
type WebConnection {
# Information to aid in pagination.
Expand Down Expand Up @@ -3209,6 +3271,9 @@ export const getTypeNames = () => gql`
# Label for tagging domains that are possibly blocked by a firewall.
BLOCKED

# Label for tagging domains that have a wildcard sibling.
WILDCARD_SIBLING

# Label for tagging domains that have a pending web scan.
SCAN_PENDING

Expand Down
9 changes: 9 additions & 0 deletions frontend/mocking/mocker.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ const mocks = {
// gives date in format "2020-12-31 15:30:20.262Z"
return new Date(faker.date.between('2019-01-01', '2022-01-01')).toISOString().replace('T', ' ')
},
DateTime: () => {
// gives date in format "2020-12-31 15:30:20.262Z"
return new Date(faker.date.between('2019-01-01', '2022-01-01')).toISOString()
},
DkimFailureTable: () => {
const dkimDomains = getStringOfDomains(0, 2)
const dkimResults = getDmarcTableResults()
Expand Down Expand Up @@ -557,6 +561,11 @@ const mocks = {
min: 2019,
max: 2021,
}),
MXHost: () => ({
addresses: [...new Array(faker.datatype.number({ min: 1, max: 2 }))].map(() => faker.internet.ip()),
hostname: faker.internet.domainName(),
preference: faker.datatype.number({ min: 1, max: 10 }),
}),
...mockOverrides,
}

Expand Down
Loading