()
| 63 | |
| 64 | export class FunctionsRouter extends PromiseRouter { |
| 65 | mountRoutes() { |
| 66 | this.route( |
| 67 | 'POST', |
| 68 | '/functions/:functionName', |
| 69 | promiseEnsureIdempotency, |
| 70 | FunctionsRouter.multipartMiddleware, |
| 71 | FunctionsRouter.handleCloudFunction |
| 72 | ); |
| 73 | this.route( |
| 74 | 'POST', |
| 75 | '/jobs/:jobName', |
| 76 | promiseEnsureIdempotency, |
| 77 | promiseEnforceMasterKeyAccess, |
| 78 | function (req) { |
| 79 | return FunctionsRouter.handleCloudJob(req); |
| 80 | } |
| 81 | ); |
| 82 | this.route('POST', '/jobs', promiseEnforceMasterKeyAccess, function (req) { |
| 83 | return FunctionsRouter.handleCloudJob(req); |
| 84 | }); |
| 85 | } |
| 86 | |
| 87 | static handleCloudJob(req) { |
| 88 | if (req.auth.isReadOnly) { |
nothing calls this directly
no test coverage detected