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

[FLINK-23272][web] Add custom netty HTTP request inbound/outbound handlers #16463

Closed
wants to merge 7 commits into from

Conversation

gaborgsomogyi
Copy link
Contributor

What is the purpose of the change

At the moment there is no possibility to influence netty HTTP inbound/outbound requests. This could be useful from many perspectives. A good example (amongst others) is authentication/authorization. Here are the exact examples:

  • With an outbound custom netty handler one can modify the HTTP request by adding authentication information.
  • With an inbound custom netty handler one can do authentication/authorization.

In this PR I've added 2 generic APIs in order to handle inbound and outbound HTTP requests.
Please see FLIP-181 for further details.

Brief change log

  • Added. InboundChannelHandlerFactory
  • Added. OutboundChannelHandlerFactory
  • TestRestServerEndpoint and RestClient are now getting Flink Configuration instances.

Verifying this change

  • Existing automated tests
  • There are 2 not yet published external repositories with automated tests using the newly added APIs:
    • Basic authentication
    • Kerberos authentication

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes, introduced 2 @Experimental APIs
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? JavaDocs + API usage examples (intended to be published when APIs are in place)

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 743a2a8 (Mon Jul 12 07:14:32 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!
  • This pull request references an unassigned Jira ticket. According to the code contribution guide, tickets need to be assigned before starting with the implementation work.

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@gaborgsomogyi gaborgsomogyi changed the title [FLINK-21108][web] Add custom netty HTTP request inbound/outbound handlers [FLINK-23272][web] Add custom netty HTTP request inbound/outbound handlers Jul 12, 2021
@flinkbot
Copy link
Collaborator

flinkbot commented Jul 12, 2021

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@gyfora gyfora left a comment

Choose a reason for hiding this comment

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

Added some minor comments, also please add a test that validates that handlers are actually added and in the correct order according to their priority.

We can use some test/mock handlers that we can easily validate :)

@gaborgsomogyi
Copy link
Contributor Author

As a start resolved the conflict.

@gaborgsomogyi
Copy link
Contributor Author

The tests are not yet testing the netty chain so discovering how is it possible to do that w/o horror complex code...

@gaborgsomogyi
Copy link
Contributor Author

@gyfora added proper tests which are testing the loaded factories behavior but this has increased the PR size significantly. I don't think I can come up w/ more simple tests. If somebody has any idea please share.

@gyfora
Copy link
Contributor

gyfora commented Aug 5, 2021

@flinkbot run azure

@gyfora
Copy link
Contributor

gyfora commented Aug 5, 2021

@flinkbot approve all

@gaborgsomogyi
Copy link
Contributor Author

SQLClientSchemaRegistryITCase failed but it's passing in my local environment so tent to think it's flaky.

@gaborgsomogyi
Copy link
Contributor Author

@flinkbot run azure

@gaborgsomogyi
Copy link
Contributor Author

BlockingShuffleITCase failed which is another flaky test. Filing jira-s to highlight the flakyness of these tests.

@gaborgsomogyi
Copy link
Contributor Author

Filed FLINK-23665 and FLINK-23666.

@asfgit asfgit closed this in 646ff2d Aug 6, 2021
@tillrohrmann
Copy link
Contributor

tillrohrmann commented Aug 10, 2021

@gyfora it would be nice to update the JIRA tickets when merging a PR. Otherwise it is hard to find the paper trail when looking things up. Concretely, this PR seems to reference FLINK-21108 in the commit but the PR title states that it is FLINK-23272. Moreover, FLINK-21108 has been closed as a duplicate more than a month ago.

@gyfora
Copy link
Contributor

gyfora commented Aug 10, 2021

Yea, we updated the ticket but unfortunately wrong ticket was referenced in the commit. We were so preoccupied with the CI problems that we did not notice this. :(

@tillrohrmann
Copy link
Contributor

Np. I think it should be fine if you update the respective Jira tickets accordingly. Thanks!

@gaborgsomogyi gaborgsomogyi deleted the FLINK-23272 branch September 13, 2023 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants