feat: add webtransport certhashes field to NoiseExtensions and implement serialization test

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>
This commit is contained in:
2025-08-26 12:48:57 +05:30
parent 05fde3ad40
commit cacb3c8aca
5 changed files with 23 additions and 8 deletions

View File

@ -2,6 +2,7 @@ syntax = "proto2";
package pb;
message NoiseExtensions {
repeated bytes webtransport_certhashes = 1;
repeated string stream_muxers = 2;
}

View File

@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$libp2p/security/noise/pb/noise.proto\x12\x02pb\"(\n\x0fNoiseExtensions\x12\x15\n\rstream_muxers\x18\x02 \x03(\t\"Q\n\x15NoiseHandshakePayload\x12\x14\n\x0cidentity_key\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_sig\x18\x02 \x01(\x0c\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c')
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$libp2p/security/noise/pb/noise.proto\x12\x02pb\"I\n\x0fNoiseExtensions\x12\x1f\n\x17webtransport_certhashes\x18\x01 \x03(\x0c\x12\x15\n\rstream_muxers\x18\x02 \x03(\t\"Q\n\x15NoiseHandshakePayload\x12\x14\n\x0cidentity_key\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_sig\x18\x02 \x01(\x0c\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'libp2p.security.noise.pb.noise_pb2', globals())
@ -21,7 +21,7 @@ if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
_NOISEEXTENSIONS._serialized_start=44
_NOISEEXTENSIONS._serialized_end=84
_NOISEHANDSHAKEPAYLOAD._serialized_start=86
_NOISEHANDSHAKEPAYLOAD._serialized_end=167
_NOISEEXTENSIONS._serialized_end=117
_NOISEHANDSHAKEPAYLOAD._serialized_start=119
_NOISEHANDSHAKEPAYLOAD._serialized_end=200
# @@protoc_insertion_point(module_scope)

View File

@ -16,15 +16,19 @@ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
class NoiseExtensions(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
WEBTRANSPORT_CERTHASHES_FIELD_NUMBER: builtins.int
STREAM_MUXERS_FIELD_NUMBER: builtins.int
@property
def webtransport_certhashes(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]: ...
@property
def stream_muxers(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
def __init__(
self,
*,
webtransport_certhashes: collections.abc.Iterable[builtins.bytes] | None = ...,
stream_muxers: collections.abc.Iterable[builtins.str] | None = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["stream_muxers", b"stream_muxers"]) -> None: ...
def ClearField(self, field_name: typing.Literal["stream_muxers", b"stream_muxers", "webtransport_certhashes", b"webtransport_certhashes"]) -> None: ...
global___NoiseExtensions = NoiseExtensions