@reaktor-internal/authorization-client
Advanced tools
Comparing version 1.0.3 to 1.0.5
const client = require('./client') | ||
let config = {} | ||
let infoLog = null | ||
// let infoLog = null | ||
let errorLog = null | ||
let verboseLog = null | ||
let cachedResults = null | ||
@@ -14,3 +15,3 @@ let cacheValidityEndTimestamp = new Date() | ||
const updateCache = async () => { | ||
infoLog(`Updating cache with TTL ${config.cacheTTL || DEFAULT_TTL_SECS}s`) | ||
verboseLog(`Updating cache with TTL ${config.cacheTTL || DEFAULT_TTL_SECS}s`) | ||
try { | ||
@@ -56,4 +57,5 @@ cachedResults = await client.getAllRoles() | ||
config = cfg | ||
infoLog = config.infoLog | ||
// infoLog = config.infoLog | ||
errorLog = config.errorLog || config.infoLog | ||
verboseLog = config.verboseLog || config.infoLog | ||
client.initialize(cfg) | ||
@@ -60,0 +62,0 @@ } |
@@ -5,2 +5,3 @@ const fetch = require('node-fetch') | ||
let errorLog = null | ||
let verboseLog = null | ||
let config = null | ||
@@ -22,3 +23,3 @@ | ||
const getAllRoles = () => { | ||
infoLog('Fetching all roles') | ||
verboseLog('Fetching all roles') | ||
return authRequest('') | ||
@@ -46,4 +47,5 @@ } | ||
config = cfg | ||
infoLog = cfg.infoLog | ||
errorLog = cfg.errorLog | ||
infoLog = config.infoLog | ||
errorLog = config.errorLog || config.infoLog | ||
verboseLog = config.verboseLog || config.infoLog | ||
} | ||
@@ -50,0 +52,0 @@ |
{ | ||
"name": "@reaktor-internal/authorization-client", | ||
"version": "1.0.3", | ||
"version": "1.0.5", | ||
"description": "Reaktor authorization service client", | ||
@@ -11,4 +11,3 @@ "repository": "https://github.com/reaktor/authorization", | ||
"lint": "eslint .", | ||
"test": "npm run lint && NODE_ENV=test mocha test/unit", | ||
"integration-test": "NODE_ENV=test mocha test/integration", | ||
"test": "npm run lint", | ||
"pre-push": "npm test", | ||
@@ -15,0 +14,0 @@ "init-config": "awk -F = '{print $1}' secrets.env.template | grep '[^$]' | xargs -P 100 -I {} heroku config:get -a reaktor-authorization -s {} | sed \"s/\\(DATABASE_URL=.*\\)'$/\\1?ssl=true'/\" | sort > secrets.env", |
@@ -21,3 +21,4 @@ # Authorization Client | ||
infoLog: myInfoLog, | ||
errorLog: myErrorLog | ||
errorLog: myErrorLog, | ||
verboseLog: myVerboseLog | ||
}) | ||
@@ -33,2 +34,3 @@ ``` | ||
* *errorLog* a function to do the error level logging (default: _config.infoLog_ || _console.log_) | ||
* *verboseLog* a function to do the verbose level logging (default: _config.verboseLog_ || _console.debug_) | ||
@@ -35,0 +37,0 @@ |
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
8838
111
100