Commit Graph

40 Commits

Author SHA1 Message Date
Fredrik Adelöw b3f3e42036 move IdentityClient.getBearerToken
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2022-02-09 10:38:12 +01:00
MT Lewis af4864b462 search-backend: deduplicate authorize calls
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-26 19:38:01 +00:00
Vincenzo Scamporlino 9f394b231c Remove unused type
Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
2022-01-25 16:31:29 +01:00
Vincenzo Scamporlino 074f36cc43 Import DocumentTypeInfo from common
Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
2022-01-25 16:27:02 +01:00
Vincenzo Scamporlino 43f9d00c1e Add result-by-result filtering pagination test
Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
2022-01-25 16:27:02 +01:00
Vincenzo Scamporlino 77cbb31883 Fix comments
Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
2022-01-25 16:27:02 +01:00
Vincenzo Scamporlino e73ad9c89a Add AuthorizedSearchEngine tests
Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
2022-01-25 16:27:02 +01:00
MT Lewis c7ce3076d9 search-backend: skip result-by-result filtering when possible
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-25 14:35:37 +00:00
Vincenzo Scamporlino 12b9fb8b34 search-backend: initialize variable rather than declaring type
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-25 13:01:41 +00:00
Vincenzo Scamporlino bdbacb3b9c search-backend: handle missing type configuration in AuthorizedSearchEngine
The search-backend router ensures that all requested types are
configured, but since we don't know how this search engine will
be used, it's good to properly handle the case where an
unconfigured type is supplied.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-25 13:01:41 +00:00
Vincenzo Scamporlino 32e4645930 search-backend: validate page cursor when decoding
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-25 13:01:41 +00:00
MT Lewis 634abc1a41 search: move DocumentTypeInfo to search-common
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-25 13:01:40 +00:00
MT Lewis bbfbc755aa [wip] search-backend: result-by-result authorization
To do:
- add tests for AuthorizedSearchEngine
- update router tests
- add diff to changeset

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-25 13:01:39 +00:00
MT Lewis cd6854046e search-backend: validate query string
Ensures that known query params accepted by the search endpoint have
the correct type after parsing

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-18 16:53:22 +00:00
Iain Billett 651d1e7696 Don't use discovery API
Signed-off-by: Iain Billett <iain@roadie.io>
2021-12-15 11:50:44 +00:00
Iain Billett 4ce74edaf6 Fix standalone server
Signed-off-by: Iain Billett <iain@roadie.io>
2021-12-14 16:34:16 +00:00
Iain Billett a41fbfe739 Search result location filtering
Introduces filtering of unsafe search result locations.

Signed-off-by: Iain Billett <iain@roadie.io>
2021-12-14 14:43:45 +00:00
Fredrik Adelöw dcd1a0c3f4 Do not unpack arguments directly on exported items
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-12-07 19:42:10 +01:00
Otto Sichert b23bc7f9c3 Change default port of backend to 7007 due to MacOS Control Center update
Signed-off-by: Otto Sichert <git@ottosichert.de>
2021-11-18 16:45:57 +01:00
Patrik Oldsberg 8142a8ecb2 packages,plugins: add package documentation
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-09-14 18:47:53 +02:00
Oliver Sand 532b4cc656 Rework search paging based on cursors
Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
2021-09-02 10:22:41 +02:00
Oliver Sand eb81a5fdfb Implement offset and limit based paging in search API
Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
2021-09-02 10:19:32 +02:00
Adam Harvey 5fd7316f5d Improve search logging
Signed-off-by: Adam Harvey <adaharve@cisco.com>
2021-08-05 21:19:51 -04:00
Fredrik Adelöw a88073c29a Update copyright headers
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-18 20:26:42 +02:00
Fredrik Adelöw 3108ff7bfd Make yarn dev for backends respect the PLUGIN_PORT env var
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-14 14:46:19 +02:00
Emma Indal b9b2b4b766 [Search] Lunr search engine support (#5290)
* add lunr package

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* add search translator type and search engine interface

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* (wip) add support for lunr search engine

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* lunr search engine support

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* clean up todo comments

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* typing and cleanups

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* move lunr type package from dev deps to deps

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* check if documents exist to index

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* test fixup

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* changeset

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* move LunrSearchEngine.ts to /engines and add tests

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* update imports

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* update error message

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* add comment to index rotation

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* Update plugins/search-backend-node/src/types.ts

Signed-off-by: Fredrik Adelöw freben@gmail.com

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* Update plugins/search-backend-node/src/engines/LunrSearchEngine.ts

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

Co-authored-by: Fredrik Adelöw <freben@gmail.com>

* Update plugins/search-backend-node/src/engines/LunrSearchEngine.ts

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

Co-authored-by: Fredrik Adelöw <freben@gmail.com>

* fix imports

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* use type assertion to specify more specific ConcreteLunrQuery type

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* fix imports

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* consistent naming

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* change search engine to be parameter of constructor in indexBuilder

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* make engine required in router options and pass it through in createRouter used in standalone server

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* fix tests

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* delete import

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* add types to SearchQuery interface to make it possible to scope to specific index + test

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* clean up tests

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* handle case when a filter is added on a field that does not exist on all documents + test

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
2021-04-22 15:03:10 +02:00
Anders Näsman 5e70312d67 unwind dependencies
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:04 +01:00
Anders Näsman 4abd922fb5 moved types from search-backend to search-common
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:04 +01:00
Anders Näsman f9b203e07e cursor pagination
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:03 +01:00
Anders Näsman b7cb59dd7b standard TODO syntax
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:03 +01:00
Eric Peterson 2c759b452a Clean up query types, ensure we've got room to expand on the result items.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:03 +01:00
Eric Peterson ed6508d06c Clean up error handling.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:03 +01:00
Eric Peterson ca74761fce Add a simple sanity test to the search-backend plugin.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:03 +01:00
Eric Peterson 0c04830e8b (C)*
Co-authored-by: Adam Harvey <adam.harvey@dxc.com>
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:02 +01:00
Eric Peterson a9c1a72016 (C)*
Co-authored-by: Adam Harvey <adam.harvey@dxc.com>
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:02 +01:00
Eric Peterson b7b4cc319c Wire up search backend to app backend testbed.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:41:15 +01:00
Eric Peterson e0854f10d5 Set up an unused method to illustrate type usage / communication between search frontend and backend
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:39:59 +01:00
Eric Peterson 04b492d404 Use IndexableDocument in search result set.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:38:45 +01:00
Anders Näsman 7f4d402226 add types
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:38:45 +01:00
Anders Näsman 2c58ccaeee initial search-backend setup
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:38:44 +01:00