This repository has been archived by the owner on Oct 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arberiii
added
enhancement
New feature or request
Go
Issue requires to write code using Go language
labels
Jun 25, 2020
Codecov Report
@@ Coverage Diff @@
## master #882 +/- ##
==========================================
- Coverage 53.65% 53.62% -0.04%
==========================================
Files 132 132
Lines 3131 3133 +2
Branches 151 151
==========================================
Hits 1680 1680
- Misses 1383 1384 +1
- Partials 68 69 +1
Continue to review full report at Codecov.
|
rohithbalaji123
suggested changes
Jun 25, 2020
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.
@arberiii , Thanks for working on this interesting PR. I have left few simple suggestions.
arberiii
changed the title
Respond to the Search API request
Response to the Search API request
Jun 25, 2020
magicoder10
suggested changes
Jun 25, 2020
magicoder10
suggested changes
Jun 25, 2020
magicoder10
approved these changes
Jun 25, 2020
arberiii
added a commit
that referenced
this pull request
Jun 25, 2020
* Remove manual string concatenation for reCaptcha API request body (#851) * Use net/url lib for recaptcha request body - Also add a test for recaptcha error response * Apply suggestions from code review Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Check for Has Error in recaptcha test Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Add user permission checks to change log usecases (#859) * Add permission check for delete change logs * Add permission check for create change logs * Add permission check for update change logs * Add test cases for permission check * Add authorizer in NewPersist constrictor args * Add suggestions from code review * Add shortlink updater interface to use cases (#854) * Add IsAliasOwnedByUser to UserShortLink interface * Change UserShortLink interface to include IsAliasOwnedByUser method which allows verification of user and alias relationship. * Fix comparison bug in `func (u *UserFake) CreateUser`. * Add updater to shortlink use * Updater adds the ability to mutate short links owned by a user. * Add unit tests for valid, invalid, and malicious short link updates. * Replace references to IsAliasOwnedByUser * Remove references to IsAliasOwnedByUser and replace with HasMapping. * Replace `found` with idiomatic `ok`. * Add ErrShortLinkNotFound * Update ErrShortLinkNotFound go doc Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Cleanup Updater go doc Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Cleanup UpdaterPersist go doc Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Cleanup UpdaterPersist field names * Change `userShortLinkRelationRepo` to `userShortLinkRepo` Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Cleanup UpdateShortLink go doc Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Rename `ok` to `hasMapping` * Make variable meaning explicit Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Update malicious long link test name Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Simplify test variable names Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Change expHasErr to expectedHasErr Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Cleanup NewUpdaterPersist variable names Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Update references to old var names * Remove keygen from UpdaterPersist * Breakup validation if statements * Move test data to individual structures * Move blocked long link to test case data * Apply suggestions from code review Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Refactor graphQL related schemas into a singe source (#861) * Refactor graphQL related schemas into a singe source * Rename Schema.ts to schema.ts * Update Url.service.ts * Rename occurences of Schema into schema Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Rename ShortGraphQLService into shortGraphQL (#862) * Add UpdateTwitterTags to adapter (#850) * Add UpdateTwitterTags to adapter * Make small change * Update backend/app/adapter/sqldb/short_link.go Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Reorder UpdateOpenGraphTags and UpdateTwitterTags * Update tests * Format Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Add match package (#864) * draft matcher * factor keyword * document exported types * replace error format * comment constants * rename matcher to match * fix logic of contains * rename match type * fix tests * remove the interface Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Search Short Link resource (#849) * unit tests * implement short link search * refactor * refactor filter * renaming * check errors seperately * refactor query match * refactor short link match * rename and remove blank lines * embeed short links into test cases * refactor match short links * format search tests * add test case * Apply suggestions from code review * add todos * go format Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Add api/search route (#867) * add search api route * add searcher * format * rename config * format * format * search timeout provider * rename search api * search provider * Update backend/dep/provider/search.go * Update backend/dep/provider/search.go Co-authored-by: Harry Liu <byliuyang11@gmail.com> * rename netURL package (#868) * Add constructor for Filter (#870) * fix bug * tie order with resource * filter validation * hide fields of filter * format * rename test * handle package * Remove unused obervability package (#874) * split handlers * rename handlers * Remove unnecessary dereference operator (#875) * Remove unnecessary dereference operator * Rename ShortLinkSql to ShortLinkSQL * Fix integration test * Update backend/app/adapter/sqldb/short_link.go Co-authored-by: Arber Avdullahu <arber_919@live.com> Co-authored-by: Arber Avdullahu <arber_919@live.com> * Add update short link api (#876) * Move args closer to its consumer * Add update short link API * Fix unit tests * Parse search API request (#878) * parse user * read request draft * authenticate user * format * unmarshal search request * change comment * add comment * unmarshal filter * format * Refactored search API parsing * Clean up * Clean up * fix comment * comment constants Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Effectual assignments in Go code and constant comments (#881) * assign err * fix comments * address review * Add MetaTagPersist to usecase (#871) * Add MetaTagPersist * Apply suggestions from code review Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Make code review changes * Make code review changes Co-authored-by: Harry Liu <byliuyang11@gmail.com> * Response to the Search API request (#882) * respond * rename respond body * address comments * change maxResult logic * format * rename constructors Co-authored-by: Harry Liu <byliuyang11@gmail.com> Co-authored-by: James Cote <3276350+Coteh@users.noreply.github.com> Co-authored-by: Rohith Balaji <rohithbalaji123@gmail.com> Co-authored-by: Oscar Tovar <33381041+oatovar@users.noreply.github.com> Co-authored-by: Kapil Lamba <kapillamba4@gmail.com> Co-authored-by: Arber Avdullahu <arber_919@live.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR concludes the Search API feature. Since for now, we allow users to search only short links created by them, we first authenticate the user. After that, we retrieve the result from the searcher. The results are formatted into JSON format and the API responds to the client.