-
-
Notifications
You must be signed in to change notification settings - Fork 240
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 to configure enabled query endpoints #477
Conversation
@alexjfisher Hi, so nice to see some activity in Puppetboard, thanks a lot! |
Allow to configure which PuppetDB endpoints are allowed in the /query page, adding the ENABLED_QUERY_ENDPOINTS configuration variable, that if set restricts the allowed endpoints to query. If not set the previous behaviour is kept, allowing all PuppetDB endpoints to be queried, if the ENABLE_QUERY configuration is True. Closes: voxpupuli#475
I've rebased the branch to the current HEAD of master resolving the conflicts (was just he README migration from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM -- just a single comment 😄
|
||
if form.endpoints.data == 'pql': | ||
query = form.query.data | ||
elif form.query.data[0] == '[': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this perhaps be form.query.data.strip[0]
instead to correctly handle a query with a leading newline/space? I imagine that could happen pretty easily with a textarea field and copy-paste.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@runejuhl thanks for the review. This was pre-existing code (see line 771 on current code), but I'm happy pass it through strip()
if there is an agreement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/me toggles the unified diff setting
Sorry about that, you're right of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can stay as it is. But another PR that makes the existing code more beautiful is always highly appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
oh and @bastelfreak, thanks for merging and sorting out all the travis related stuff over the weekend! :) |
Allow to configure which PuppetDB endpoints are allowed in the
/query
page, adding the
ENABLED_QUERY_ENDPOINTS
configuration variable, thatif set restricts the allowed endpoints to query. If not set the previous
behaviour is kept, allowing all PuppetDB endpoints to be queried, if the
ENABLE_QUERY
configuration isTrue
.Closes: #475