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

Bug with wildcards in authorizors #403

Closed
stealthycoin opened this issue Jul 6, 2017 · 1 comment
Closed

Bug with wildcards in authorizors #403

stealthycoin opened this issue Jul 6, 2017 · 1 comment
Labels

Comments

@stealthycoin
Copy link
Contributor

stealthycoin commented Jul 6, 2017

This works:

return AuthResponse(
    routes=[AuthRoute(path='*', methods=['*'])],
    principal_id='user')

But this does not:

return AuthResponse(routes=['*']), principal_id='user')
@jamesls
Copy link
Member

jamesls commented Jul 31, 2017

So for the AuthRoute we get:

         {'Statements': [{'Action': 'execute-api:Invoke',
                          'Effect': 'Allow',
                          'Resource': ['arn:aws:execute-api:us-west-2:123:rest-api-id/dev/*/']}]}

But for the HTTP methods we get:

{'Statement': [{'Action': 'execute-api:Invoke',
                'Effect': 'Allow',
                'Resource': ['arn:aws:execute-api:us-west-2:123:rest-api-id/dev/DELETE/',
                             'arn:aws:execute-api:us-west-2:123:rest-api-id/dev/HEAD/',
                             'arn:aws:execute-api:us-west-2:123:rest-api-id/dev/OPTIONS/',
                             'arn:aws:execute-api:us-west-2:123:rest-api-id/dev/PATCH/',
                             'arn:aws:execute-api:us-west-2:123:rest-api-id/dev/POST/',
                             'arn:aws:execute-api:us-west-2:123:rest-api-id/dev/PUT/',
                             'arn:aws:execute-api:us-west-2:123:rest-api-id/dev/GET/']}],
 'Version': '2012-10-17'}

jamesls added a commit to jamesls/chalice that referenced this issue Jul 31, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fixes aws#403.

As part of this change, I switched the static list of HTTP
methods to use '*'.  This cuts down on the verbosity of the
policy and makes the string routes and the AuthRoutes() more
consistent in the policies they generate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants