Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
aggregateApplyPoint = determineAggregateApplyPoint(routePolicy);
if (aggregateApplyPoint === applyPoint) {
routePolicy = exports.parallel.apply(this, routePolicy);
}
else {
routePolicy = null;
}
}
if (typeof routePolicy === 'string') {
// Look for missing policies. Probably due to misspelling.
if (data.names.indexOf(routePolicy) === -1) {
throw Boom.notImplemented('Missing policy: ' + routePolicy);
}
if (applyPointPolicies[routePolicy]) {
tmpList.push(applyPointPolicies[routePolicy]);
}
}
else if (typeof routePolicy === 'function') {
// If an aggregate apply point wasn't already determined
// but an aggregate apply point seems like it will be used, determine it from `policy.runs`.
// `policy.runs` is an array of loaded policies reported by an aggregate policy
// such as MrHorse.parallel, specifically for determining
// its apply point ad hoc, notably here in the extension handler.
if (!aggregateApplyPoint && routePolicy.runs) {
aggregateApplyPoint = determineAggregateApplyPoint(routePolicy.runs);
async validatePassword (user, password) {
throw Boom.notImplemented('validatePassword not implemented')
}
oauthLogin (client_id) {
throw Boom.notImplemented('oauthLogin not implemented')
}
findByUsername (username) {
throw Boom.notImplemented('findByUsername not implemented')
}
getToken (user, request, client) {
throw Boom.notImplemented('getToken not implemented')
}
oauthAuthorize (client_id, request) {
throw Boom.notImplemented('oauthAuthorize not implemented')
}
}
authToken (token) {
throw Boom.notImplemented('authToken not implemented')
}
async handler (request, h) {
if (!process.env.IPFS_MONITORING) {
throw Boom.notImplemented('Monitoring is disabled. Enable it by setting environment variable IPFS_MONITORING')
}
const { ipfs } = request.server.app
const peers = await ipfs.swarm.peers()
gauge.set(peers.length)
return h.response(client.register.metrics())
.type(client.register.contentType)
}
}
login ({ username, password, request }) {
throw Boom.notImplemented('login not implemented')
}
logout ({ user, session, request }) {
throw Boom.notImplemented('logout not implemented')
}