(newVal, claimList, selection)
| 632 | return newInput |
| 633 | |
| 634 | def buildSubclaim(newVal, claimList, selection): |
| 635 | while True: |
| 636 | subList = [0] |
| 637 | s = 0 |
| 638 | for subclaim in newVal: |
| 639 | subNum = s+1 |
| 640 | cprintc("["+str(subNum)+"] "+subclaim+" = "+str(newVal[subclaim]), "white") |
| 641 | s += 1 |
| 642 | subList.append(subclaim) |
| 643 | cprintc("["+str(s+1)+"] *ADD A VALUE*", "white") |
| 644 | cprintc("["+str(s+2)+"] *DELETE A VALUE*", "white") |
| 645 | cprintc("[0] Continue to next step", "white") |
| 646 | try: |
| 647 | subSel = int(input("> ")) |
| 648 | except: |
| 649 | cprintc("Invalid selection", "red") |
| 650 | exit(1) |
| 651 | if subSel<=len(newVal) and subSel>0: |
| 652 | selClaim = subList[subSel] |
| 653 | cprintc("\nCurrent value of "+selClaim+" is: "+str(newVal[selClaim]), "white") |
| 654 | cprintc("Please enter new value and hit ENTER", "white") |
| 655 | newVal[selClaim] = castInput(input("> ")) |
| 656 | cprintc("", "white") |
| 657 | elif subSel == s+1: |
| 658 | cprintc("Please enter new Key and hit ENTER", "white") |
| 659 | newPair = input("> ") |
| 660 | cprintc("Please enter new value for "+newPair+" and hit ENTER", "white") |
| 661 | newVal[newPair] = castInput(input("> ")) |
| 662 | elif subSel == s+2: |
| 663 | cprintc("Please select a Key to DELETE and hit ENTER", "white") |
| 664 | s = 0 |
| 665 | for subclaim in newVal: |
| 666 | subNum = s+1 |
| 667 | cprintc("["+str(subNum)+"] "+subclaim+" = "+str(newVal[subclaim]), "white") |
| 668 | subList.append(subclaim) |
| 669 | s += 1 |
| 670 | try: |
| 671 | selSub = int(input("> ")) |
| 672 | except: |
| 673 | cprintc("Invalid selection", "red") |
| 674 | exit(1) |
| 675 | delSub = subList[selSub] |
| 676 | del newVal[delSub] |
| 677 | elif subSel == 0: |
| 678 | return newVal |
| 679 | |
| 680 | def testKey(key, sig, contents, headDict, quiet): |
| 681 | if headDict["alg"] == "HS256": |
no test coverage detected