Fastly Compute C++ SDK
Loading...
Searching...
No Matches
ngwaf_inspect.cpp
#include "fastly/sdk.h"
int main() {
req,
fastly::security::InspectConfig().with_corp("my_corp").with_workspace(
"my_workspace"))};
auto verdict{ires->verdict()};
fastly::Body body{"NGWAF Verdict: "};
if (verdict == fastly::security::InspectVerdict::Allow) {
body << "Allow";
} else if (verdict == fastly::security::InspectVerdict::Block) {
body << "Block";
} else if (verdict == fastly::security::InspectVerdict::Unauthorized) {
body << "Unauthorized";
} else if (verdict == fastly::security::InspectVerdict::Other) {
body << *ires->unrecognized_verdict_info() << " (Other)";
}
}
int main()
Definition async_reqs.cpp:10
static Request from_client()
static Response from_body(Body body)
Create a new Response with the given value as the body.
Definition body.h:42
Configuration for inspecting a Request using Security.
Definition security.h:12
void init_simple(Endpoint endpoint, LogLevelFilter level)
tl::expected< InspectResponse, InspectError > inspect(fastly::http::Request &request, InspectConfig config)