Prepared rngit push protocol extension
This commit is contained in:
parent
c596dab806
commit
9c892dc1a4
1 changed files with 34 additions and 26 deletions
|
|
@ -569,8 +569,10 @@ class ReticulumGitNode():
|
|||
local_ref = data.get("local_ref", "")
|
||||
remote_ref = data.get("remote_ref", "")
|
||||
force = data.get("force", False)
|
||||
bundle_data = data.get("bundle", b"")
|
||||
bundle_data = data.get("bundle", None)
|
||||
operations = data.get("operations", None)
|
||||
|
||||
if bundle_data:
|
||||
if not local_ref or not remote_ref: return self.RES_INVALID_REQ.to_bytes(1, "big") + b"Missing ref specification"
|
||||
try:
|
||||
RNS.log(f"Push {local_ref}:{remote_ref} to {group_name}/{repository_name}", RNS.LOG_DEBUG)
|
||||
|
|
@ -599,6 +601,12 @@ class ReticulumGitNode():
|
|||
RNS.log(f"Error while handling push request for {group_name}/{repository_name}: {e}", RNS.LOG_ERROR)
|
||||
return self.RES_REMOTE_FAIL.to_bytes(1, "big") + str(e).encode("utf-8")
|
||||
|
||||
elif operations:
|
||||
# TODO: Implement
|
||||
pass
|
||||
|
||||
else: self.RES_INVALID_REQ.to_bytes(1, "big") + b"Invalid request data"
|
||||
|
||||
def handle_delete(self, path, data, request_id, remote_identity, requested_at):
|
||||
RNS.log(f"Delete request from remote {remote_identity}", RNS.LOG_DEBUG)
|
||||
if not remote_identity: return self.RES_DISALLOWED.to_bytes(1, "big") + b"Not identified"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue