MCPcopy
hub / github.com/parse-community/parse-server / handleParseAuth

Function handleParseAuth

src/middlewares.js:497–520  ·  view source on GitHub ↗
(appId)

Source from the content-addressed store, hash-verified

495}
496
497export function handleParseAuth(appId) {
498 return async (req, res, next) => {
499 const mount = getMountForRequest(req);
500 const config = Config.get(appId, mount);
501 if (!config) {
502 return next();
503 }
504 req.config = config;
505 const clientIp = getClientIp(req);
506 req.config.ip = clientIp;
507 await config.loadKeys();
508 const resolved = await resolveKeyAuth({
509 config,
510 keyValue: req.get('X-Parse-Master-Key') || null,
511 maintenanceKeyValue: req.get('X-Parse-Maintenance-Key') || null,
512 installationId: req.get('X-Parse-Installation-Id') || 'cloud',
513 clientIp,
514 });
515 if (resolved) {
516 req.auth = resolved;
517 }
518 return next();
519 };
520}
521
522export function handleParseHealth(options) {
523 return (req, res) => {

Callers

nothing calls this directly

Calls 6

getMountForRequestFunction · 0.85
nextFunction · 0.85
getClientIpFunction · 0.85
resolveKeyAuthFunction · 0.85
loadKeysMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected