-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[refactor][fn] Use AuthorizationServer more in Function Worker API #19975
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
[refactor][fn] Use AuthorizationServer more in Function Worker API #19975
Conversation
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/Authentication.java
Show resolved
Hide resolved
...r-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/WorkerImpl.java
Outdated
Show resolved
Hide resolved
...functions/worker/src/main/java/org/apache/pulsar/functions/worker/service/api/Component.java
Show resolved
Hide resolved
This reverts commit e6b451c.
|
@lhotari - thanks for your review. I've refactored things a bit more. Would you take another look? Thanks! |
…19975) The current function worker interfaces introduced by #8560 are hard to extend. It is better to pass an object that we can add fields to as needed. * Introduce a new `Authentication` class to wrap all of the relevant authentication "data". This class is somewhat unfortunate in that we already have many classes that hold authentication information. However, my goal with this class is to wrap all of the relevant auth info. This class is only currently used in the Function Worker API, but I plan to add it to the rest of the Admin HTTP endpoints. * Deprecate all of the methods that are no longer needed. Add a default implementation to call the new methods that supersede those methods. * Add `proxyRoles` setting to function worker. There are tests to cover the changes. This PR changes several interfaces in completely backwards compatible ways. It's possible we'll want to improve the abstraction for the `Authentication` class by making it an interface. - [x] `doc` This change has Javadoc updates to document the changes. PR in forked repository: michaeljmarshall#37 (cherry picked from commit 55acbe6)
…pache#19975) The current function worker interfaces introduced by apache#8560 are hard to extend. It is better to pass an object that we can add fields to as needed. * Introduce a new `Authentication` class to wrap all of the relevant authentication "data". This class is somewhat unfortunate in that we already have many classes that hold authentication information. However, my goal with this class is to wrap all of the relevant auth info. This class is only currently used in the Function Worker API, but I plan to add it to the rest of the Admin HTTP endpoints. * Deprecate all of the methods that are no longer needed. Add a default implementation to call the new methods that supersede those methods. * Add `proxyRoles` setting to function worker. There are tests to cover the changes. This PR changes several interfaces in completely backwards compatible ways. It's possible we'll want to improve the abstraction for the `Authentication` class by making it an interface. - [x] `doc` This change has Javadoc updates to document the changes. PR in forked repository: #37 (cherry picked from commit 55acbe6) (cherry picked from commit 54c97ad)
…pache#19975) The current function worker interfaces introduced by apache#8560 are hard to extend. It is better to pass an object that we can add fields to as needed. * Introduce a new `Authentication` class to wrap all of the relevant authentication "data". This class is somewhat unfortunate in that we already have many classes that hold authentication information. However, my goal with this class is to wrap all of the relevant auth info. This class is only currently used in the Function Worker API, but I plan to add it to the rest of the Admin HTTP endpoints. * Deprecate all of the methods that are no longer needed. Add a default implementation to call the new methods that supersede those methods. * Add `proxyRoles` setting to function worker. There are tests to cover the changes. This PR changes several interfaces in completely backwards compatible ways. It's possible we'll want to improve the abstraction for the `Authentication` class by making it an interface. - [x] `doc` This change has Javadoc updates to document the changes. PR in forked repository: #37 (cherry picked from commit 55acbe6) (cherry picked from commit 54c97ad) (cherry picked from commit cf40926)
…0046) ### Motivation In #19975, we introduced a wrapper for all authentication parameters. This PR adds that wrapper to the Rest Producer. ### Modifications * Use `AuthenticationParameters` to simplify parameter management in Rest Producer. * Add method to the `AuthorizationService` that takes the `AuthenticationParameters`. * Update annotations on Rest Producer to indicate that a 401 is an expected response. ### Verifying this change This change is covered by the `TopicsAuthTest`. ### Documentation - [x] `doc-not-needed` This is an internal change that does not need to be documented. ### Matching PR in forked repository PR in forked repository: skipping PR since the relevant tests pass locally
…0046) In #19975, we introduced a wrapper for all authentication parameters. This PR adds that wrapper to the Rest Producer. * Use `AuthenticationParameters` to simplify parameter management in Rest Producer. * Add method to the `AuthorizationService` that takes the `AuthenticationParameters`. * Update annotations on Rest Producer to indicate that a 401 is an expected response. This change is covered by the `TopicsAuthTest`. - [x] `doc-not-needed` This is an internal change that does not need to be documented. PR in forked repository: skipping PR since the relevant tests pass locally (cherry picked from commit 7990948)
…0046) In #19975, we introduced a wrapper for all authentication parameters. This PR adds that wrapper to the Rest Producer. * Use `AuthenticationParameters` to simplify parameter management in Rest Producer. * Add method to the `AuthorizationService` that takes the `AuthenticationParameters`. * Update annotations on Rest Producer to indicate that a 401 is an expected response. This change is covered by the `TopicsAuthTest`. - [x] `doc-not-needed` This is an internal change that does not need to be documented. PR in forked repository: skipping PR since the relevant tests pass locally (cherry picked from commit 7990948) (cherry picked from commit 02b27e8)
…0046) In #19975, we introduced a wrapper for all authentication parameters. This PR adds that wrapper to the Rest Producer. * Use `AuthenticationParameters` to simplify parameter management in Rest Producer. * Add method to the `AuthorizationService` that takes the `AuthenticationParameters`. * Update annotations on Rest Producer to indicate that a 401 is an expected response. This change is covered by the `TopicsAuthTest`. - [x] `doc-not-needed` This is an internal change that does not need to be documented. PR in forked repository: skipping PR since the relevant tests pass locally (cherry picked from commit 7990948) (cherry picked from commit 02b27e8)
…ache#20046) ### Motivation In apache#19975, we introduced a wrapper for all authentication parameters. This PR adds that wrapper to the Rest Producer. ### Modifications * Use `AuthenticationParameters` to simplify parameter management in Rest Producer. * Add method to the `AuthorizationService` that takes the `AuthenticationParameters`. * Update annotations on Rest Producer to indicate that a 401 is an expected response. ### Verifying this change This change is covered by the `TopicsAuthTest`. ### Documentation - [x] `doc-not-needed` This is an internal change that does not need to be documented. ### Matching PR in forked repository PR in forked repository: skipping PR since the relevant tests pass locally
…pache#19975) The current function worker interfaces introduced by apache#8560 are hard to extend. It is better to pass an object that we can add fields to as needed. * Introduce a new `Authentication` class to wrap all of the relevant authentication "data". This class is somewhat unfortunate in that we already have many classes that hold authentication information. However, my goal with this class is to wrap all of the relevant auth info. This class is only currently used in the Function Worker API, but I plan to add it to the rest of the Admin HTTP endpoints. * Deprecate all of the methods that are no longer needed. Add a default implementation to call the new methods that supersede those methods. * Add `proxyRoles` setting to function worker. There are tests to cover the changes. This PR changes several interfaces in completely backwards compatible ways. It's possible we'll want to improve the abstraction for the `Authentication` class by making it an interface. - [x] `doc` This change has Javadoc updates to document the changes. PR in forked repository: michaeljmarshall#37 (cherry picked from commit 55acbe6)
…ache#20046) In apache#19975, we introduced a wrapper for all authentication parameters. This PR adds that wrapper to the Rest Producer. * Use `AuthenticationParameters` to simplify parameter management in Rest Producer. * Add method to the `AuthorizationService` that takes the `AuthenticationParameters`. * Update annotations on Rest Producer to indicate that a 401 is an expected response. This change is covered by the `TopicsAuthTest`. - [x] `doc-not-needed` This is an internal change that does not need to be documented. PR in forked repository: skipping PR since the relevant tests pass locally (cherry picked from commit 7990948) (cherry picked from commit 02b27e8)
|
@michaeljmarshall I noticed that this PR changed the interface of the functions worker's API, such changes should be avoided to cherry-pick into the historical branches. |
|
This is not strictly a public API change, it is more like fixing a security issue. |
|
@freeznet I have forward the email under the private mailing list to your apache email, so that you can get all the context about the changes. |
|
This actually made it into 2.10.4. |
|
As discussed on the mailing list https://lists.apache.org/thread/w4jzk27qhtosgsz7l9bmhf1t7o9mxjhp, there is no plan to release 2.9.6, so I am going to remove the release/2.9.6 label |
Motivation
The current function worker interfaces introduced by #8560 are hard to extend. It is better to pass an object that we can add fields to as needed.
Modifications
AuthenticationParametersclass to wrap all of the relevant authentication "data". This class is somewhat unfortunate in that we already have many classes that hold authentication information. However, my goal with this class is to wrap all of the relevant auth info. This class is only currently used in the Function Worker API, but I plan to add it to the rest of the Admin HTTP endpoints.proxyRolessetting to function worker.Verifying this change
There are tests to cover the changes.
Documentation
docThis change has Javadoc updates to document the changes.
Matching PR in forked repository
PR in forked repository: michaeljmarshall#37