-
Notifications
You must be signed in to change notification settings - Fork 25
WIP: 🕸️ Bug / Support AWS OpenSearch Auth #1081
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
base: main
Are you sure you want to change the base?
Changes from 6 commits
4685670
16daf53
bf529fc
d636aac
da47b8b
d4edc0f
7275919
eaa1762
ab084cf
0ee6553
f74aa4a
a61d27f
eb2f820
17070fd
897442d
439d760
5fa7b18
94db9a7
7393589
e39af2a
7f995d3
b97e8f2
ce4504d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,4 +16,5 @@ lerna-debug.log | |
| !.env.test | ||
| !**/.env.schema | ||
|
|
||
| /configs | ||
| /configs | ||
| /modules/graphql-router/src/admin/** | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,10 +7,9 @@ import enforceAccessControl, { getDefaultServerSideFilter } from '#accessControl | |
| import fallbackConfigs, { validateConfigs } from '#config/index.js'; | ||
| import downloadRoutes from '#download/index.js'; | ||
| import getGraphQLRoutes from '#graphqlRoutes.js'; | ||
| import { getIndexMapping } from '#searchClient/index.js'; | ||
| import { buildCatalogueIntrospectionBody } from '#introspection/buildCatalogueIntrospection.js'; | ||
| import resolveCatalogueFields from '#mapping/resolveCatalogueFields.js'; | ||
| import buildSearchClient, { type SearchClient } from '#searchClient/index.js'; | ||
| import buildSearchClient, { getIndexMapping, type SearchClient } from '#searchClient/index.js'; | ||
| import type { ArrangerBaseContext } from '#types.js'; | ||
| import { addContext } from '#utils/context.js'; | ||
| import { warnDeprecatedConfigsSource } from '#utils/noops.js'; | ||
|
|
@@ -76,7 +75,7 @@ const arrangerRouter = async <Context extends ArrangerBaseContext>({ | |
| })); | ||
|
|
||
| const mappingFromIndex = await getIndexMapping({ | ||
| enableDebug, | ||
| enableDebug: !!enableDebug, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how is this change necessary?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a Type error, enableDebug at line 58 is
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternately we could change the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds like a type problem in the function's definition, rather than something to be coerced in this manner 🤔 @joneubank thoughts on this? |
||
| searchClient: esClient, | ||
| esIndex: configs[configRootProperties.ES_INDEX], | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,11 @@ | ||
| import type { Client as ElasticClient } from '@elastic/elasticsearch'; | ||
| import type { Client as OpenSearchClient } from '@opensearch-project/opensearch'; | ||
|
|
||
| export type SupportedClients = { elasticsearch: ElasticClient; opensearch: OpenSearchClient }; | ||
| export type SupportedClients = { | ||
| elasticsearch: ElasticClient; | ||
| opensearch: OpenSearchClient; | ||
| 'opensearch-aws': OpenSearchClient; | ||
| }; | ||
| export type SupportedClientTypes = keyof SupportedClients; | ||
| export type SearchConfig = { | ||
| node: string; | ||
|
|
@@ -40,8 +44,13 @@ export type SearchClientIndicesOpenParams = { index: string | string[] }; | |
| export type SearchClientIndicesPutMappingsParams = { index: string; body: Record<string, any> }; | ||
| export type SearchClientIndicesPutSettingsParams = { body: Record<string, any> }; | ||
| export type SearchClientBulkParams = { body: Record<string, any>[] }; | ||
| export type SearchClientCreateParams = { id: string; index: string; body: Record<string, any> }; | ||
| export type SearchClientDeleteParams = { index: string; id: string }; | ||
| export type SearchClientCreateParams = { | ||
| id: string; | ||
| index: string; | ||
| body: Record<string, any>; | ||
| refresh?: boolean | 'false' | 'true' | 'wait_for'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This list of types is peculiar, is this inherited from some third party library or did we decide these types? If we decided them, lets simplify to a list of string literals and add some documentation for why we chose these. If they are inherited, could we simplify them in a similar way?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see the problem too. Just to be clear, this is comment points to an outdated change, the latest version does not contain string literals for 'false' or 'true'. These are definitions that reflect the expected types for the OS/ES libraries. |
||
| }; | ||
| export type SearchClientDeleteParams = { index: string; id: string; refresh?: boolean | 'false' | 'true' | 'wait_for' }; | ||
|
demariadaniel marked this conversation as resolved.
Outdated
|
||
| export type SearchClientDeleteByQueryParams = { index: string; body: Record<string, any> }; | ||
| export type SearchClientIndexParams = { index: string; body: Record<string, any> }; | ||
| export type SearchClientUpdateParams = { id: string; index: string; body: Record<string, any> }; | ||
|
|
@@ -95,6 +104,8 @@ type SearchClientHitsResponse = SearchClientBaseResponse & { | |
| hits: { | ||
| hits: { | ||
| _source: any; | ||
| _id: string; | ||
| _index: string; | ||
| }[]; | ||
| }; | ||
| }; | ||
|
|
@@ -108,8 +119,8 @@ type SearchClientAggregationsResponse = SearchClientBaseResponse & { | |
| export type SearchClientSearchBody = { | ||
| _shards: ShardData; | ||
| aggregations?: Record<string, any>; | ||
| hits?: { | ||
| hits: { _id: string; _index: string; _source?: any }[]; | ||
| hits: { | ||
| hits: { _source?: any }[]; | ||
| }; | ||
| timed_out: boolean; | ||
| took: number; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.