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

Allow multiple hosts filtering #5

Open
ricardotealdi opened this issue Apr 23, 2015 · 8 comments
Open

Allow multiple hosts filtering #5

ricardotealdi opened this issue Apr 23, 2015 · 8 comments

Comments

@ricardotealdi
Copy link

For an app that responds for multiple hosts (e.g.: myapp.com and api.myapp.com), the Cassette::Authentication::Filter doesn't allow us to configure more than one host for the service ticket validation.

@andrerocker
Copy link

we know that possibility to use request.host but this is not a good pratice, and can cause security issues.

@ricardotealdi
Copy link
Author

We could add multiple hosts in the config.yml and then we could use the request.host as the service for validation, but verifying if the service is in the config.yml.

WDYT?

@rhruiz
Copy link
Member

rhruiz commented Apr 23, 2015

suggestions:

  • build a more specialized controller filter for this use case
  • provide a separate configuration entry for the "alternative" services so current configs don't break

@andrerocker
Copy link

@ricardotealdi This can be a cool approach, we can auto detect the service key value type, and assume a default beheviour.

@fabioperrella
Copy link
Contributor

+1

@fagnerpereira
Copy link

When there are multiple hosts actually the cache doesnt work, for example:
Im authenticating with first host and generate some ticket, if i try to authenticate again with the same ticket but another host the ticket will be valid cause its in the expire time.

@ricardotealdi
Copy link
Author

@fagnerpereira Great point! There is a bug on the ticket caching. Even if we implement something to allow for multiple hosts, the ticket caching won't validate a different service/host.

@andrerocker
Copy link

The ticket just be valid with our service, the cache key will should be a hash of key+service :p

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

5 participants