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

Use excludeHeaderList instead of blackListHeaders #470

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Chaho12
Copy link
Member

@Chaho12 Chaho12 commented Sep 13, 2024

Description

Use excludeHeaders instead as blacklist isn't recommended in software projects.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text:

* Replace `blackListHeaders` with `excludeHeaders` in the routing rule configuration

@cla-bot cla-bot bot added the cla-signed label Sep 13, 2024
@Chaho12 Chaho12 changed the title Use blacklistHeaders instead of blackListHeaders Use excludeHeaderList instead of blackListHeaders Sep 13, 2024
@mosabua
Copy link
Member

mosabua commented Sep 13, 2024

Agreed .. this is a good change @Chaho12

@@ -84,7 +84,7 @@ static Stream<RulesExternalConfiguration> provideRoutingRuleExternalConfig()
{
RulesExternalConfiguration restConfig = new RulesExternalConfiguration();
restConfig.setUrlPath("http://localhost:8080/api/public/gateway_rules");
restConfig.setBlackListHeaders(new ArrayList<>(List.of("Authorization")));
restConfig.setExcludeHeaders(new ArrayList<>(List.of("Authorization")));
Copy link
Member

Choose a reason for hiding this comment

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

Why are we calling new ArrayList here? Also, why does this test class use @ParameterizedTest just for single case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Why are we calling new ArrayList here?

True a list is sufficent.

Also, why does this test class use @ParameterizedTest just for single case?

what do you mean by a single case?

Copy link
Member

@ebyhr ebyhr Sep 20, 2024

Choose a reason for hiding this comment

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

I meant this method returns a single RulesExternalConfiguration. We shouldn't use @ParameterizedTest in such a case.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not that familiar with Junit 5 so please bear with me.

Well, I wanted to reduce code duplication for configs, as it could be used several times.
And i thought this way of using parameterized test makes it concise to test.

But now that you mention, since this is not complex and returns as a single object,
i could simply create this object in initialize() function, make it where it is @BeforeAll. right?

@ebyhr
Copy link
Member

ebyhr commented Sep 15, 2024

  • Use excludeHeaders instead of blackListHeaders

Thanks for writing a release note entry. I would recommend mentioning where the excludeHeaders is used, e.g. "Use Replace blackListHeaders with excludeHeaders in the routing rule configuration"

Copy link
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

Left come comments which can be addressed in a follow-up PR.

@mosabua
Copy link
Member

mosabua commented Sep 18, 2024

please rebase and address the few small comments @Chaho12 .. then we can merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants