Acl
Methods
lookup
View sourceLookup a given IP address in the ACL list.
Parameters
- ipAddress: string
Ipv6 or IPv4 IP address string
Returns
Promise<{ action: 'ALLOW' | 'BLOCK'; prefix: string } | null>
An object containing the ACL action and IP prefix if the given IP address matches an ACL entry, or null if there is no match.
import { Acl } from 'fastly:acl';addEventListener('fetch', async (evt) => { const myAcl = Acl.open('myacl'); const result = await myAcl.lookup(evt.client.address); evt.respondWith(new Response(result?.action === 'BLOCK' ? 'blocked' : 'allowed'));});static open(aclName: string): AclOpens the given ACL store by name
Parameters
- aclName: string
Returns