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

HTTP Basic authentication on the HTTP source plugin via plugins #545

Merged

Conversation

dlvenable
Copy link
Member

@dlvenable dlvenable commented Nov 5, 2021

Description

This PR includes the following significant changes:

  • The HTTP Source plugin now supports HTTP Basic authentication.
  • Plugins can receive a PluginFactory in their constructor
  • A new armeria-common project with pluggable interfaces for extending Armeria servers.
  • An Armeria HTTP Basic plugin

The HTTP Source can be configured in the following ways:

  1. Without authentication implicitly as it works now:
  source:
    http:
  1. Without authentication explicitly:
  source:
    http:
      authentication:
        unauthenticated:
  1. With HTTP Basic authentication enabled
  source:
    http:
      authentication:
        http_basic:
          username: log-ingest
          password: s3cr3t

Issues Resolved

Resolves #464

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

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.

…s the plugin framework to provide the authentication so that it can be customized without having to change the HTTP Source plugin itself. Resolves opensearch-project#464

Signed-off-by: David Venable <[email protected]>
@dlvenable dlvenable force-pushed the 464-http-source-authentication branch from 53d3e6a to 7026d12 Compare November 5, 2021 14:36
Copy link
Member

@graytaylor0 graytaylor0 left a comment

Choose a reason for hiding this comment

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

I didn't see any problems. Seems simple and easy to reuse and extend. Nice work!

Copy link
Collaborator

@chenqi0805 chenqi0805 left a comment

Choose a reason for hiding this comment

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

Just some high level thoughts. The change looks good me.

At this point, having ArmeriaAuthenticationProvider and HttpBasicArmeriaAuthenticationProvider in separate armeria-common module is a bit over-refactoring. For authentication provider interface, I did a brief search on armeria for authentication counterpart in grpc but there seemed to be no findings. So I am not sure whether and how it will be further extended. For HttpBasicArmeriaAuthenticationProvider, I have not seen value outside http-source yet. Thoughts?

@dlvenable
Copy link
Member Author

@chenqi0805 , You are correct that authentication for gRPC is different from HTTP. Though, I believe it also can use HTTP Basic since it uses HTTP underneath.

My primary motivation for refactoring it out is to expose the ArmeriaAuthenticationProvider interface. Users could then write their own authentication mechanism by creating a plugin implementing this interface. But, this is still possible by asking plugin authors to include the http-source plugin in their dependencies. I could move these classes into the http-source plugin now and we can extract them later if needed.

@chenqi0805
Copy link
Collaborator

I could move these classes into the http-source plugin now and we can extract them later if needed.

Oh. Not necessary. Just want to hear your thought on this.

@dlvenable dlvenable merged commit 7479209 into opensearch-project:main Nov 5, 2021
graytaylor0 referenced this pull request in graytaylor0/data-prepper Nov 5, 2021
…s the plugin framework to provide the authentication so that it can be customized without having to change the HTTP Source plugin itself. Resolves #464 (#545)

Signed-off-by: David Venable <[email protected]>
@dlvenable dlvenable deleted the 464-http-source-authentication branch November 29, 2021 17:47
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.

Secure the HTTP input plugin with HTTP Basic Authentication
3 participants