Execute on OPA Server
One of the major strengths of OPADotNet is that it runs all the policies embedded in the application which provides better performance. But it is possible to have all policy checks to be done on a remote OPA server instead.
This is done by setting the following configuration:
services.AddOpa(opt =>
opt.UseOpaServer("https://pathtoopa")
);
When using a remote OPA server, the other configurations such as syncs, discovery etc will not work since they require the embedded OPA.
When following this configuration, starting the application fails, throwing an exception.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=OPADotNet.AspNetCore
StackTrace:
at OPADotNet.AspNetCore.Builder.OpaBuilder.Build()
From the documentation
When following this configuration, starting the application fails, throwing an exception.