Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-2487] Restrict channelIDs to CouchDB/Kafka
The current channel ID checks are to ensure that the IDs comply with the Kafka topic naming restrictions. However, it is possible that two different channel IDs such as TestChain and testchain would both map to the same couchdb name, causing an intersection and failure. This CR changes the logic to test for the intersection of the restrictions on CouchDB and Kafka. In particular, the logic now requires that Channel IDs: 1. Contain only lower case ASCII alphanumerics, dots '.' and dashes '-' 2. Are shorter than 250 characters. 3. Start with a letter Note that this is not a true intersection, because the ledger must still map '.' to '_' for CouchDB, but this mapping is bijective so is safe and free from collisions. Because the configuration key name checking was leveraging this same code path, the existing function was duplicated, to leave the same logic checks in place for the config. Although the code diff is relatively high, this is largely due to the copying and renaming. Change-Id: Ie957cf9b8a075233bfcc5d3748e1a91e795ff067 Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
- Loading branch information
Jason Yellick
committed
Jun 13, 2017
1 parent
7253ae5
commit 94d7e9a
Showing
7 changed files
with
135 additions
and
58 deletions.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.