@@ -81,7 +81,7 @@ fn decode_cbor_uuid(val: &coset::cbor::Value) -> anyhow::Result<uuid::Uuid> {
8181 Ok ( uuid)
8282}
8383
84- fn encode_cbor_document_ref ( doc_ref : & DocumentRef ) -> coset:: cbor:: Value {
84+ fn _encode_cbor_document_ref ( doc_ref : & DocumentRef ) -> coset:: cbor:: Value {
8585 match doc_ref {
8686 DocumentRef :: Latest { id } => encode_cbor_uuid ( & id. uuid ( ) ) ,
8787 DocumentRef :: WithVer { id, ver } => {
@@ -227,30 +227,32 @@ fn build_empty_cose_doc(doc_bytes: Vec<u8>, meta: &Metadata) -> coset::CoseSign
227227 coset:: Label :: Text ( "ver" . to_string ( ) ) ,
228228 encode_cbor_uuid ( & meta. doc_ver ( ) ) ,
229229 ) ) ;
230- if let Some ( r#ref) = & meta. doc_ref ( ) {
231- protected_header. rest . push ( (
232- coset:: Label :: Text ( "ref" . to_string ( ) ) ,
233- encode_cbor_document_ref ( r#ref) ,
234- ) ) ;
235- }
236- if let Some ( template) = & meta. doc_template ( ) {
237- protected_header. rest . push ( (
238- coset:: Label :: Text ( "template" . to_string ( ) ) ,
239- encode_cbor_document_ref ( template) ,
240- ) ) ;
241- }
242- if let Some ( reply) = & meta. doc_reply ( ) {
243- protected_header. rest . push ( (
244- coset:: Label :: Text ( "reply" . to_string ( ) ) ,
245- encode_cbor_document_ref ( reply) ,
246- ) ) ;
247- }
248- if let Some ( section) = & meta. doc_section ( ) {
249- protected_header. rest . push ( (
250- coset:: Label :: Text ( "section" . to_string ( ) ) ,
251- coset:: cbor:: Value :: Text ( section. clone ( ) ) ,
252- ) ) ;
253- }
230+ // WIP: encode additional metadata fields
231+ //
232+ // if let Some(r#ref) = &meta.doc_ref() {
233+ // protected_header.rest.push((
234+ // coset::Label::Text("ref".to_string()),
235+ // encode_cbor_document_ref(r#ref),
236+ // ));
237+ //}
238+ // if let Some(template) = &meta.doc_template() {
239+ // protected_header.rest.push((
240+ // coset::Label::Text("template".to_string()),
241+ // encode_cbor_document_ref(template),
242+ // ));
243+ //}
244+ // if let Some(reply) = &meta.doc_reply() {
245+ // protected_header.rest.push((
246+ // coset::Label::Text("reply".to_string()),
247+ // encode_cbor_document_ref(reply),
248+ // ));
249+ //}
250+ // if let Some(section) = &meta.doc_section() {
251+ // protected_header.rest.push((
252+ // coset::Label::Text("section".to_string()),
253+ // coset::cbor::Value::Text(section.clone()),
254+ // ));
255+ //}
254256
255257 coset:: CoseSignBuilder :: new ( )
256258 . protected ( protected_header)
0 commit comments