Skip to content

Conversation

@michaeljmarshall
Copy link
Member

Relates to: #19455 #19830

Motivation

When I added the requirement for the proxy to use a role in the proxyRoles set, I didn't add a test that checked the negative case. This new test was first added in #19830 with one small difference. The goal of this test is to ensure that authorization of the client role and the original role is handled correctly.

Modifications

  • Add new test class named AuthorizationServiceTest. We use pass.proxy and fail.proxy as proxy roles to simulate cases where the proxy's role passes and fails authorization, which is always possible.
  • Add new mock authorization provider named MockAuthorizationProvider. The logic is to let any role that starts with pass be considered authorized.

Verifying this change

This is a new test. It simply verifies the existing behavior to prevent future regressions.

Documentation

  • doc-not-needed

Matching PR in forked repository

PR in forked repository: Skipping forked test since the new tests pass locally and there are no other modifications.

Copy link
Contributor

@dlg99 dlg99 left a comment

Choose a reason for hiding this comment

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

lgtm

@michaeljmarshall michaeljmarshall merged commit c6de57c into apache:master Mar 20, 2023
@michaeljmarshall michaeljmarshall deleted the add-authz-service-test branch March 20, 2023 19:07
michaeljmarshall added a commit to datastax/pulsar that referenced this pull request Apr 13, 2023
…ior (apache#19845)

Relates to: apache#19455 apache#19830

### Motivation

When I added the requirement for the proxy to use a role in the `proxyRoles` set, I didn't add a test that checked the negative case. This new test was first added in apache#19830 with one small difference. The goal of this test is to ensure that authorization of the client role and the original role is handled correctly.

### Modifications

* Add new test class named `AuthorizationServiceTest`. We use `pass.proxy` and `fail.proxy` as proxy roles to simulate cases where the proxy's role passes and fails authorization, which is always possible.
* Add new mock authorization provider named `MockAuthorizationProvider`. The logic is to let any role that starts with `pass` be considered authorized.

### Verifying this change

This is a new test. It simply verifies the existing behavior to prevent future regressions.

### Documentation

- [x] `doc-not-needed`

### Matching PR in forked repository

PR in forked repository: Skipping forked test since the new tests pass locally and there are no other modifications.

(cherry picked from commit c6de57c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants