contrib icon indicating copy to clipboard operation
contrib copied to clipboard

information required

Open ameerhu opened this issue 2 years ago • 4 comments

Is it still available for java 8? Or I have to switch into java 11?

When I tried to add dependency in POM.xml for the spring boot project. It doesn't resolve the dependency and throw following error.

Cannot resolve org.openpolicyagent:voter:1.0-SNAPSHOT

ameerhu avatar Aug 28 '21 22:08 ameerhu

Should work with Java 8. Looks like you are skipping the step before that?

mvn install:install-file -Dfile=target/voter-1.0-SNAPSHOT.jar -DpomFile=pom.xml

The jar isn't published to Maven Central, so you'll need to build and deploy it to your own repository.

anderseknert avatar Aug 29 '21 16:08 anderseknert

That's great. you are right, It works now. Can we use it to authorize the user as well or it can be only use to communicate between the microservers or application?

If we can use it to authorize the user then how could I dynamically verify the permission of the user by database? I mean I don't have only one user, I have multiple users in the database and I want to allow only if the subject Id equal to the one of the id exists in my database. Can you guide me here or show me the tutorial from where I can learn. Thanks!

ameerhu avatar Aug 29 '21 23:08 ameerhu

Sure you can! The input object provided to OPA is built here, so you could modify that to include whatever you need.

See the documentation on external data for how to get data from e.g. a database into your OPA instances. For most cases the bundle model is a pretty good default choice.

anderseknert avatar Aug 30 '21 08:08 anderseknert

Anything left unanswered here or are we good to close this @ameerhu?

anderseknert avatar Sep 08 '21 09:09 anderseknert