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

Loading another router #3

Open
davejlong opened this issue Nov 8, 2016 · 6 comments
Open

Loading another router #3

davejlong opened this issue Nov 8, 2016 · 6 comments

Comments

@davejlong
Copy link
Member

It would be really nice to have a way to add more routes to dashboard, for example to add authentication to the dashboard. Similar to how Dashing had the config.ru which you could add routes to.

@zorbash
Copy link
Member

zorbash commented Nov 8, 2016

To be honest i'm not really fond of how dashing deals with authentication via config.ru.

Most dashing apps are deployed behind a reverse proxy like apache or nginx on which it's trivial to setup HTTP Basic Auth or IP range restrictions.

On the other hand I'm not negative on allowing the user to specify additional routes.
An initial straightforward use case is hooks see: #4 where we allow a passive data flow for populating the widgets with data, as we let the user set triggers instead of polling a resource from a job.

@davejlong
Copy link
Member Author

I have a couple use cases that I'm looking to accomplish. As you can see in cagedata/dashboard, we use Azure AD to authenticate to our dashboard app.

The other is for webhook support as you mentioned in #4.

For authentication, you could theoretically just take the opinionated route and pass to Ueberauth: if configured, force Ueberauth authentication, else the application is open.

@davejlong
Copy link
Member Author

I'm thinking about implementing a forwarder in Kitto.Router. It would forward all requests to /my_dashboard, based on the application's name, to MyDashboard.Router which could implement it's own set of routes. This could also expand to include #4 as MyDashboard.Router would be able to handle any routes.

@davejlong davejlong self-assigned this Nov 14, 2016
@zorbash
Copy link
Member

zorbash commented Nov 14, 2016

I'd love to see a prototype of this.

@davejlong davejlong removed their assignment Nov 17, 2016
@davejlong
Copy link
Member Author

I'm back to working on a prototype for this. With targeting Heroku as a deployment option, I think it's necessary to be able to support authentication since Heroku doesn't offer anything else. I'm playing with Ueberauth to manage the auth logic.

@davejlong
Copy link
Member Author

Circling back and thinking about it, I think the way to build this feature out is to allow a config option to specify a custom router. Then in the match _ block of Kitto.Router, check if the route exists and the other router and call it if it does.

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

No branches or pull requests

2 participants