-
Notifications
You must be signed in to change notification settings - Fork 28
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
New params in TPT query to indicate #137
base: main
Are you sure you want to change the base?
New params in TPT query to indicate #137
Conversation
@@ -4760,16 +4770,24 @@ query_tpt-tool-cpu() { ##? [--startyear=<YYYY>] [--endyear=<YYYY>] [--formula=av | |||
sql_formula="SUM" |
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.
is this variable not used?
This is not a priority. This project will probably never add anything to prevent SQL injection outside of common sense checks on input. See e.g. Admins installing gxadmin should understand that they're granting read write database access to anyone with gxadmin access. You could setup a separate role that e.g. restricts table access. If SQL injection is a concern, then I strongly recommend doing this. A read-only DB account will prevent a lot of issues. I think EU is currently the only place granting a select group of users the ability to run gxadmin just for statistics queries, but there I believe they use read-only access (right @mira-miracoli ?)
I'm not sure there is a more elegant way, but the current changes are hmm. It's not my query so I won't push back too hard, but, providing extra bits of sql in this way is not a very user friendly or ergonomic design. You're also hitting the limits of our argument parsing library there. The We only have one other function that accepts arbitrary numbers of arguments but it's function signature is much simpler. I'd honestly suggest maybe separate queries per metric, or a single query with an optional For design inspiration you could look at the |
@hexylena Yes, in EU a select group of users can log-in as a specific Linux user that has read-only access to the database, so their gxadmin calls cannot alter the database contents. |
Few questions for us to ponder:
arrSelect1
andarrWhere1
(JSON, multidimensional array, etc)?