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

Resource auth attribute is modified by FalconAuthMiddleware #33

Open
volinthius opened this issue Jul 17, 2019 · 0 comments
Open

Resource auth attribute is modified by FalconAuthMiddleware #33

volinthius opened this issue Jul 17, 2019 · 0 comments

Comments

@volinthius
Copy link

In FalconAuthMiddleware the auth attribute of the resource is picked and then modified:

    def _get_auth_settings(self, req, resource):
        auth_settings = getattr(resource, 'auth', {})
        auth_settings['exempt_routes'] = self.exempt_routes
        if auth_settings.get('auth_disabled'):
            auth_settings['exempt_routes'].append(req.uri_template)

        for key in ('exempt_methods', 'backend'):
            auth_settings[key] = auth_settings.get(key) or getattr(self, key)

        return auth_settings

This causes a minor issue with JWTAuthBackend backend during testing when resource is only overriding exempt_methods (not backend). For each test we are creating a fresh OIDC provider instance. However since the auth backend (and JWT key with it) is already set in one test to resource later tests still use that old auth backend (with old JWT key) key and fail.

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

1 participant