-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-11063] entity matchers refactoring
- unlike older versions, entity matchers will be taken into account even if exact match is found in config - ca entity matcher to take place before exact match Change-Id: Ibffe2b29d890e94da6b715cf03bc4ea0fd689851 Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
- Loading branch information
1 parent
b5453c1
commit 02ba89a
Showing
10 changed files
with
621 additions
and
263 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
pkg/core/config/testdata/matcher-samples/matchers_sample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# | ||
# The network connection profile provides client applications the information about the target | ||
# blockchain network that are necessary for the applications to interact with it. These are all | ||
# knowledge that must be acquired from out-of-band sources. This file provides such a source. | ||
# | ||
|
||
# EntityMatchers enable substitution of network hostnames with static configurations | ||
# so that properties can be mapped. Regex can be used for this purpose | ||
# UrlSubstitutionExp can be empty which means the same network hostname will be used | ||
# UrlSubstitutionExp can be given same as mapped peer url, so that mapped peer url can be used | ||
# UrlSubstitutionExp can have golang regex matchers like $1.local.example.$2:$3 for pattern | ||
# like peer0.org1.example.com:1234 which converts peer0.org1.example.com to peer0.org1.local.example.com:1234 | ||
# EventUrlSubstitutionExp and sslTargetOverrideUrlSubstitutionExp follow in the same lines as | ||
# SubstitutionExp for the fields eventUrl and gprcOptions.ssl-target-name-override respectively | ||
# In any case mappedHost's config will be used, so mapped host cannot be empty, if entityMatchers are used | ||
entityMatchers: | ||
peer: | ||
- pattern: (\w+).org1.example.(\w+) | ||
urlSubstitutionExp: peer0.org1.example.com:8888 | ||
eventUrlSubstitutionExp: peer0.org1.example.com:9999 | ||
sslTargetOverrideUrlSubstitutionExp: peer0.org1.override.com | ||
mappedHost: peer0.org1.example.com | ||
|
||
orderer: | ||
- pattern: (\w+).example.(\w+) | ||
urlSubstitutionExp: orderer.example.com:8888 | ||
sslTargetOverrideUrlSubstitutionExp: orderer.override.com | ||
mappedHost: orderer.example.com | ||
|
||
certificateAuthority: | ||
- pattern: (\w+).org1.example.(\w+) | ||
urlSubstitutionExp: https://ca.org1.example.com:8888 | ||
mappedHost: ca.org1.example.com | ||
|
||
channel: | ||
- pattern: ^(test)(\w*)(channel)$ | ||
mappedName: ch1 |
31 changes: 31 additions & 0 deletions
31
pkg/core/config/testdata/matcher-samples/matchers_sample2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# | ||
# Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# | ||
# The network connection profile provides client applications the information about the target | ||
# blockchain network that are necessary for the applications to interact with it. These are all | ||
# knowledge that must be acquired from out-of-band sources. This file provides such a source. | ||
# | ||
|
||
# EntityMatchers enable substitution of network hostnames with static configurations | ||
# so that properties can be mapped. Regex can be used for this purpose | ||
# UrlSubstitutionExp can be empty which means the same network hostname will be used | ||
# UrlSubstitutionExp can be given same as mapped peer url, so that mapped peer url can be used | ||
# UrlSubstitutionExp can have golang regex matchers like $1.local.example.$2:$3 for pattern | ||
# like peer0.org1.example.com:1234 which converts peer0.org1.example.com to peer0.org1.local.example.com:1234 | ||
# EventUrlSubstitutionExp and sslTargetOverrideUrlSubstitutionExp follow in the same lines as | ||
# SubstitutionExp for the fields eventUrl and gprcOptions.ssl-target-name-override respectively | ||
# In any case mappedHost's config will be used, so mapped host cannot be empty, if entityMatchers are used | ||
entityMatchers: | ||
peer: | ||
- pattern: (\w+).org1.example.(\w+) | ||
urlSubstitutionExp: peer0.org1.example.com:8888 | ||
mappedHost: peer0.org1.example.com | ||
|
||
orderer: | ||
- pattern: (\w+).example.(\w+) | ||
urlSubstitutionExp: orderer.example.com:8888 | ||
mappedHost: orderer.example.com | ||
|
38 changes: 38 additions & 0 deletions
38
pkg/core/config/testdata/matcher-samples/matchers_sample3.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# | ||
# The network connection profile provides client applications the information about the target | ||
# blockchain network that are necessary for the applications to interact with it. These are all | ||
# knowledge that must be acquired from out-of-band sources. This file provides such a source. | ||
# | ||
|
||
# EntityMatchers enable substitution of network hostnames with static configurations | ||
# so that properties can be mapped. Regex can be used for this purpose | ||
# UrlSubstitutionExp can be empty which means the same network hostname will be used | ||
# UrlSubstitutionExp can be given same as mapped peer url, so that mapped peer url can be used | ||
# UrlSubstitutionExp can have golang regex matchers like $1.local.example.$2:$3 for pattern | ||
# like peer0.org1.example.com:1234 which converts peer0.org1.example.com to peer0.org1.local.example.com:1234 | ||
# EventUrlSubstitutionExp and sslTargetOverrideUrlSubstitutionExp follow in the same lines as | ||
# SubstitutionExp for the fields eventUrl and gprcOptions.ssl-target-name-override respectively | ||
# In any case mappedHost's config will be used, so mapped host cannot be empty, if entityMatchers are used | ||
entityMatchers: | ||
peer: | ||
- pattern: (\w+).exampleX.(\w+):(\d+) | ||
urlSubstitutionExp: peer0.org1.example.com:8888 | ||
eventUrlSubstitutionExp: peer0.org1.example.com:9999 | ||
sslTargetOverrideUrlSubstitutionExp: peer0.org1.override.com | ||
mappedHost: peer0.org1.example.com | ||
|
||
orderer: | ||
- pattern: (\w+).exampleX.(\w+):(\d+) | ||
urlSubstitutionExp: orderer.example.com:8888 | ||
sslTargetOverrideUrlSubstitutionExp: orderer.override.com | ||
mappedHost: orderer.example.com | ||
|
||
certificateAuthority: | ||
- pattern: (\w+).org1.exampleX.(\w+) | ||
urlSubstitutionExp: https://ca.org1.example.com:8888 | ||
mappedHost: ca.org1.example.com |
30 changes: 30 additions & 0 deletions
30
pkg/core/config/testdata/matcher-samples/matchers_sample4.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# | ||
# The network connection profile provides client applications the information about the target | ||
# blockchain network that are necessary for the applications to interact with it. These are all | ||
# knowledge that must be acquired from out-of-band sources. This file provides such a source. | ||
# | ||
|
||
# EntityMatchers enable substitution of network hostnames with static configurations | ||
# so that properties can be mapped. Regex can be used for this purpose | ||
# UrlSubstitutionExp can be empty which means the same network hostname will be used | ||
# UrlSubstitutionExp can be given same as mapped peer url, so that mapped peer url can be used | ||
# UrlSubstitutionExp can have golang regex matchers like $1.local.example.$2:$3 for pattern | ||
# like peer0.org1.example.com:1234 which converts peer0.org1.example.com to peer0.org1.local.example.com:1234 | ||
# EventUrlSubstitutionExp and sslTargetOverrideUrlSubstitutionExp follow in the same lines as | ||
# SubstitutionExp for the fields eventUrl and gprcOptions.ssl-target-name-override respectively | ||
# In any case mappedHost's config will be used, so mapped host cannot be empty, if entityMatchers are used | ||
entityMatchers: | ||
peer: | ||
- pattern: (\w+).org1.example.(\w+) | ||
sslTargetOverrideUrlSubstitutionExp: peer0.org1.override.com | ||
mappedHost: peer0.org1.example.com | ||
|
||
orderer: | ||
- pattern: (\w+).example.(\w+) | ||
sslTargetOverrideUrlSubstitutionExp: orderer.override.com | ||
mappedHost: orderer.example.com |
Oops, something went wrong.