koralium / OPADotNet

Apache License 2.0
10 stars 2 forks source link

Execute on OPA Server fails #76

Closed thoma01 closed 1 year ago

thoma01 commented 1 year ago

From the documentation

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()
thoma01 commented 1 year ago

@Ulimo something to look into