File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -274,7 +274,14 @@ pub fn get_repository_versions_response(
274274 let mut body = Vec :: new ( ) ;
275275 decoder. read_to_end ( & mut body) ?;
276276
277- let signed = Signed :: decode ( body. as_slice ( ) ) ?;
277+ get_repository_versions_data ( & body, public_key)
278+ }
279+
280+ pub fn get_repository_versions_data (
281+ protobuf_bytes : & Vec < u8 > ,
282+ public_key : & [ u8 ] ,
283+ ) -> Result < HashMap < String , Vec < Version > > , ApiError > {
284+ let signed = Signed :: decode ( protobuf_bytes. as_slice ( ) ) ?;
278285
279286 let payload =
280287 verify_payload ( signed, public_key) . map_err ( |_| ApiError :: IncorrectPayloadSignature ) ?;
@@ -339,7 +346,14 @@ pub fn get_package_response(
339346 let mut body = Vec :: new ( ) ;
340347 decoder. read_to_end ( & mut body) ?;
341348
342- let signed = Signed :: decode ( body. as_slice ( ) ) ?;
349+ get_package_data ( & body, public_key)
350+ }
351+
352+ pub fn get_package_data (
353+ protobuf_bytes : & Vec < u8 > ,
354+ public_key : & [ u8 ] ,
355+ ) -> Result < Package , ApiError > {
356+ let signed = Signed :: decode ( protobuf_bytes. as_slice ( ) ) ?;
343357
344358 let payload =
345359 verify_payload ( signed, public_key) . map_err ( |_| ApiError :: IncorrectPayloadSignature ) ?;
You can’t perform that action at this time.
0 commit comments