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

Bugfix: improve Cosmos DB statement parser #1283

Conversation

paullatzelsperger
Copy link
Member

@paullatzelsperger paullatzelsperger commented May 11, 2022

What this PR changes/adds

Properly interprets the SQL-statements based on the right-hand operand of the Criterion and adds statement placeholders as needed.

Why it does that

To make the statement interpreter more robust and avoid SQL injection attacks.

Linked Issue(s)

Closes #1282
Closes #1002

Checklist

  • added appropriate tests?
  • performed checkstyle check locally?
  • added/updated copyright headers?
  • documented public classes/methods?
  • added/updated relevant documentation?
  • added relevant details to the changelog? (skip with label no-changelog)
  • formatted title correctly? (take a look at the CONTRIBUTING and styleguide for details)

@paullatzelsperger paullatzelsperger changed the title improve Cosmos DB statement parser Bugfix: improve Cosmos DB statement parser May 11, 2022
@paullatzelsperger paullatzelsperger marked this pull request as draft May 11, 2022 10:43
@paullatzelsperger paullatzelsperger force-pushed the feature/1282_improve_cosmos_statement_parser branch from 63da32f to 1f98abc Compare May 11, 2022 11:26
@codecov-commenter
Copy link

Codecov Report

Merging #1283 (1f98abc) into main (508b591) will increase coverage by 0.06%.
The diff coverage is 95.45%.

@@            Coverage Diff             @@
##             main    #1283      +/-   ##
==========================================
+ Coverage   67.35%   67.41%   +0.06%     
==========================================
  Files         715      716       +1     
  Lines       15735    15764      +29     
  Branches     1043     1048       +5     
==========================================
+ Hits        10599    10628      +29     
  Misses       4652     4652              
  Partials      484      484              
Impacted Files Coverage Δ
...zure/cosmos/dialect/CosmosConditionExpression.java 94.28% <94.28%> (ø)
...aceconnector/azure/cosmos/dialect/WhereClause.java 95.65% <100.00%> (+9.44%) ⬆️
.../dataspaceconnector/boot/util/TopologicalSort.java 92.85% <0.00%> (-2.39%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 508b591...1f98abc. Read the comment docs.

@paullatzelsperger paullatzelsperger force-pushed the feature/1282_improve_cosmos_statement_parser branch 2 times, most recently from 3db117c to 00ccb9c Compare May 11, 2022 13:12
@paullatzelsperger paullatzelsperger marked this pull request as ready for review May 11, 2022 13:13
@paullatzelsperger paullatzelsperger force-pushed the feature/1282_improve_cosmos_statement_parser branch from 4ed3647 to 5d40e40 Compare May 12, 2022 14:31
@paullatzelsperger paullatzelsperger merged commit aaf426d into eclipse-edc:main May 12, 2022
@juliapampus juliapampus added this to In progress in Connector via automation May 23, 2022
@juliapampus juliapampus moved this from In progress to Done in Connector May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Connector
  
Done
Development

Successfully merging this pull request may close these issues.

Bugfix: let Cosmos handle IN expressions properly CosmosDB: Run SQL from Criteria
3 participants