Configure puppetdb to allow cross domain requests?

280 views
Skip to first unread message

Bruce

unread,
Apr 21, 2014, 12:36:13 PM4/21/14
to puppet...@googlegroups.com
Hi,

I'm trying to do some interesting javascript integration between grafana and puppetdb.  I'd like a grafana scripted dashboard to to make a puppetdb API call, to then create a list of hosts for a dashboard.  However, this is a cross-domain request, so browsers don't allow it.  With Apache, I would add this to the configuration:

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, OPTIONS"
Header set Access-Control-Allow-Headers "origin, authorization, accept"

However, puppetdb is runny via jetty, and I can't figure out a way to do this.  Anyone know how to allow this?

Thanks!

Ken Barber

unread,
Apr 22, 2014, 10:01:30 AM4/22/14
to Puppet Users
PuppetDB does not support CORS or JSONP today, to work-around this you
can probably proxy the PuppetDB API from the same virtualhost/domain
where your application resides.

I see you already raised a FR request on this:
https://tickets.puppetlabs.com/browse/PDB-587 ... we also had a
another ticket for JSONP:
https://tickets.puppetlabs.com/browse/PDB-217

ken.
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/d8ae1fae-32c1-4f5b-a281-f26a5ed50df8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages