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

0.2.0.0 functionalizing #910

Closed
wants to merge 40 commits into from

Conversation

o-psi
Copy link
Contributor

@o-psi o-psi commented Mar 17, 2024

Reworking of post.php logic where most actions occur via functions.
This way we can manipulate those functions for the API.
Goal is an easier to maintain codebase as our logic grows more complicated, and to ease api development.

I am building a NinjaOne integration tool (distinct from ITFlow, dw) and realized that the API is a bit cobbled together, and very cumbersome to add to.

@wrongecho
Copy link
Collaborator

Test these changes at: https://0200functionalizing910.pr-review.itflow.org
(automatic message)

functions/api_functions.php Fixed Show fixed Hide fixed
functions/api_functions.php Fixed Show fixed Hide fixed
functions/api_functions.php Fixed Show fixed Hide fixed
function tryAPIKey($api_key_secret) {
global $mysqli, $session_ip, $session_user_agent;

$row = mysqli_fetch_array(mysqli_query($mysqli,"SELECT * FROM api_keys WHERE api_key_secret = '$api_key_secret'"));

Check failure

Code scanning / SonarCloud

Database queries should not be vulnerable to injection attacks High

Change this code to not construct SQL queries directly from user-controlled data. See more on SonarCloud
@o-psi o-psi closed this Mar 20, 2024
@o-psi o-psi reopened this Mar 20, 2024
@o-psi o-psi marked this pull request as ready for review March 20, 2024 00:01
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ B)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@o-psi o-psi closed this Mar 20, 2024
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

Successfully merging this pull request may close these issues.

2 participants