[ https://issues.apache.org/jira/browse/SCB-788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16561878#comment-16561878 ]
ASF GitHub Bot commented on SCB-788: ------------------------------------ liubao68 commented on a change in pull request #846: [SCB-788] public key black/white add feature: choose server by version URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/846#discussion_r206118166 ########## File path: handlers/handler-publickey-auth/src/main/java/org/apache/servicecomb/authentication/provider/AccessController.java ########## @@ -86,18 +86,28 @@ private boolean matchFound(Microservice microservice, Map<String, ConfigurationI for (ConfigurationItem item : ruleList.values()) { // TODO: Currently we only support property, not support tags. And we will support tags later. if (ConfigurationItem.CATEGORY_PROPERTY.equals(item.category)) { - // TODO: Currently we only support to configure serviceName. And we will support others later. + // TODO: Currently we only support to configure serviceName & version. And we will support others later. if ("serviceName".equals(item.propertyName)) { if (isPatternMatch(microservice.getServiceName(), item.rule)) { matched = true; break; } } + if ("version".equals(item.propertyName)) { Review comment: Maybe you can write this code using reflection to find all Microservice String getters and match in a general way to avoid many if statements. So that we can support all properties, e.g. serviceName, appId, environment, alias and so on. And when getters not exists, we may search properties of Microservice(properties is a map) for the key. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > public key black/white add feature: choose server by version > ------------------------------------------------------------ > > Key: SCB-788 > URL: https://issues.apache.org/jira/browse/SCB-788 > Project: Apache ServiceComb > Issue Type: New Feature > Components: Java-Chassis > Reporter: WeiChao > Assignee: WeiChao > Priority: Major > Fix For: java-chassis-1.1.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)