@aerogear/apollo-voyager-audit
Advanced tools
Comparing version 0.1.3 to 0.1.4
import { GraphQLResolveInfo } from 'graphql'; | ||
export declare function auditLog(success: boolean, request: any, info: GraphQLResolveInfo, parent: any, args: any, msg: string): void; | ||
export declare function auditLog(success: boolean, context: any, info: GraphQLResolveInfo, parent: any, args: any, msg: string): void; |
@@ -10,6 +10,6 @@ "use strict"; | ||
const auditLogger = log.child({ tag: 'AUDIT' }); | ||
function auditLog(success, request, info, parent, args, msg) { | ||
function auditLog(success, context, info, parent, args, msg) { | ||
auditLogger.info({ | ||
msg: msg || '', | ||
requestId: request ? request.id : '', | ||
requestId: context && context.request ? context.request.id : '', | ||
operationType: info.operation.operation, | ||
@@ -22,3 +22,5 @@ fieldName: info.fieldName, | ||
arguments: args, | ||
clientInfo: request && request.body && request.body.extensions && request.body.extensions.metrics || undefined | ||
clientInfo: context && context.request && context.request.body && context.request.body.extensions && context.request.body.extensions.metrics || undefined, | ||
authenticated: !!(context && context.auth && context.auth.isAuthenticated()), | ||
userInfo: (context && context.auth && context.auth.accessToken) ? context.auth.accessToken.content : undefined | ||
}); | ||
@@ -25,0 +27,0 @@ } |
{ | ||
"name": "@aerogear/apollo-voyager-audit", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Adds audit logging capabilities to Apollo Voyager Server.", | ||
@@ -24,3 +24,3 @@ "author": "AeroGear Team<aerogear@googlegroups.com>", | ||
"dependencies": { | ||
"@aerogear/apollo-voyager-tools": "^0.1.3", | ||
"@aerogear/apollo-voyager-tools": "^0.1.4", | ||
"graphql-tools": "^4.0.3", | ||
@@ -27,0 +27,0 @@ "pino": "^5.9.0" |
@@ -17,2 +17,4 @@ import { buildPath } from '@aerogear/apollo-voyager-tools' | ||
clientInfo: any | ||
authenticated: boolean | ||
userInfo: any | ||
}): void | ||
@@ -24,6 +26,6 @@ } | ||
export function auditLog (success: boolean, request: any, info: GraphQLResolveInfo, parent: any, args: any, msg: string) { | ||
export function auditLog (success: boolean, context: any, info: GraphQLResolveInfo, parent: any, args: any, msg: string) { | ||
auditLogger.info({ | ||
msg: msg || '', | ||
requestId: request ? request.id : '', | ||
requestId: context && context.request ? context.request.id : '', | ||
operationType: info.operation.operation, | ||
@@ -36,4 +38,6 @@ fieldName: info.fieldName, | ||
arguments: args, | ||
clientInfo: request && request.body && request.body.extensions && request.body.extensions.metrics || undefined | ||
clientInfo: context && context.request && context.request.body && context.request.body.extensions && context.request.body.extensions.metrics || undefined, | ||
authenticated: !!(context && context.auth && context.auth.isAuthenticated()), | ||
userInfo: (context && context.auth && context.auth.accessToken) ? context.auth.accessToken.content : undefined | ||
}) | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6660
94
0