444d2ca7dd
* Revert "Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)"
This reverts commit 63e6581162.
* Use pino-http instead of express pino logger
* Use correct reference to knex and do not instantiate HttpLogger prematurely
* Adds missing dependency for pino to webhook-service
* Do not instantiate middleware when passed to express
* Refactor to move logging into shared
* Copy shared packages into dockerfiles
* Build shared workspace in docker build-stage for fileimport & webhook
26 lines
709 B
JavaScript
26 lines
709 B
JavaScript
'use strict'
|
|
const { registerOrUpdateScope } = require('@/modules/shared')
|
|
const { moduleLogger } = require('@/logging/logging')
|
|
|
|
exports.init = async (app) => {
|
|
moduleLogger.info('🔑 Init auth module')
|
|
|
|
// Initialize authn strategies
|
|
exports.authStrategies = await require('./strategies')(app)
|
|
|
|
// Hoist auth routes
|
|
require('./rest')(app)
|
|
|
|
// Register core-based scopes
|
|
const scopes = require('./scopes.js')
|
|
for (const scope of scopes) {
|
|
await registerOrUpdateScope(scope)
|
|
}
|
|
}
|
|
|
|
exports.finalize = async () => {
|
|
// Note: we're registering the default apps last as we want to ensure that all
|
|
// scopes have been registered by any other modules.
|
|
await require('./defaultApps')()
|
|
}
|