()
| 4 | |
| 5 | export class SecurityRouter extends PromiseRouter { |
| 6 | mountRoutes() { |
| 7 | this.route( |
| 8 | 'GET', |
| 9 | '/security', |
| 10 | middleware.promiseEnforceMasterKeyAccess, |
| 11 | this._enforceSecurityCheckEnabled, |
| 12 | async req => { |
| 13 | const report = await new CheckRunner(req.config.security).run(); |
| 14 | return { |
| 15 | status: 200, |
| 16 | response: report, |
| 17 | }; |
| 18 | } |
| 19 | ); |
| 20 | } |
| 21 | |
| 22 | async _enforceSecurityCheckEnabled(req) { |
| 23 | const config = req.config; |