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

add wildcard support for ServiceSkipDomains #2267

Conversation

ricordanza
Copy link
Contributor

description

We have enabled the use of wildcards in the ServiceSkipDomains.

reference

I implemented it based on the reference from #2202.

…omains

Signed-off-by: Toshiaki Aoike <taoike@yahoo-corp.jp>
@ricordanza ricordanza force-pushed the add-domain-prefix-check-for-service-skip-domain branch from ba012e8 to 124c3d2 Compare August 7, 2023 00:59
if (domainName.startsWith(serviceSkipDomainPrefix)) {
return;
}
} else if (validateServiceSkipDomains.contains(domainName)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong check here to verify against the whole list every time. The correct line would be

} else if (skipDomain.equals(domainName)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I've fixed it.

…list.

Signed-off-by: Toshiaki Aoike <taoike@yahoo-corp.jp>
@@ -3526,8 +3526,19 @@ void validateInstanceServiceIdentity(DomainData domainData, final String service
// need to check anything

final String domainName = domainData.getName();
if (validateServiceSkipDomains.contains(domainName)) {
return;
if (domainName != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

one more comment - looking at the server code, this can never be null so we should remove It, otherwise it's missing unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you.
Since it has been determined that domainName will not be null, I have removed the branching.
Additionally, I've made modifications to the test code to specify the domainName.

…ching and modified the test code to specify the domainName.

Signed-off-by: Toshiaki Aoike <taoike@yahoo-corp.jp>
@havetisyan havetisyan merged commit a012143 into AthenZ:master Aug 8, 2023
1 check passed
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.

2 participants