Exemplo n.º 1
0
def test_non_steward_cannot_create_trust_anchor(
        nodeSet, trustAnchor, addedTrustAnchor, client1, looper):

    with whitelistextras("UnknownIdentifier"):
        non_permission = Wallet()
        signer = DidSigner()
        non_permission.addIdentifier(signer=signer)

        createNym(looper,
                  non_permission.defaultId,
                  trustAnchor,
                  addedTrustAnchor,
                  role=None,
                  verkey=non_permission.getVerkey())

        op = add_nym_operation(
            seed=b'a secret trust anchor seed......', role=TRUST_ANCHOR)

        submitAndCheckRejects(
            looper=looper,
            client=client1,
            wallet=non_permission,
            op=op,
            identifier=non_permission.defaultId,
            contains="UnauthorizedClientRequest")
Exemplo n.º 2
0
def test_nym_addition_fails_with_empty_verkey(looper, addedTrustAnchor,
                                              trustAnchor, trustAnchorWallet):

    op = add_nym_operation(seed=b'a secret trust anchor seed......')
    op[VERKEY] = ''
    submitAndCheckRejects(looper=looper,
                          client=trustAnchor,
                          wallet=trustAnchorWallet,
                          op=op,
                          identifier=trustAnchorWallet.defaultId,
                          contains='validation error [ClientNYMOperation]: b58 decoded value length 0 should be one of [32]',
                          check_func=checkNacks)
def testNonTrustAnchorCannotCreateAUser(nodeSet, looper, nonTrustAnchor):
    with whitelistextras("UnknownIdentifier"):
        client, wallet = nonTrustAnchor
        useed = b'this is a secret apricot seed...'
        userSigner = SimpleSigner(seed=useed)

        userNym = userSigner.identifier

        op = {TARGET_NYM: userNym, TXN_TYPE: NYM}

        submitAndCheckRejects(looper,
                              client,
                              wallet,
                              op,
                              identifier=wallet.defaultId,
                              contains="UnknownIdentifier")
def testNonStewardCannotCreateATrustAnchor(nodeSet, client1, wallet1, looper):

    with whitelistextras("UnknownIdentifier"):
        seed = b'a secret trust anchor seed......'
        trustAnchorSigner = SimpleSigner(seed=seed)

        trustAnchorNym = trustAnchorSigner.identifier

        op = {TARGET_NYM: trustAnchorNym, TXN_TYPE: NYM, ROLE: TRUST_ANCHOR}

        submitAndCheckRejects(looper=looper,
                              client=client1,
                              wallet=wallet1,
                              op=op,
                              identifier=wallet1.defaultId,
                              contains="UnknownIdentifier")
Exemplo n.º 5
0
def testNonTrustAnchorCannotCreateAUser(nodeSet, looper, nonTrustAnchor):
    with whitelistextras("UnknownIdentifier"):
        client, wallet = nonTrustAnchor
        useed = b'this is a secret apricot seed...'
        userSigner = SimpleSigner(seed=useed)

        userNym = userSigner.identifier

        op = {
            TARGET_NYM: userNym,
            TXN_TYPE: NYM
        }

        submitAndCheckRejects(looper, client, wallet, op,
                              identifier=wallet.defaultId,
                              contains="UnknownIdentifier")
Exemplo n.º 6
0
def testNonStewardCannotCreateATrustAnchor(nodeSet, client1, wallet1, looper):

    with whitelistextras("UnknownIdentifier"):
        seed = b'a secret trust anchor seed......'
        trustAnchorSigner = SimpleSigner(seed=seed)

        trustAnchorNym = trustAnchorSigner.identifier

        op = {
            TARGET_NYM: trustAnchorNym,
            TXN_TYPE: NYM,
            ROLE: TRUST_ANCHOR
        }

        submitAndCheckRejects(looper=looper, client=client1, wallet=wallet1, op=op,
                              identifier=wallet1.defaultId,
                              contains="UnknownIdentifier")
Exemplo n.º 7
0
def test_non_trust_anchor_cannot_create_user(nodeSet, looper, trustAnchor, addedTrustAnchor, client1):
    with whitelistextras("UnknownIdentifier"):
        non_trust_anchor = Wallet()
        signer = DidSigner()
        non_trust_anchor.addIdentifier(signer=signer)

        createNym(looper,
                  non_trust_anchor.defaultId,
                  trustAnchor,
                  addedTrustAnchor,
                  role=None,
                  verkey=non_trust_anchor.getVerkey())

        op = add_nym_operation(seed=b'a secret trust anchor seed......')

        submitAndCheckRejects(looper=looper, client=client1, wallet=non_trust_anchor, op=op,
                              identifier=non_trust_anchor.defaultId,
                              contains="UnauthorizedClientRequest")