Skip to content

Commit fb02eca

Browse files
committed
changed koi-net.node field name to hash reflecting usage in secure koi-net protocol
1 parent 9422f8c commit fb02eca

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "rid-lib"
7-
version = "3.2.6"
7+
version = "3.2.7"
88
description = "Implementation of Reference Identifiers (RIDs) protocol in Python"
99
authors = [
1010
{name = "Luke Miller", email = "[email protected]"}

src/rid_lib/types/koi_net_node.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
from uuid import uuid4
21
from rid_lib.core import ORN
32

43

54
class KoiNetNode(ORN):
65
namespace = "koi-net.node"
76

8-
def __init__(self, name, uuid):
9-
self.name = name
10-
self.uuid = uuid
11-
12-
@classmethod
13-
def generate(cls, name):
14-
return cls(name, uuid4())
7+
def __init__(self, name: str, hash: str):
8+
self.name: str = name
9+
self.hash: str = hash
1510

1611
@property
1712
def reference(self):
18-
return f"{self.name}+{self.uuid}"
13+
return f"{self.name}+{self.hash}"
1914

2015
@classmethod
2116
def from_reference(cls, reference):
2217
components = reference.split("+")
2318
if len(components) == 2:
2419
return cls(*components)
2520
else:
26-
raise ValueError("KOI-net Node reference must contain two '+'-separated components: '<name>+<uuid>'")
21+
raise ValueError("KOI-net Node reference must contain two '+'-separated components: '<name>+<hash>'")

0 commit comments

Comments
 (0)