Video series · Episode 7 · 10–12 min

One policy, two places: Chenile in action

The payoff. The same interceptor abstraction runs in Chenile's auth gateway and in each service's pipeline, with the service registry choosing placement.

← All episodes

Episode goal: demonstrate Chenile’s unified policy model — write once, deploy at gateway and/or last mile via configuration — resolving the drift problem from episode six.

Cold open
On camera: “Last episode’s problem was drift — the same policy written twice, in two tech stacks. Chenile’s answer is almost annoyingly simple: there’s only one kind of policy.”
The idea
Voiceover: “A policy is a Chenile interceptor. The exact same interceptor contract runs inside the auth gateway from chenile-security, and inside every service’s interception pipeline at the last mile. You don’t write two versions. You write one, and choose where it runs.”
On screen
Two boxes — Gateway and Last mile — with the caption “same interceptor contract in both.” Arrows show the registry pushing a policy into either box.
Demo — last mile
Attach an authorization policy to a service via its service-registry entry (extension keys). Call the service directly; show it enforced at the last mile with full resource context.
Demo — gateway
Bring up the Chenile auth gateway (gateway starter). Configure authentication + a coarse check at the edge. Send an unauthenticated request; it’s rejected before reaching the service. “Same abstraction, different site.”
Demo — both
Now run both: authenticate at the edge, authorize the specific resource at the last mile. Send a request from a valid user for a resource they don’t own; edge lets it in, last mile blocks it. “Defence in depth, one policy model.”
Placement = config
Voiceover: “Moving a policy from last mile to gateway, or adding it in both, is a registry change — not a refactor. Placement is configuration.”
Beyond HTTP
Mention chenile-proxies (interface calls, local or remote) and chenile-messaging (MQTT, Kafka, Azure, in-JVM). “The same policy can guard an HTTP call, an internal proxy call, and a message off a queue.”
Key line
Lower third: “Write a policy once. Run it at the gateway, the last mile, or both — chosen by configuration.”
Recap card
“One interceptor abstraction, two deployment sites, placement by service-registry config. No drift.”

Companion reading: How Chenile implements policies at the gateway and the last mile