Skip to content

Commit

Permalink
Last bit of clean up for V1.2.0 rc4 (#890)
Browse files Browse the repository at this point in the history
* Fix delegation "catchup" logic for witnesses during delegated rotation.

Fix witness authenticate to handle service endpoint urls with a trailing slash.

Signed-off-by: pfeairheller <[email protected]>

* Minor fix to parsing for local delegators and 3 typo fixes

Signed-off-by: pfeairheller <[email protected]>

---------

Signed-off-by: pfeairheller <[email protected]>
  • Loading branch information
pfeairheller authored Nov 18, 2024
1 parent 68d862c commit 9b5323e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/keri/app/agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def receipt(self, pre, sn=None, auths=None):
ser = serdering.SerderKERI(raw=msg)

# If we are a rotation event, may need to catch new witnesses up to current key state
if ser.ked['t'] in (coring.Ilks.rot,):
if ser.ked['t'] in (coring.Ilks.rot, coring.Ilks.drt,):
adds = ser.ked["ba"]
for wit in adds:
yield from self.catchup(ser.pre, wit)
Expand Down Expand Up @@ -351,7 +351,7 @@ def receiptDo(self, tymth=None, tock=0.0):
witer.msgs.append(bytearray(dmsg))

if ser.ked['t'] in (coring.Ilks.icp, coring.Ilks.dip) or \
"ba" in ser.ked and wit in ser.ked["ba"]: # Newly added witness, must send full KEL to catch up
"ba" in ser.ked and wit in ser.ked["ba"]: # Newly added witness, must catch up
for fmsg in hab.db.clonePreIter(pre=pre):
witer.msgs.append(bytearray(fmsg))

Expand Down
2 changes: 1 addition & 1 deletion src/keri/app/cli/commands/interact.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def interactDo(self, tymth, tock=0.0, **opts):
for wit in hab.kever.wits:
if wit in auths:
continue
code = input(f"Entire code for {wit}: ")
code = input(f"Enter code for {wit}: ")
auths[wit] = f"{code}#{helping.nowIso8601()}"

if self.endpoint:
Expand Down
2 changes: 1 addition & 1 deletion src/keri/app/cli/commands/rotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def rotateDo(self, tymth, tock=0.0):
for wit in hab.kever.wits:
if wit in auths:
continue
code = input(f"Entire code for {wit}: ")
code = input(f"Enter code for {wit}: ")
auths[wit] = f"{code}#{helping.nowIso8601()}"

if hab.kever.delpre:
Expand Down
4 changes: 2 additions & 2 deletions src/keri/app/cli/commands/witness/authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def authDo(self, tymth, tock=0.0):

client.request(
method="POST",
path=f"{client.requester.path}/aids",
path=f"{client.requester.path.rstrip('/')}/aids",
headers=headers,
fargs=fargs
)
Expand All @@ -131,7 +131,7 @@ def authDo(self, tymth, tock=0.0):
totp = data["totp"]
m = coring.Matter(qb64=totp) # refactor this to use cipher
d = coring.Matter(qb64=self.hab.decrypt(ser=m.raw))
otpurl = f"otpauth://totp/KERIpy:{self.witness}?secret={d.raw.decode('utf-8')}&issuer=KERIpy"
otpurl = f"otpauth://totp/KERI:{self.witness}?secret={d.raw.decode('utf-8')}&issuer=KERI"

if not self.urlOnly:
qr = qrcode.QRCode()
Expand Down
4 changes: 2 additions & 2 deletions src/keri/core/eventing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2379,9 +2379,9 @@ def valSigsWigsDel(self, serder, sigers, verfers, tholder,
# seal in this case can't be malicious since sourced locally.
# Doesn't get to here until fully signed and witnessed.

if self.locallyDelegated(delpre): # local delegator
if self.locallyDelegated(delpre) and not self.locallyOwned(): # local delegator
# must be local if locallyDelegated or caught above as misfit
if delseqner is None or delsaider is None: # missing delegation seal
if delseqner is None or delsaider is None: # missing delegation seal
# so escrow delegable. So local delegator can approve OOB.
# and create delegator event with valid event seal of this
# delegated event and then reprocess event with attached source
Expand Down

0 comments on commit 9b5323e

Please sign in to comment.