mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
rebuild protobufs adding ECC_P256 to KeyType
This commit is contained in:
@ -15,11 +15,11 @@ from .pb import crypto_pb2 as protobuf
|
|||||||
|
|
||||||
@unique
|
@unique
|
||||||
class KeyType(Enum):
|
class KeyType(Enum):
|
||||||
RSA = 0
|
RSA = protobuf.KeyType.RSA
|
||||||
Ed25519 = 1
|
Ed25519 = protobuf.KeyType.Ed25519
|
||||||
Secp256k1 = 2
|
Secp256k1 = protobuf.KeyType.Secp256k1
|
||||||
ECDSA = 3
|
ECDSA = protobuf.KeyType.ECDSA
|
||||||
ECC_P256 = 4
|
ECC_P256 = protobuf.KeyType.ECC_P256
|
||||||
|
|
||||||
|
|
||||||
class Key(ABC):
|
class Key(ABC):
|
||||||
@ -56,8 +56,7 @@ class PublicKey(Key):
|
|||||||
"""Return the protobuf representation of this ``Key``."""
|
"""Return the protobuf representation of this ``Key``."""
|
||||||
key_type = self.get_type().value
|
key_type = self.get_type().value
|
||||||
data = self.to_bytes()
|
data = self.to_bytes()
|
||||||
# type ignored - TODO add ECD_P256 to KeyType
|
protobuf_key = protobuf.PublicKey(key_type=key_type, data=data)
|
||||||
protobuf_key = protobuf.PublicKey(key_type=key_type, data=data) # type: ignore
|
|
||||||
return protobuf_key
|
return protobuf_key
|
||||||
|
|
||||||
def serialize(self) -> bytes:
|
def serialize(self) -> bytes:
|
||||||
@ -84,8 +83,7 @@ class PrivateKey(Key):
|
|||||||
"""Return the protobuf representation of this ``Key``."""
|
"""Return the protobuf representation of this ``Key``."""
|
||||||
key_type = self.get_type().value
|
key_type = self.get_type().value
|
||||||
data = self.to_bytes()
|
data = self.to_bytes()
|
||||||
# type ignored - TODO add ECD_P256 to KeyType
|
protobuf_key = protobuf.PrivateKey(key_type=key_type, data=data)
|
||||||
protobuf_key = protobuf.PrivateKey(key_type=key_type, data=data) # type: ignore
|
|
||||||
return protobuf_key
|
return protobuf_key
|
||||||
|
|
||||||
def serialize(self) -> bytes:
|
def serialize(self) -> bytes:
|
||||||
|
|||||||
@ -7,6 +7,7 @@ enum KeyType {
|
|||||||
Ed25519 = 1;
|
Ed25519 = 1;
|
||||||
Secp256k1 = 2;
|
Secp256k1 = 2;
|
||||||
ECDSA = 3;
|
ECDSA = 3;
|
||||||
|
ECC_P256 = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PublicKey {
|
message PublicKey {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dlibp2p/crypto/pb/crypto.proto\x12\tcrypto.pb\"?\n\tPublicKey\x12$\n\x08key_type\x18\x01 \x02(\x0e\x32\x12.crypto.pb.KeyType\x12\x0c\n\x04\x64\x61ta\x18\x02 \x02(\x0c\"@\n\nPrivateKey\x12$\n\x08key_type\x18\x01 \x02(\x0e\x32\x12.crypto.pb.KeyType\x12\x0c\n\x04\x64\x61ta\x18\x02 \x02(\x0c*9\n\x07KeyType\x12\x07\n\x03RSA\x10\x00\x12\x0b\n\x07\x45\x64\x32\x35\x35\x31\x39\x10\x01\x12\r\n\tSecp256k1\x10\x02\x12\t\n\x05\x45\x43\x44SA\x10\x03')
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dlibp2p/crypto/pb/crypto.proto\x12\tcrypto.pb\"?\n\tPublicKey\x12$\n\x08key_type\x18\x01 \x02(\x0e\x32\x12.crypto.pb.KeyType\x12\x0c\n\x04\x64\x61ta\x18\x02 \x02(\x0c\"@\n\nPrivateKey\x12$\n\x08key_type\x18\x01 \x02(\x0e\x32\x12.crypto.pb.KeyType\x12\x0c\n\x04\x64\x61ta\x18\x02 \x02(\x0c*G\n\x07KeyType\x12\x07\n\x03RSA\x10\x00\x12\x0b\n\x07\x45\x64\x32\x35\x35\x31\x39\x10\x01\x12\r\n\tSecp256k1\x10\x02\x12\t\n\x05\x45\x43\x44SA\x10\x03\x12\x0c\n\x08\x45\x43\x43_P256\x10\x04')
|
||||||
|
|
||||||
_globals = globals()
|
_globals = globals()
|
||||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
||||||
@ -22,7 +22,7 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'libp2p.crypto.pb.crypto_pb2
|
|||||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
_globals['_KEYTYPE']._serialized_start=175
|
_globals['_KEYTYPE']._serialized_start=175
|
||||||
_globals['_KEYTYPE']._serialized_end=232
|
_globals['_KEYTYPE']._serialized_end=246
|
||||||
_globals['_PUBLICKEY']._serialized_start=44
|
_globals['_PUBLICKEY']._serialized_start=44
|
||||||
_globals['_PUBLICKEY']._serialized_end=107
|
_globals['_PUBLICKEY']._serialized_end=107
|
||||||
_globals['_PRIVATEKEY']._serialized_start=109
|
_globals['_PRIVATEKEY']._serialized_start=109
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
@generated by mypy-protobuf. Do not edit manually!
|
@generated by mypy-protobuf. Do not edit manually!
|
||||||
isort:skip_file
|
isort:skip_file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
import google.protobuf.descriptor
|
import google.protobuf.descriptor
|
||||||
import google.protobuf.internal.enum_type_wrapper
|
import google.protobuf.internal.enum_type_wrapper
|
||||||
@ -26,6 +27,7 @@ class _KeyTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTy
|
|||||||
Ed25519: _KeyType.ValueType # 1
|
Ed25519: _KeyType.ValueType # 1
|
||||||
Secp256k1: _KeyType.ValueType # 2
|
Secp256k1: _KeyType.ValueType # 2
|
||||||
ECDSA: _KeyType.ValueType # 3
|
ECDSA: _KeyType.ValueType # 3
|
||||||
|
ECC_P256: _KeyType.ValueType # 4
|
||||||
|
|
||||||
class KeyType(_KeyType, metaclass=_KeyTypeEnumTypeWrapper): ...
|
class KeyType(_KeyType, metaclass=_KeyTypeEnumTypeWrapper): ...
|
||||||
|
|
||||||
@ -33,9 +35,10 @@ RSA: KeyType.ValueType # 0
|
|||||||
Ed25519: KeyType.ValueType # 1
|
Ed25519: KeyType.ValueType # 1
|
||||||
Secp256k1: KeyType.ValueType # 2
|
Secp256k1: KeyType.ValueType # 2
|
||||||
ECDSA: KeyType.ValueType # 3
|
ECDSA: KeyType.ValueType # 3
|
||||||
|
ECC_P256: KeyType.ValueType # 4
|
||||||
global___KeyType = KeyType
|
global___KeyType = KeyType
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class PublicKey(google.protobuf.message.Message):
|
class PublicKey(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -49,12 +52,12 @@ class PublicKey(google.protobuf.message.Message):
|
|||||||
key_type: global___KeyType.ValueType | None = ...,
|
key_type: global___KeyType.ValueType | None = ...,
|
||||||
data: builtins.bytes | None = ...,
|
data: builtins.bytes | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["data", b"data", "key_type", b"key_type"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["data", b"data", "key_type", b"key_type"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["data", b"data", "key_type", b"key_type"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["data", b"data", "key_type", b"key_type"]) -> None: ...
|
||||||
|
|
||||||
global___PublicKey = PublicKey
|
global___PublicKey = PublicKey
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class PrivateKey(google.protobuf.message.Message):
|
class PrivateKey(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -68,7 +71,7 @@ class PrivateKey(google.protobuf.message.Message):
|
|||||||
key_type: global___KeyType.ValueType | None = ...,
|
key_type: global___KeyType.ValueType | None = ...,
|
||||||
data: builtins.bytes | None = ...,
|
data: builtins.bytes | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["data", b"data", "key_type", b"key_type"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["data", b"data", "key_type", b"key_type"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["data", b"data", "key_type", b"key_type"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["data", b"data", "key_type", b"key_type"]) -> None: ...
|
||||||
|
|
||||||
global___PrivateKey = PrivateKey
|
global___PrivateKey = PrivateKey
|
||||||
|
|||||||
@ -2,21 +2,17 @@
|
|||||||
@generated by mypy-protobuf. Do not edit manually!
|
@generated by mypy-protobuf. Do not edit manually!
|
||||||
isort:skip_file
|
isort:skip_file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
import collections.abc
|
import collections.abc
|
||||||
import google.protobuf.descriptor
|
import google.protobuf.descriptor
|
||||||
import google.protobuf.internal.containers
|
import google.protobuf.internal.containers
|
||||||
import google.protobuf.message
|
import google.protobuf.message
|
||||||
import sys
|
import typing
|
||||||
|
|
||||||
if sys.version_info >= (3, 8):
|
|
||||||
import typing as typing_extensions
|
|
||||||
else:
|
|
||||||
import typing_extensions
|
|
||||||
|
|
||||||
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class Identify(google.protobuf.message.Message):
|
class Identify(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -29,9 +25,9 @@ class Identify(google.protobuf.message.Message):
|
|||||||
protocol_version: builtins.str
|
protocol_version: builtins.str
|
||||||
agent_version: builtins.str
|
agent_version: builtins.str
|
||||||
public_key: builtins.bytes
|
public_key: builtins.bytes
|
||||||
|
observed_addr: builtins.bytes
|
||||||
@property
|
@property
|
||||||
def listen_addrs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]: ...
|
def listen_addrs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]: ...
|
||||||
observed_addr: builtins.bytes
|
|
||||||
@property
|
@property
|
||||||
def protocols(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
def protocols(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
||||||
def __init__(
|
def __init__(
|
||||||
@ -44,7 +40,7 @@ class Identify(google.protobuf.message.Message):
|
|||||||
observed_addr: builtins.bytes | None = ...,
|
observed_addr: builtins.bytes | None = ...,
|
||||||
protocols: collections.abc.Iterable[builtins.str] | None = ...,
|
protocols: collections.abc.Iterable[builtins.str] | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["agent_version", b"agent_version", "observed_addr", b"observed_addr", "protocol_version", b"protocol_version", "public_key", b"public_key"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["agent_version", b"agent_version", "observed_addr", b"observed_addr", "protocol_version", b"protocol_version", "public_key", b"public_key"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["agent_version", b"agent_version", "listen_addrs", b"listen_addrs", "observed_addr", b"observed_addr", "protocol_version", b"protocol_version", "protocols", b"protocols", "public_key", b"public_key"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["agent_version", b"agent_version", "listen_addrs", b"listen_addrs", "observed_addr", b"observed_addr", "protocol_version", b"protocol_version", "protocols", b"protocols", "public_key", b"public_key"]) -> None: ...
|
||||||
|
|
||||||
global___Identify = Identify
|
global___Identify = Identify
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
@generated by mypy-protobuf. Do not edit manually!
|
@generated by mypy-protobuf. Do not edit manually!
|
||||||
isort:skip_file
|
isort:skip_file
|
||||||
Modified from https://github.com/libp2p/go-libp2p-pubsub/blob/master/pb/rpc.proto"""
|
Modified from https://github.com/libp2p/go-libp2p-pubsub/blob/master/pb/rpc.proto"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
import collections.abc
|
import collections.abc
|
||||||
import google.protobuf.descriptor
|
import google.protobuf.descriptor
|
||||||
@ -18,11 +19,11 @@ else:
|
|||||||
|
|
||||||
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class RPC(google.protobuf.message.Message):
|
class RPC(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class SubOpts(google.protobuf.message.Message):
|
class SubOpts(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -37,8 +38,8 @@ class RPC(google.protobuf.message.Message):
|
|||||||
subscribe: builtins.bool | None = ...,
|
subscribe: builtins.bool | None = ...,
|
||||||
topicid: builtins.str | None = ...,
|
topicid: builtins.str | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["subscribe", b"subscribe", "topicid", b"topicid"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["subscribe", b"subscribe", "topicid", b"topicid"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["subscribe", b"subscribe", "topicid", b"topicid"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["subscribe", b"subscribe", "topicid", b"topicid"]) -> None: ...
|
||||||
|
|
||||||
SUBSCRIPTIONS_FIELD_NUMBER: builtins.int
|
SUBSCRIPTIONS_FIELD_NUMBER: builtins.int
|
||||||
PUBLISH_FIELD_NUMBER: builtins.int
|
PUBLISH_FIELD_NUMBER: builtins.int
|
||||||
@ -56,12 +57,12 @@ class RPC(google.protobuf.message.Message):
|
|||||||
publish: collections.abc.Iterable[global___Message] | None = ...,
|
publish: collections.abc.Iterable[global___Message] | None = ...,
|
||||||
control: global___ControlMessage | None = ...,
|
control: global___ControlMessage | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["control", b"control"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["control", b"control"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["control", b"control", "publish", b"publish", "subscriptions", b"subscriptions"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["control", b"control", "publish", b"publish", "subscriptions", b"subscriptions"]) -> None: ...
|
||||||
|
|
||||||
global___RPC = RPC
|
global___RPC = RPC
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class Message(google.protobuf.message.Message):
|
class Message(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -74,10 +75,10 @@ class Message(google.protobuf.message.Message):
|
|||||||
from_id: builtins.bytes
|
from_id: builtins.bytes
|
||||||
data: builtins.bytes
|
data: builtins.bytes
|
||||||
seqno: builtins.bytes
|
seqno: builtins.bytes
|
||||||
@property
|
|
||||||
def topicIDs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
|
||||||
signature: builtins.bytes
|
signature: builtins.bytes
|
||||||
key: builtins.bytes
|
key: builtins.bytes
|
||||||
|
@property
|
||||||
|
def topicIDs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
@ -88,12 +89,12 @@ class Message(google.protobuf.message.Message):
|
|||||||
signature: builtins.bytes | None = ...,
|
signature: builtins.bytes | None = ...,
|
||||||
key: builtins.bytes | None = ...,
|
key: builtins.bytes | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["data", b"data", "from_id", b"from_id", "key", b"key", "seqno", b"seqno", "signature", b"signature"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["data", b"data", "from_id", b"from_id", "key", b"key", "seqno", b"seqno", "signature", b"signature"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["data", b"data", "from_id", b"from_id", "key", b"key", "seqno", b"seqno", "signature", b"signature", "topicIDs", b"topicIDs"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["data", b"data", "from_id", b"from_id", "key", b"key", "seqno", b"seqno", "signature", b"signature", "topicIDs", b"topicIDs"]) -> None: ...
|
||||||
|
|
||||||
global___Message = Message
|
global___Message = Message
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class ControlMessage(google.protobuf.message.Message):
|
class ControlMessage(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -117,11 +118,11 @@ class ControlMessage(google.protobuf.message.Message):
|
|||||||
graft: collections.abc.Iterable[global___ControlGraft] | None = ...,
|
graft: collections.abc.Iterable[global___ControlGraft] | None = ...,
|
||||||
prune: collections.abc.Iterable[global___ControlPrune] | None = ...,
|
prune: collections.abc.Iterable[global___ControlPrune] | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["graft", b"graft", "ihave", b"ihave", "iwant", b"iwant", "prune", b"prune"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["graft", b"graft", "ihave", b"ihave", "iwant", b"iwant", "prune", b"prune"]) -> None: ...
|
||||||
|
|
||||||
global___ControlMessage = ControlMessage
|
global___ControlMessage = ControlMessage
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class ControlIHave(google.protobuf.message.Message):
|
class ControlIHave(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -136,12 +137,12 @@ class ControlIHave(google.protobuf.message.Message):
|
|||||||
topicID: builtins.str | None = ...,
|
topicID: builtins.str | None = ...,
|
||||||
messageIDs: collections.abc.Iterable[builtins.str] | None = ...,
|
messageIDs: collections.abc.Iterable[builtins.str] | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["topicID", b"topicID"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["topicID", b"topicID"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["messageIDs", b"messageIDs", "topicID", b"topicID"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["messageIDs", b"messageIDs", "topicID", b"topicID"]) -> None: ...
|
||||||
|
|
||||||
global___ControlIHave = ControlIHave
|
global___ControlIHave = ControlIHave
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class ControlIWant(google.protobuf.message.Message):
|
class ControlIWant(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -153,11 +154,11 @@ class ControlIWant(google.protobuf.message.Message):
|
|||||||
*,
|
*,
|
||||||
messageIDs: collections.abc.Iterable[builtins.str] | None = ...,
|
messageIDs: collections.abc.Iterable[builtins.str] | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["messageIDs", b"messageIDs"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["messageIDs", b"messageIDs"]) -> None: ...
|
||||||
|
|
||||||
global___ControlIWant = ControlIWant
|
global___ControlIWant = ControlIWant
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class ControlGraft(google.protobuf.message.Message):
|
class ControlGraft(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -168,12 +169,12 @@ class ControlGraft(google.protobuf.message.Message):
|
|||||||
*,
|
*,
|
||||||
topicID: builtins.str | None = ...,
|
topicID: builtins.str | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["topicID", b"topicID"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["topicID", b"topicID"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["topicID", b"topicID"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["topicID", b"topicID"]) -> None: ...
|
||||||
|
|
||||||
global___ControlGraft = ControlGraft
|
global___ControlGraft = ControlGraft
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class ControlPrune(google.protobuf.message.Message):
|
class ControlPrune(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -184,16 +185,16 @@ class ControlPrune(google.protobuf.message.Message):
|
|||||||
*,
|
*,
|
||||||
topicID: builtins.str | None = ...,
|
topicID: builtins.str | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["topicID", b"topicID"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["topicID", b"topicID"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["topicID", b"topicID"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["topicID", b"topicID"]) -> None: ...
|
||||||
|
|
||||||
global___ControlPrune = ControlPrune
|
global___ControlPrune = ControlPrune
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class TopicDescriptor(google.protobuf.message.Message):
|
class TopicDescriptor(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class AuthOpts(google.protobuf.message.Message):
|
class AuthOpts(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -224,16 +225,17 @@ class TopicDescriptor(google.protobuf.message.Message):
|
|||||||
@property
|
@property
|
||||||
def keys(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]:
|
def keys(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]:
|
||||||
"""root keys to trust"""
|
"""root keys to trust"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
mode: global___TopicDescriptor.AuthOpts.AuthMode.ValueType | None = ...,
|
mode: global___TopicDescriptor.AuthOpts.AuthMode.ValueType | None = ...,
|
||||||
keys: collections.abc.Iterable[builtins.bytes] | None = ...,
|
keys: collections.abc.Iterable[builtins.bytes] | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["mode", b"mode"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["mode", b"mode"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["keys", b"keys", "mode", b"mode"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["keys", b"keys", "mode", b"mode"]) -> None: ...
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class EncOpts(google.protobuf.message.Message):
|
class EncOpts(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -264,14 +266,15 @@ class TopicDescriptor(google.protobuf.message.Message):
|
|||||||
@property
|
@property
|
||||||
def keyHashes(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]:
|
def keyHashes(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]:
|
||||||
"""the hashes of the shared keys used (salted)"""
|
"""the hashes of the shared keys used (salted)"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
mode: global___TopicDescriptor.EncOpts.EncMode.ValueType | None = ...,
|
mode: global___TopicDescriptor.EncOpts.EncMode.ValueType | None = ...,
|
||||||
keyHashes: collections.abc.Iterable[builtins.bytes] | None = ...,
|
keyHashes: collections.abc.Iterable[builtins.bytes] | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["mode", b"mode"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["mode", b"mode"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["keyHashes", b"keyHashes", "mode", b"mode"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["keyHashes", b"keyHashes", "mode", b"mode"]) -> None: ...
|
||||||
|
|
||||||
NAME_FIELD_NUMBER: builtins.int
|
NAME_FIELD_NUMBER: builtins.int
|
||||||
AUTH_FIELD_NUMBER: builtins.int
|
AUTH_FIELD_NUMBER: builtins.int
|
||||||
@ -288,7 +291,7 @@ class TopicDescriptor(google.protobuf.message.Message):
|
|||||||
auth: global___TopicDescriptor.AuthOpts | None = ...,
|
auth: global___TopicDescriptor.AuthOpts | None = ...,
|
||||||
enc: global___TopicDescriptor.EncOpts | None = ...,
|
enc: global___TopicDescriptor.EncOpts | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["auth", b"auth", "enc", b"enc", "name", b"name"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["auth", b"auth", "enc", b"enc", "name", b"name"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["auth", b"auth", "enc", b"enc", "name", b"name"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["auth", b"auth", "enc", b"enc", "name", b"name"]) -> None: ...
|
||||||
|
|
||||||
global___TopicDescriptor = TopicDescriptor
|
global___TopicDescriptor = TopicDescriptor
|
||||||
|
|||||||
@ -2,20 +2,16 @@
|
|||||||
@generated by mypy-protobuf. Do not edit manually!
|
@generated by mypy-protobuf. Do not edit manually!
|
||||||
isort:skip_file
|
isort:skip_file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
import google.protobuf.descriptor
|
import google.protobuf.descriptor
|
||||||
import google.protobuf.message
|
import google.protobuf.message
|
||||||
import libp2p.crypto.pb.crypto_pb2
|
import libp2p.crypto.pb.crypto_pb2
|
||||||
import sys
|
import typing
|
||||||
|
|
||||||
if sys.version_info >= (3, 8):
|
|
||||||
import typing as typing_extensions
|
|
||||||
else:
|
|
||||||
import typing_extensions
|
|
||||||
|
|
||||||
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class Exchange(google.protobuf.message.Message):
|
class Exchange(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -30,7 +26,7 @@ class Exchange(google.protobuf.message.Message):
|
|||||||
id: builtins.bytes | None = ...,
|
id: builtins.bytes | None = ...,
|
||||||
pubkey: libp2p.crypto.pb.crypto_pb2.PublicKey | None = ...,
|
pubkey: libp2p.crypto.pb.crypto_pb2.PublicKey | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["id", b"id", "pubkey", b"pubkey"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["id", b"id", "pubkey", b"pubkey"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["id", b"id", "pubkey", b"pubkey"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["id", b"id", "pubkey", b"pubkey"]) -> None: ...
|
||||||
|
|
||||||
global___Exchange = Exchange
|
global___Exchange = Exchange
|
||||||
|
|||||||
@ -182,8 +182,7 @@ class InsecureTransport(BaseSecureTransport):
|
|||||||
|
|
||||||
def make_exchange_message(pubkey: PublicKey) -> plaintext_pb2.Exchange:
|
def make_exchange_message(pubkey: PublicKey) -> plaintext_pb2.Exchange:
|
||||||
pubkey_pb = crypto_pb2.PublicKey(
|
pubkey_pb = crypto_pb2.PublicKey(
|
||||||
# type ignored - TODO add ECD_P256 to KeyType
|
key_type=pubkey.get_type().value,
|
||||||
key_type=pubkey.get_type().value, # type: ignore
|
|
||||||
data=pubkey.to_bytes(),
|
data=pubkey.to_bytes(),
|
||||||
)
|
)
|
||||||
id_bytes = ID.from_pubkey(pubkey).to_bytes()
|
id_bytes = ID.from_pubkey(pubkey).to_bytes()
|
||||||
|
|||||||
@ -2,19 +2,15 @@
|
|||||||
@generated by mypy-protobuf. Do not edit manually!
|
@generated by mypy-protobuf. Do not edit manually!
|
||||||
isort:skip_file
|
isort:skip_file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
import google.protobuf.descriptor
|
import google.protobuf.descriptor
|
||||||
import google.protobuf.message
|
import google.protobuf.message
|
||||||
import sys
|
import typing
|
||||||
|
|
||||||
if sys.version_info >= (3, 8):
|
|
||||||
import typing as typing_extensions
|
|
||||||
else:
|
|
||||||
import typing_extensions
|
|
||||||
|
|
||||||
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class NoiseHandshakePayload(google.protobuf.message.Message):
|
class NoiseHandshakePayload(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -31,6 +27,6 @@ class NoiseHandshakePayload(google.protobuf.message.Message):
|
|||||||
identity_sig: builtins.bytes = ...,
|
identity_sig: builtins.bytes = ...,
|
||||||
data: builtins.bytes = ...,
|
data: builtins.bytes = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["data", b"data", "identity_key", b"identity_key", "identity_sig", b"identity_sig"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["data", b"data", "identity_key", b"identity_key", "identity_sig", b"identity_sig"]) -> None: ...
|
||||||
|
|
||||||
global___NoiseHandshakePayload = NoiseHandshakePayload
|
global___NoiseHandshakePayload = NoiseHandshakePayload
|
||||||
|
|||||||
@ -2,19 +2,15 @@
|
|||||||
@generated by mypy-protobuf. Do not edit manually!
|
@generated by mypy-protobuf. Do not edit manually!
|
||||||
isort:skip_file
|
isort:skip_file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
import google.protobuf.descriptor
|
import google.protobuf.descriptor
|
||||||
import google.protobuf.message
|
import google.protobuf.message
|
||||||
import sys
|
import typing
|
||||||
|
|
||||||
if sys.version_info >= (3, 8):
|
|
||||||
import typing as typing_extensions
|
|
||||||
else:
|
|
||||||
import typing_extensions
|
|
||||||
|
|
||||||
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class Propose(google.protobuf.message.Message):
|
class Propose(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -37,12 +33,12 @@ class Propose(google.protobuf.message.Message):
|
|||||||
ciphers: builtins.str | None = ...,
|
ciphers: builtins.str | None = ...,
|
||||||
hashes: builtins.str | None = ...,
|
hashes: builtins.str | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["ciphers", b"ciphers", "exchanges", b"exchanges", "hashes", b"hashes", "public_key", b"public_key", "rand", b"rand"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["ciphers", b"ciphers", "exchanges", b"exchanges", "hashes", b"hashes", "public_key", b"public_key", "rand", b"rand"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["ciphers", b"ciphers", "exchanges", b"exchanges", "hashes", b"hashes", "public_key", b"public_key", "rand", b"rand"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["ciphers", b"ciphers", "exchanges", b"exchanges", "hashes", b"hashes", "public_key", b"public_key", "rand", b"rand"]) -> None: ...
|
||||||
|
|
||||||
global___Propose = Propose
|
global___Propose = Propose
|
||||||
|
|
||||||
@typing_extensions.final
|
@typing.final
|
||||||
class Exchange(google.protobuf.message.Message):
|
class Exchange(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@ -56,7 +52,7 @@ class Exchange(google.protobuf.message.Message):
|
|||||||
ephemeral_public_key: builtins.bytes | None = ...,
|
ephemeral_public_key: builtins.bytes | None = ...,
|
||||||
signature: builtins.bytes | None = ...,
|
signature: builtins.bytes | None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def HasField(self, field_name: typing_extensions.Literal["ephemeral_public_key", b"ephemeral_public_key", "signature", b"signature"]) -> builtins.bool: ...
|
def HasField(self, field_name: typing.Literal["ephemeral_public_key", b"ephemeral_public_key", "signature", b"signature"]) -> builtins.bool: ...
|
||||||
def ClearField(self, field_name: typing_extensions.Literal["ephemeral_public_key", b"ephemeral_public_key", "signature", b"signature"]) -> None: ...
|
def ClearField(self, field_name: typing.Literal["ephemeral_public_key", b"ephemeral_public_key", "signature", b"signature"]) -> None: ...
|
||||||
|
|
||||||
global___Exchange = Exchange
|
global___Exchange = Exchange
|
||||||
|
|||||||
1
newsfragments/465.internal.rst
Normal file
1
newsfragments/465.internal.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
Convert ``KeyType`` enum to use ``protobuf.KeyType`` options rather than ints, rebuild protobufs to include ``ECC_P256``
|
||||||
Reference in New Issue
Block a user