Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

feat: Sign config files in cli #149

Merged
merged 1 commit into from
May 26, 2020
Merged

feat: Sign config files in cli #149

merged 1 commit into from
May 26, 2020

Conversation

fqutishat
Copy link
Contributor

closes #148

Signed-off-by: Firas Qutishat [email protected]

@cla-bot cla-bot bot added the cla-signed label May 26, 2020
@codecov
Copy link

codecov bot commented May 26, 2020

Codecov Report

Merging #149 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #149   +/-   ##
=======================================
  Coverage   90.48%   90.48%           
=======================================
  Files          17       17           
  Lines         683      683           
=======================================
  Hits          618      618           
  Misses         34       34           
  Partials       31       31           
Impacted Files Coverage Δ
pkg/vdri/trustbloc/models/consortium.go 100.00% <ø> (ø)
pkg/vdri/trustbloc/models/stakeholder.go 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b04386d...578757e. Read the comment docs.

closes trustbloc#148

Signed-off-by: Firas Qutishat <[email protected]>
// PrivateKeyJwk is privatekey jwk
PrivateKeyJwk json.RawMessage `json:"privateKeyJwk,omitempty"`
// PrivateKeyJwk is privatekey jwk file
PrivateKeyJwkPath string `json:"privateKeyJwkPath,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will need some additional followup.

a) the private key might not be in a file.
b) the private key can be protected.
c) might make sense to refactor how keys are associated to stakeholders.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do that as followup

@@ -189,9 +191,16 @@ func getConfig(cmd *cobra.Command) (*config, error) {
}

for _, member := range config.MembersData {
if err := member.jsonWebKey.UnmarshalJSON(member.PrivateKeyJwk); err != nil {
return nil, err
jwkData, err := ioutil.ReadFile(member.PrivateKeyJwkPath) //nolint: gosec
Copy link
Contributor

@troyronda troyronda May 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i hope we are not assuming all keys are available on a single system.

some stakeholders will sign their own copy on their own system.

Copy link
Contributor

@troyronda troyronda May 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. this is somewhat like fabric endorsement - generally ask the stakeholder to sign it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@baha-ai baha-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this patch is not using jws from aries-framework-go?

@fqutishat
Copy link
Contributor Author

@Baha-sk jws aries not supporting multiple signatures

@fqutishat fqutishat merged commit 72082b6 into trustbloc:master May 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sign config files in cli
4 participants