Skip to content

Add a way to pass database context as header from swagger UI#12695

Merged
gortiz merged 2 commits intoapache:masterfrom
shounakmk219:pass-database-in-swagger
Mar 22, 2024
Merged

Add a way to pass database context as header from swagger UI#12695
gortiz merged 2 commits intoapache:masterfrom
shounakmk219:pass-database-in-swagger

Conversation

@shounakmk219
Copy link
Collaborator

Description

This is a best effort attempt to allow passing database context as http header to perform table/schema specific requests.
The approach piggy backs on the @Authorization API on swagger to inject the database header disguised as API Auth key.
Post this change the swagger UI will have an option to set the database context once and use it throughout all operations.
Input screen will look like
image

Related resources

Copy link
Contributor

@gortiz gortiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a note: do you think it may be useful to set the description attribute in ApiKeyAuthDefinition to indicate this is the database that will be used by default? Or do you think it is going to be repetitive?

@shounakmk219
Copy link
Collaborator Author

LGTM, just a note: do you think it may be useful to set the description attribute in ApiKeyAuthDefinition to indicate this is the database that will be used by default? Or do you think it is going to be repetitive?

That's a great suggestion! Extra info won't hurt imo

@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 61.55%. Comparing base (59551e4) to head (2aac8e1).
Report is 155 commits behind head on master.

Files Patch % Lines
...ller/api/resources/PinotBrokerRestletResource.java 50.00% 1 Missing ⚠️
.../resources/PinotLeadControllerRestletResource.java 0.00% 1 Missing ⚠️
...oller/api/resources/PinotRunningQueryResource.java 0.00% 1 Missing ⚠️
...ller/api/resources/PinotSchemaRestletResource.java 0.00% 1 Missing ⚠️
.../controller/api/resources/PinotTableInstances.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12695      +/-   ##
============================================
- Coverage     61.75%   61.55%   -0.20%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2456      +20     
  Lines        133233   134400    +1167     
  Branches      20636    20803     +167     
============================================
+ Hits          82274    82733     +459     
- Misses        44911    45489     +578     
- Partials       6048     6178     +130     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 61.50% <50.00%> (-0.21%) ⬇️
java-21 61.40% <50.00%> (-0.23%) ⬇️
skip-bytebuffers-false 61.54% <50.00%> (-0.20%) ⬇️
skip-bytebuffers-true 61.36% <50.00%> (+33.63%) ⬆️
temurin 61.55% <50.00%> (-0.20%) ⬇️
unittests 61.55% <50.00%> (-0.20%) ⬇️
unittests1 46.16% <ø> (-0.73%) ⬇️
unittests2 27.94% <50.00%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants