Skip to content

Commit

Permalink
[FAB-9325] make CA matcher section consistent
Browse files Browse the repository at this point in the history
Change-Id: I44c3518421a5cc4e400c3d6df4f6b7b441b9863f
Signed-off-by: Troy Ronda <[email protected]>
  • Loading branch information
troyronda committed Apr 4, 2018
1 parent 449a24d commit 582c2fc
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/core/config/testdata/config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ entityMatchers:
sslTargetOverrideUrlSubstitutionExp: $1.example.$2
mappedHost: local.orderer.example.com

certificateAuthorities:
certificateAuthority:
- pattern: (\w+).org1.example.(\w+)
urlSubstitutionExp:
mappedHost: local.ca.org1.example.com
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/config/testdata/config_test_embedded_pems.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ entityMatchers:
sslTargetOverrideUrlSubstitutionExp: $1.example.$2
mappedHost: local.orderer.example.com

certificateAuthorities:
certificateAuthority:
- pattern: (\w+)-org1
urlSubstitutionExp:
mappedHost: local.ca-org1
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/config/testdata/config_test_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ entityMatchers:
sslTargetOverrideUrlSubstitutionExp: $1.example.$2
mappedHost: local.orderer.example.com

certificateAuthorities:
certificateAuthority:
- pattern: (\w+).org1.example.(\w+)
urlSubstitutionExp:
mappedHost: local.ca.org1.example.com
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/config/testdata/template/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ entityMatchers:
#sslTargetOverrideUrlSubstitutionExp: $1.org1.example.$2
#mappedHost: orderer.example.com

#certificateAuthorities:
#certificateAuthority:
#- pattern: (\w+).org1.example.(\w+)
#urlSubstitutionExp:
#mappedHost: ca.org1.example.com
Expand Down
4 changes: 2 additions & 2 deletions pkg/fab/endpointconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,8 @@ func (c *EndpointConfig) compileMatchers() error {
}
}
}
if networkConfig.EntityMatchers["certificateauthorities"] != nil {
certMatchersConfig := networkConfig.EntityMatchers["certificateauthorities"]
if networkConfig.EntityMatchers["certificateauthority"] != nil {
certMatchersConfig := networkConfig.EntityMatchers["certificateauthority"]
for i := 0; i < len(certMatchersConfig); i++ {
if certMatchersConfig[i].Pattern != "" {
c.caMatchers[i], err = regexp.Compile(certMatchersConfig[i].Pattern)
Expand Down
2 changes: 1 addition & 1 deletion pkg/msp/identityconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (c *IdentityConfig) tryMatchingCAConfig(caName string) (*msp.CAConfig, stri
v := caMatchers[k]
if v.MatchString(caName) {
// get the matching Config from the index number
certAuthorityMatchConfig := networkConfig.EntityMatchers["certificateauthorities"][k]
certAuthorityMatchConfig := networkConfig.EntityMatchers["certificateauthority"][k]
//Get the certAuthorityMatchConfig from mapped host
caConfig, ok := networkConfig.CertificateAuthorities[strings.ToLower(certAuthorityMatchConfig.MappedHost)]
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/config/config_revoke_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ entityMatchers:
sslTargetOverrideUrlSubstitutionExp: $1.example.$2
mappedHost: local.orderer.example.com

certificateAuthorities:
certificateAuthority:
- pattern: (\w+).org1.example.(\w+)
urlSubstitutionExp:
mappedHost: local.ca.org1.example.com
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/config/config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ entityMatchers:
sslTargetOverrideUrlSubstitutionExp: $1.example.$2
mappedHost: local.orderer.example.com

certificateAuthorities:
certificateAuthority:
- pattern: (\w+).org1.example.(\w+)
urlSubstitutionExp:
mappedHost: local.ca.org1.example.com
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/config/config_test_local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ entityMatchers:
sslTargetOverrideUrlSubstitutionExp: $1.example.$2
mappedHost: local.orderer.example.com

certificateAuthorities:
certificateAuthority:
- pattern: (\w+).org1.example.(\w+)
urlSubstitutionExp: https://localhost:7054
mappedHost: local.ca.org1.example.com
Expand Down

0 comments on commit 582c2fc

Please sign in to comment.