-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/bcgov/api-services-portal in…
…to dev
- Loading branch information
Showing
10 changed files
with
149 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/authz/graphql-whitelist/httplocalhost4180managerservices-50721a.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
query GetServices($days: [String!]) { | ||
allGatewayServicesByNamespace(first: 200) { | ||
id | ||
name | ||
updatedAt | ||
environment { | ||
id | ||
name | ||
active | ||
flow | ||
product { | ||
id | ||
name | ||
organization { | ||
title | ||
} | ||
organizationUnit { | ||
title | ||
} | ||
} | ||
} | ||
routes { | ||
id | ||
name | ||
} | ||
plugins { | ||
id | ||
name | ||
} | ||
} | ||
|
||
allGatewayServiceMetricsByNamespace( | ||
orderBy: "day_ASC" | ||
where: { query: "kong_http_requests_hourly_namespace", day_in: $days } | ||
) { | ||
query | ||
day | ||
metric | ||
values | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Logger } from '../../logger'; | ||
import { dot } from '../feed-worker'; | ||
|
||
export async function byKey( | ||
keystone: any, | ||
transformInfo: any, | ||
currentData: any, | ||
inputData: any, | ||
_fieldKey: string | ||
) { | ||
// fieldKey: The field that has the new value in the input | ||
const fieldKey = 'key' in transformInfo ? transformInfo['key'] : _fieldKey; | ||
|
||
const value = dot(inputData, fieldKey); | ||
|
||
if (typeof value === 'undefined') { | ||
return null; | ||
} else { | ||
return currentData != null && | ||
_fieldKey in currentData && | ||
currentData[_fieldKey] === value | ||
? null | ||
: value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,38 @@ | ||
const { Text, Checkbox, Relationship } = require('@keystonejs/fields') | ||
const { Markdown } = require('@keystonejs/fields-markdown') | ||
const { Text, Checkbox, Relationship } = require('@keystonejs/fields'); | ||
const { Markdown } = require('@keystonejs/fields-markdown'); | ||
|
||
const { byTracking, atTracking } = require('@keystonejs/list-plugins') | ||
const { byTracking, atTracking } = require('@keystonejs/list-plugins'); | ||
|
||
const { EnforcementPoint } = require('../authz/enforcement') | ||
const { EnforcementPoint } = require('../authz/enforcement'); | ||
|
||
module.exports = { | ||
fields: { | ||
name: { | ||
type: Text, | ||
isRequired: true | ||
type: Text, | ||
isRequired: true, | ||
}, | ||
query: { | ||
type: Text, | ||
isRequired: true | ||
type: Text, | ||
isRequired: true, | ||
}, | ||
day: { | ||
type: Text, | ||
isRequired: true | ||
type: Text, | ||
isRequired: true, | ||
}, | ||
metric: { | ||
type: Text, | ||
isRequired: true | ||
type: Text, | ||
isRequired: true, | ||
}, | ||
values: { | ||
type: Text, | ||
isRequired: true | ||
type: Text, | ||
isRequired: true, | ||
}, | ||
namespace: { | ||
type: Text, | ||
isRequired: false, | ||
}, | ||
service: { type: Relationship, ref: 'GatewayService', many: false }, | ||
}, | ||
access: EnforcementPoint, | ||
plugins: [ | ||
atTracking() | ||
] | ||
} | ||
plugins: [atTracking()], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters