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

Add API for Retrieving All Documents #755

Merged
merged 11 commits into from
Jan 12, 2024
Merged

Add API for Retrieving All Documents #755

merged 11 commits into from
Jan 12, 2024

Conversation

raararaara
Copy link
Contributor

@raararaara raararaara commented Jan 9, 2024

What this PR does / why we need it:
This PR introduces additional functionality required for the creation and retrieval of documents through REST API. Specifically, it adds the following enhancements:

  • Authentication via Project Secret Key: Previously, authentication for API access was limited to user JWT tokens only. With this update, we have extended the authentication mechanism to also allow authentication using a Project Secret Key. This change provides more flexibility in how users and systems can authenticate and access our API.

Which issue(s) this PR fixes:

Related #677

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

Add FindProjectInfoBySecretKey and FindUserInfoById
@raararaara raararaara requested a review from hackerwins January 9, 2024 03:01
@CLAassistant
Copy link

CLAassistant commented Jan 9, 2024

CLA assistant check
All committers have signed the CLA.

Update FindProjectInfoBySecretKey test
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

Attention: 39 lines in your changes are missing coverage. Please review.

Comparison is base (6936d2b) 49.30% compared to head (b3a9327) 50.17%.
Report is 3 commits behind head on main.

Files Patch % Lines
server/backend/database/mongo/client.go 8.33% 22 Missing ⚠️
server/backend/database/memory/database.go 32.00% 15 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #755      +/-   ##
==========================================
+ Coverage   49.30%   50.17%   +0.86%     
==========================================
  Files          69       69              
  Lines       10094    10165      +71     
==========================================
+ Hits         4977     5100     +123     
+ Misses       4601     4526      -75     
- Partials      516      539      +23     

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

@raararaara raararaara marked this pull request as ready for review January 9, 2024 07:16
@raararaara raararaara changed the title Add API for Retrieving All Documents Add Authentication via Project Secret Key Jan 9, 2024
@raararaara raararaara changed the title Add Authentication via Project Secret Key Add API for Retrieving All Documents Jan 9, 2024
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. Overall looks good.

I left a few comments.

server/backend/database/database.go Outdated Show resolved Hide resolved
server/projects/projects.go Outdated Show resolved Hide resolved
server/backend/database/database.go Outdated Show resolved Hide resolved
server/rpc/interceptors/admin_auth.go Show resolved Hide resolved
server/rpc/interceptors/admin_auth.go Show resolved Hide resolved
@hackerwins hackerwins self-requested a review January 12, 2024 09:20
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

LGTM. 🚀

@hackerwins hackerwins merged commit eaefcdc into main Jan 12, 2024
3 checks passed
@hackerwins hackerwins deleted the rest-api branch January 12, 2024 09:28
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.

3 participants