-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-7307]Config in []byte & embed cert in config
This change introduces 'ConfigBytes' and 'ConfigType' in the SDK options to allow loading configs from bytes array as opposed to from a file path. The function InitConfigFromBytes has been introduced in pkg/config/config.go to load the configs from the bytes array argument. Since viper needs to know the type of config being passed to it, 'ConfigType' was added for this purpose. This change also introduces the embedding of certs/keys in the sdk's config directly as opposed to passing file path values in the configs. Embedded certs/keys should always be set under 'pem' fields while files will remain under 'path' fields. Look at test/fixtures/config/config_test_pem.yaml for a sample config with embedded certs/keys. Three new functions were added to the Config interface in api/apiconfig/configprovider.go to support CA server certs/keys. These three functions are 'CAClientKeyPem', 'CAClientCertPem' and 'CAServerCertPems'. The client must decide if they want to use the Pem or the Path version of these functions and must set the config accordingly. The configs will load everything found in the byte array (or config file). If it has both 'pem' and 'path', then both will be loaded. Change-Id: I858623b0aa98e1000ed3c86edb2e136a831933ed Signed-off-by: Baha Shaaban <baha.shaaban@securekey.com>
- Loading branch information
Baha Shaaban
committed
Dec 5, 2017
1 parent
9dad8ae
commit f853354
Showing
12 changed files
with
886 additions
and
25 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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.