Developing Custom Policies
After installing the Prerequisites, you can develop custom policies by using Omni Gateway Policy Development Kit (PDK).
The custom policy lifecycle consists of all the steps of developing a custom policy that occur in PDK. The following steps do not include steps that occur outside of PDK, such as applying a policy, which is the same for all Omni Gateway policies.
After you create a new project, you might iteratively complete some steps. For example, while writing the policy’s source code, you might need to return to add additional parameters, or you might need to recompile the policy after debugging the source code.
To create a custom policy with PDK, follow these steps:
-
Modify the
definition/gcl.yamlfile to define metadata and configuration parameters for your custom policy. -
Configure custom policy features in Rust.
Use the rust code examples to implement your custom logic in the
src/lib.rsfile. -
Compiling your policy creates the
WebAssemblybinary file and configuration files necessary to upload your policy to Exchange and deploy it to an Omni Gateway. -
Use pdk-unit for fast unit tests, the PDK debugging playground for interactive checks with Omni Gateway in Local Mode in Docker, and integration tests to guard against regressions with your services and gateway configuration.
-
Publish your policy on Exchange.
Publish your policy on Exchange to distribute a development version of your policy for testing with your Omni Gateway configuration and to release production-ready policies. To deploy a policy to Omni Gateway, see step seven.
-
Deploy your custom policy to a production environment by applying it to an API instance deployed on Omni Gateway.
-
Configure a new version of this API instance by returning to step two.



