MCPcopy Create free account
hub / github.com/SenseUnit/dumbproxy / Access

Method Access

access/dst.go:32–45  ·  view source on GitHub ↗
(ctx context.Context, req *http.Request, username, network, address string)

Source from the content-addressed store, hash-verified

30}
31
32func (f DstAddrFilter) Access(ctx context.Context, req *http.Request, username, network, address string) error {
33 addrport, err := netip.ParseAddrPort(address)
34 if err != nil {
35 // not an IP address, no action needed
36 return f.next.Access(ctx, req, username, network, address)
37 }
38 addr := addrport.Addr().Unmap()
39 for _, pfx := range f.pfxList {
40 if pfx.Contains(addr) {
41 return ErrDestinationAddressNotAllowed{addr, pfx}
42 }
43 }
44 return f.next.Access(ctx, req, username, network, address)
45}

Callers

nothing calls this directly

Calls 2

AddrMethod · 0.80
AccessMethod · 0.65

Tested by

no test coverage detected