Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

409 error though adding the policy is requested properly #44

Open
kai-draft opened this issue Oct 25, 2024 · 3 comments
Open

409 error though adding the policy is requested properly #44

kai-draft opened this issue Oct 25, 2024 · 3 comments

Comments

@kai-draft
Copy link

Hello.

I have requested to add a policy, but the response code is 409.
I think the error statement is just a misprint, but I'd like to know what is wrong in this policy.

policy
{
"id": "no-name",
"content": "permit(principal is User, action == Action::"access", resource is Photo) when { resource.type == "Public" };"
}

response
{
"reason": "The requested resource already exists",
"description": "policy with the given id(no-name) already exists",
"code": 409
}

@omer9564
Copy link
Collaborator

It appears like your agent already has a policy with the ID no-name.
Can you attach the response of GET /policies ?
Anyway I'm guessing you are using the POST /policies API, if you want to upsert a policy ( by id ) you can use the PUT /policies/{id}

@kai-draft
Copy link
Author

@omer9564, hello.
It's not the problem for duplicate, of course.
There is no policy named 'no-name'.
Here is the result of Get /policeis.
image

And let me show you an example that clearly shows that "is" is the problem.

"is" NOT used
image

"is" used
image

Finally, the below is the result using POST /policies.
There is another error. But I don't want to talk about it at this time.
Please check more about "is" problem.
Thank you.

image

@omer9564
Copy link
Collaborator

omer9564 commented Nov 3, 2024

Hey @HonorBn ,
I have a busy couple of weeks with some upcoming events.
Will try to take a look at it afterward 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants