-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
question: Is there a way to match if a value is in an array? #302
Comments
I should also add, it appears there's some difficulty with the match directive parsing the field with a colon in it. |
@mattatjff , what is your current config the output of |
Not sure what that refers to. I don't have any additional configuration with respect /whoami, other than that I have Passing
What I'm trying to do is basically say something like:
Such that if a user is in the group "myapp" in cognito and therefore |
Yes. However, it might work differently than how you think it work. Here is the working config:
Currently, you need to create "custom:roles" attribute to propagate Cognito roles to be able to match them. However, I could adjust this by making When using That would require me to make changes. I need to see the actual token with |
The cognito token looks like the following (some info redacted / slightly modified with
There are two possible properties which I could see as being useful, the |
Looks like the tokenFeilds in the validator already accounts for "groups" and there are others who are looking for similar transformation on other projects: Perhaps simply transforming |
I don't think you can transform on As a side thing, I will add an option of including the following into
|
That should work, much appreciated. |
Tried to build this to test, but running into this: caddyserver/caddy#5797 |
@mattatjff , I am working on the fix and will be releasing new version soon. Will update this issue once completed. |
@mattatjff , please try this release https://github.com/greenpau/caddy-security/releases |
I don't know go... but this is including the entire id_token from cognito as the role... I think the error is here: I believe this should probably be Sorry for the can of worms :P |
@mattatjff , let me quickly fix it. The issue with that specific function is that it is not being tested properly. So I took a shortcut. |
v1.1.22 confirmed good... works with either group or the role attached to it. Thank you very much. |
Enjoy the journey 😄 |
@greenpau you too. Thanks for the great piece of software, this really saved me a ton of time. Any place I can donate? |
You are welcome!
|
Hi @mattatjff, I am looking to add testimonial sections to https://authcrunch.com. Could you please write one and send it to me at [email protected]? |
I'd like to be able to use cognito with the "cognito:groups" field, to see if a person is in a group and transform their roles accordingly. However, the match statements all seem to assume it's looking at a string. Is there a way to match if an element appears in an array?
The text was updated successfully, but these errors were encountered: