-
Notifications
You must be signed in to change notification settings - Fork 885
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
[Multiple Datasource] Support Amazon OpenSearch Serverless #3957
Changes from 2 commits
1d347da
2df5ad5
8451673
11b13ea
eb13318
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 |
---|---|---|
|
@@ -301,7 +301,7 @@ export class DataSourceSavedObjectsClientWrapper { | |
); | ||
} | ||
|
||
const { accessKey, secretKey, region } = credentials as SigV4Content; | ||
const { accessKey, secretKey, region, service } = credentials as SigV4Content; | ||
|
||
if (!accessKey) { | ||
throw SavedObjectsErrorHelpers.createBadRequestError( | ||
|
@@ -320,6 +320,12 @@ export class DataSourceSavedObjectsClientWrapper { | |
'"auth.credentials.region" attribute is required' | ||
); | ||
} | ||
|
||
if (!service) { | ||
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. Is multiple datasources out of experimental? If so, then it will likely need a migration for this saved object otherwise previous saved objects will fail. 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. Yes, MD is out of experimental. I don't think previous saved object will fail, because 1) we are using dynamic mapping for data source saved object. 2) service name is actually defined as optional field. Now it can still be undefined and be backwards compatible 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 condition is added to the create API of saved object wrapper, to align with UI dropdown list, that a service name must be selected when creating the corresponding data source |
||
throw SavedObjectsErrorHelpers.createBadRequestError( | ||
'"auth.credentials.service" attribute is required' | ||
); | ||
} | ||
break; | ||
default: | ||
throw SavedObjectsErrorHelpers.createBadRequestError(`Invalid auth type: '${type}'`); | ||
|
@@ -457,7 +463,7 @@ export class DataSourceSavedObjectsClientWrapper { | |
|
||
private async encryptSigV4Credential<T = unknown>(auth: T, encryptionContext: EncryptionContext) { | ||
const { | ||
credentials: { accessKey, secretKey, region }, | ||
credentials: { accessKey, secretKey, region, service }, | ||
} = auth; | ||
|
||
return { | ||
|
@@ -466,6 +472,7 @@ export class DataSourceSavedObjectsClientWrapper { | |
region, | ||
accessKey: await this.cryptography.encryptAndEncode(accessKey, encryptionContext), | ||
secretKey: await this.cryptography.encryptAndEncode(secretKey, encryptionContext), | ||
service, | ||
}, | ||
}; | ||
} | ||
|
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.
why do we change the version here? are we allowed to do this?
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.
This is a drop-in replacement as a short term solution to support serverless in legacy client, before #2220 is completed . See this comment for the reasoning and long term solution. #3623 (comment)
I've seen this kind of drop-in being done before as short term solution. Besides, the
http-aws-es
package is only used for data source featureOpenSearch-Dashboards/package.json
Line 462 in 8121c9d
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.
discussed with the team and reached an agreement to do this as a short term solution.