ory / ladon

A SDK for access control policies: authorization for the microservice and IoT age. Inspired by AWS IAM policies. Written for Go.

Home Page:https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=ladon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help required with custom conditions

adhicoder opened this issue · comments

Apart from appending a custom condition in ladon.conditionFactories, to create a custom condition, a function defining the condition is required. Where is this function defined? Is the file containing this function definition supposed to contain package ladon?
I am not able to include package ladon in the local file. The error message says: can't load package: package .: found packages ladon (arrayEqualsCondition.go) and main (loadPolicies.go) in /Users/tx81/Documents/Shared/PLM_UAM. How is this conflict resolved and how are custom conditions generally defined? The docs are a bit sparse on this one.

This looks like an error in your code (mixing package names) which is unrelated to ladon or usage of ladon. For a condition to work, you must implement this interface.

I hope that helps.

I am trying to implement the interface but I am getting an error while creating the Fulfills function, which says undefined: Request. What needs to be done to fix this? Request is one of the types used in the definition of the function.
Also, while appending the custom condition to ladon.ConditionFactories in func main(), Condition and CustomCondition are undefined. How do I repair this?

Phew, I don't really know. It seems like there are a couple of issues in your code base. Unfortunately I can't help you with learning Go, because my time for community support is limited and is used up by reviewing changes and improving software. You could however ask in our chat or alternatively ask in the gopher chat. If you're new to Go, I suggest checking out the go tour before doing anything else.

If you don't have any other questions regarding to this library specifically I'll close the issue.

Alright, thanks for your time. I am new to Go and finding certain ideas confusing. I'll try reading up on it a bit. You can go ahead and close the issue.