MCPcopy Create free account
hub / github.com/chartbrew/chartbrew / createPolicyError

Function createPolicyError

server/modules/outboundTargetPolicy.js:222–233  ·  view source on GitHub ↗
(reason, message, url, context, extra = {})

Source from the content-addressed store, hash-verified

220}
221
222function createPolicyError(reason, message, url, context, extra = {}) {
223 incrementSecurityCounter("ssrf_blocked_total");
224 if (reason === "metadata_endpoint") {
225 incrementSecurityCounter("metadata_blocked_total");
226 }
227
228 logOutboundSecurityEvent(
229 createPolicyLogPayload(url, context, reason, extra)
230 );
231
232 return new OutboundPolicyError(reason, message, extra);
233}
234
235function resolveAllowPrivateHost(context = {}) {
236 if (typeof context.allowPrivateHost === "boolean") {

Callers 1

validateOutboundUrlFunction · 0.85

Calls 3

incrementSecurityCounterFunction · 0.85
logOutboundSecurityEventFunction · 0.85
createPolicyLogPayloadFunction · 0.85

Tested by

no test coverage detected