Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion types/security.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ declare module 'fastly:security' {
/**
* Inspect a Request using the [Fastly Next-Gen WAF](https://docs.fastly.com/en/ngwaf/).
*/
export function inspect(request: Request): InspectResponse;
export function inspect(
request: Request,
config: InspectConfig,
): InspectResponse;

/**
* Results of asking Security to inspect a Request.
Expand All @@ -29,3 +32,30 @@ declare module 'fastly:security' {
Unauthorized = 'unauthorized',
}
}

/**
* Configuration object for `inspect`.
*/
export interface InspectConfig {
/**
* Set a corp name for the configuration.
*
* This is currently required but will be made optional in the future.
*/
corp: string;
/**
* Set a workspace name for the configuration.
*
* This is currently required but will be made optional in the future.
*/
workspace: string;
/**
* Specify an explicit client IP address to inspect.
*
* By default, `inspect` will use the IP address that made the request to the
* running Compute service, but you may want to use a different IP when
* service chaining or if requests are proxied from outside of Fastly’s
* network.
*/
overrideClientIp?: string;
}
Loading