[
https://issues.apache.org/jira/browse/SCB-788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16569641#comment-16569641
]
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_r207759377
##########
File path:
handlers/handler-publickey-auth/src/main/java/org/apache/servicecomb/authentication/provider/AccessController.java
##########
@@ -84,15 +89,40 @@ private boolean blackDenied(Microservice microservice) {
private boolean matchFound(Microservice microservice, Map<String,
ConfigurationItem> ruleList) {
boolean matched = false;
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.
- if ("serviceName".equals(item.propertyName)) {
- if (isPatternMatch(microservice.getServiceName(), item.rule)) {
- matched = true;
- break;
+ // we support to configure properties, e.g. serviceName, appId,
environment, alias, version and so on, also support key in properties.
+ Class<? extends Microservice> service = microservice.getClass();
+ for (Method method : service.getDeclaredMethods()) {
Review comment:
Maybe iterate all fields and find the Read Method is more elegant
implementation. See
https://stackoverflow.com/questions/28697484/how-to-invoke-a-getter-method-by-its-name
----------------------------------------------------------------
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:
[email protected]
> 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)