-
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
[Multi data source] Add interfaces to register add-on authentication method from plug-in module #5851
[Multi data source] Add interfaces to register add-on authentication method from plug-in module #5851
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5851 +/- ##
==========================================
+ Coverage 66.95% 66.98% +0.02%
==========================================
Files 3302 3304 +2
Lines 63532 63563 +31
Branches 10146 10149 +3
==========================================
+ Hits 42536 42575 +39
+ Misses 18530 18520 -10
- Partials 2466 2468 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
… setup Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
… data source management plugin setup Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
3711d37
to
bf4eebe
Compare
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
@bandinib-amzn I saw two ciGroup was still failed, could you please take a look if related to your changes. Thanks |
src/plugins/data_source/server/auth_registry/authentication_methods_registry.test.ts
Show resolved
Hide resolved
src/plugins/data_source/server/auth_registry/authentication_methods_registry.test.ts
Show resolved
Hide resolved
I re-ran failed jobs. After running again, there are two failed jobs. But looks like they are not related to my change. |
e08bf30
into
opensearch-project:main
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-5851-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e08bf3059896449d2c008059c47b0b3de8da8c9e
# Push it to GitHub
git push --set-upstream origin backport/backport-5851-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
src/plugins/data_source/server/auth_registry/authentication_methods_registry.ts
Show resolved
Hide resolved
*/ | ||
public registerAuthenticationMethod(method: AuthenticationMethod) { | ||
if (this.authMethods.has(method.name)) { | ||
throw new Error(`Authentication method '${method.name}' is already registered`); |
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.
just to confirm this will fail the OSD bootstrap right? we should ensure OSD won't start if we see duplicated auth methods
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.
Just to confirm here you are not talking about yarn osd bootstrap
, right?
yarn osd bootstrap
is successful.
yarn start
fails. But it failing with server crash with following error. That needs to be handled properly. I will handle in following PR.
FATAL Error: Authentication method 'my_auth_method' is already registered
server crashed with status code 1
…method from plug-in module (opensearch-project#5851) * Adds method to register credential provider during data source plugin setup Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds method to register authentication method with UI elements during data source management plugin setup Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds UT for auth registry in data source plugin Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds UT for auth registry in data source management plugin Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds UT for data_source_management plugin.ts Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Refactor code Signed-off-by: Bandini Bhopi <bandinib@amazon.com> --------- Signed-off-by: Bandini Bhopi <bandinib@amazon.com> (cherry picked from commit e08bf30)
…method from plug-in module (opensearch-project#5851) * Adds method to register credential provider during data source plugin setup Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds method to register authentication method with UI elements during data source management plugin setup Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds UT for auth registry in data source plugin Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds UT for auth registry in data source management plugin Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds UT for data_source_management plugin.ts Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Refactor code Signed-off-by: Bandini Bhopi <bandinib@amazon.com> --------- Signed-off-by: Bandini Bhopi <bandinib@amazon.com> (cherry picked from commit e08bf30)
…method from plug-in module (#5851) (#5874) * Adds method to register credential provider during data source plugin setup Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds method to register authentication method with UI elements during data source management plugin setup Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds UT for auth registry in data source plugin Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds UT for auth registry in data source management plugin Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Adds UT for data_source_management plugin.ts Signed-off-by: Bandini Bhopi <bandinib@amazon.com> * Refactor code Signed-off-by: Bandini Bhopi <bandinib@amazon.com> --------- Signed-off-by: Bandini Bhopi <bandinib@amazon.com> (cherry picked from commit e08bf30)
Description
This PR adds the interfaces to register authentication method into the registry and get authentication registry. These interfaces are accessible via the setup and start hook in
plugin.ts
. Any core components or plugins that list dataSource and dataSourceManagement as a dependency will have access to these interfaces.Issues Resolved
Partially resolves #5692
Check List
yarn test:jest
yarn test:jest_integration