chromium/third_party/cloud_authenticator/chromesync/src/lib.rs

// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![no_std]
#![no_main]
extern crate prost;

pub mod pb {
    include!("../sync_pb.rs");
}

#[cfg(test)]
mod tests {
    use super::*;
    use prost::Message;

    #[test]
    fn test_decode() {
        const PROTOBUF_BYTES : &[u8] = b"\x0a\x10\x84\x58\x65\xab\x0f\xfc\xf6\xc9\x3e\x89\xfa\x02\x96\x71\x07\x51\x12\x10\x79\xce\xfe\xec\x29\x29\xb2\x78\xf0\x55\x34\xe9\xc1\xbe\x6f\x74\x1a\x11\x73\x65\x63\x75\x72\x69\x74\x79\x6b\x65\x79\x73\x2e\x69\x6e\x66\x6f\x22\x08\x00\x01\x02\x03\x04\x05\x06\x07\x2a\x10\x9e\xf5\x78\x44\x8e\x8d\xca\x92\xb3\x1f\xca\xed\xe4\xbc\x71\x9b\x30\xf5\x9b\xf6\xb8\x94\x31\x3a\x09\x75\x73\x65\x72\x2e\x6e\x61\x6d\x65\x42\x00\x58\x00\x62\xcb\x01\x6c\x93\xe2\x2f\x86\xcc\x16\xf4\x2c\x32\xd6\x98\xa0\x08\xf3\xf2\xf1\x81\x3a\xf2\xf7\xb7\xb4\x6c\xe7\x5d\x8b\x7f\xc0\xb4\x77\xba\x69\x7b\x73\xed\xb3\x2c\xaf\x40\x18\x99\x48\x8c\xb0\xa9\xaa\xe4\xa9\xbe\xd7\x6a\x48\x96\xee\xad\x44\xef\x82\x2c\x8c\xdf\xf1\xa6\x87\x51\xea\x63\x54\xc2\x29\x5d\x03\xfb\xbc\xd5\x5b\x06\xf2\x35\x95\xc7\x58\xcb\x0a\x1b\x31\x77\x7d\xe3\x92\x78\xb1\xe0\x8b\x2e\xf1\xb2\x93\x6a\x43\xa8\x47\x82\xcf\x68\xf1\x63\x6a\x10\xc8\xff\xec\xb1\x4e\x0c\x82\x7a\x26\x3c\x6b\x83\x37\xa9\x10\x2f\x90\xc6\x58\x19\xb4\x56\xde\x87\xc0\x9a\x1f\x83\xf2\xb1\x13\x76\x58\x82\xd3\x73\x2c\xd7\x38\xa8\x5d\x73\x63\x07\x9c\xcd\x74\x01\x06\xdf\x3b\x59\x62\xbc\xbd\x18\xc4\x75\xcf\xf9\xbe\x7b\xd2\x6d\xa3\x9c\x27\xf0\x01\x80\xa8\x6c\x38\xb8\xf7\x62\xda\x9d\x73\xf8\x3f\x6a\xdd\x62\x73\xbb\x65\x19\x85\xe1\x4b\x2a\x83";
        pb::WebauthnCredentialSpecifics::decode(PROTOBUF_BYTES).unwrap();
    }
}