Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable external keys #753

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

Rosuavio
Copy link

No description provided.

@Rosuavio Rosuavio force-pushed the external-keys branch 8 times, most recently from 6c13424 to 5c16914 Compare April 9, 2022 03:06
@Rosuavio Rosuavio force-pushed the external-keys branch 4 times, most recently from 5365888 to 5c67e0e Compare April 27, 2022 02:07
@Rosuavio Rosuavio force-pushed the external-keys branch 7 times, most recently from e92d7fe to e171c7b Compare May 4, 2022 20:19
Rosuavio added 10 commits May 6, 2022 13:40
Moved common singing functions to to Frontend.UI.Dialogs.Signing.Common
Changed pubKeyFromWiget to take a KeyStorage for key suggestions instead
of using uiComboBoxGlobalDatalist to suggest keys directly from the
global key store.
- Enable external PublicKeys to be provided for as keys for capabilites
- When attempting to build the DeploymentSettingsResult, throw and error
  if not every Public Key in the payload matches has a KeyPair in the
  wallet. Other wise use the wallet to provide with KeyPairs for the
  payload.
TODO
Make it so that when a user selects any key for a capability that
is in the list of unrestricted keys the key is removed from the list
of unrestricted keys.

Prevent the user from inputing an unrestricted key if the key is
already used as a key for a capability
The "signingKeys" and "extraKeys" were being treated the same anyways to this unifies it to "publicKeys"
Rosuavio and others added 4 commits May 6, 2022 18:12
Added new tab to deploy contract called "External Signatures".
Users can provide private keys or signatues for every external public key
in the payload.
forM pubKeys $ \pubKey -> do
sig pubKey

let sigs = distributeListOverDyn ddsigs

Choose a reason for hiding this comment

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

let let let

_ <- divClass "group" $ do
uiPreviewItem "Request Key" $ el "code" $ text (Pact.hashToText hash)

let mkKeyTuple (KeyPair pub priv) = (pub, priv)

Choose a reason for hiding this comment

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

let let

cmd <- buildCmdWithPayload payload []
-- Incomplete pattern match should be fine here because all the possible
-- commands are statically generated by Chainweaver.
let Right sd = commandToSigData cmd

Choose a reason for hiding this comment

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

let let

-- commands are statically generated by Chainweaver.
let Right sd = commandToSigData cmd
let hash = Pact.toUntypedHash $ _sigDataHash sd
_ <- divClass "group" $ do

Choose a reason for hiding this comment

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

single line do (not a big deal)

(Set.toList allPublicKeys <> _deploymentSettingsConfig_extraSigners settings)
code' (HM.union jsonData' deploySettingsJsonData) caps

-- TODO: are we worried about multiple private keys with the same pubkey key?

Choose a reason for hiding this comment

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

TODO

uiSenderCapabilities m mCaps = do
let keyPairDropdown ev = uiKeyPairDropdown m $ def & dropdownConfig_setValue .~ fmap Just ev
let
-- TODO: With the uiKeyPairDropdown it the user can select an empty item.

Choose a reason for hiding this comment

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

TODO (is it accounted for?)

pb <- getPostBuild

let deploySettingsJsonData = fromMaybe mempty $ _deploymentSettingsConfig_data settings
jsonData0 = fromMaybe mempty $ hush jData
signingPairs = Map.keys capabilities <> Set.toList signers
publicKeyCapabilities = disregardPrivateKey capabilities
-- TODO: If we have PublicKeys that are not in the keyStore then signingPairs does not contain all the keys in the Paylaod!

Choose a reason for hiding this comment

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

What is the upshot of this TODO?

@Rosuavio Rosuavio force-pushed the external-keys branch 2 times, most recently from aed0586 to 9eaae75 Compare May 10, 2022 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants