Skip to content
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

Add disable_authentication flag to the opensearch source #2942

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

graytaylor0
Copy link
Member

@graytaylor0 graytaylor0 commented Jun 27, 2023

Description

Adds a disable_authentication flag to the OpenSearch source, which allows auth to be skipped if desired. Defaults to false.

Issues Resolved

Resolves #2939

Check List

  • New functionality includes testing.
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Comment on lines +91 to +93
if (((Objects.nonNull(awsAuthenticationOptions) && ((Objects.nonNull(username) || Objects.nonNull(password)) || disableAuthentication)) ||
(Objects.nonNull(username) || Objects.nonNull(password)) && disableAuthentication) ||
(Objects.isNull(awsAuthenticationOptions) && (Objects.isNull(username) || Objects.isNull(password)) && !disableAuthentication)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: it's easier to get a sense of the conditionals by breaking this into a few booleans. Something like

final boolean isAwsAuthValid = ..
final boolean is userNamePasswordValid = ..

if (isAwsAuthValid && !userNamePasswordValid ...)

Copy link
Collaborator

@oeyh oeyh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@graytaylor0 graytaylor0 merged commit 0d29418 into opensearch-project:main Jun 29, 2023
24 checks passed
MaGonzalMayedo pushed a commit to MaGonzalMayedo/data-prepper that referenced this pull request Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] OpenSearch source plugin requires auth configuration even when the source cluster does not need any
3 participants