@@ -790,7 +790,7 @@ impl HttpServer {
790790 }
791791 }
792792
793- fn check_authorized ( & self , req : & Request , mutation : Option < Mutation > ) -> bool {
793+ fn check_authorized ( & self , req : & Request , mutation : Option < Mutation < ' _ > > ) -> bool {
794794 let ( private_key, private_key_subject) = if mutation. is_some ( ) || self . auth_required {
795795 match & self . token {
796796 Token :: Plaintext ( token) => return Some ( token) == req. authorization . as_ref ( ) ,
@@ -832,7 +832,8 @@ impl HttpServer {
832832 url : & ' a str ,
833833 kip : & ' a str ,
834834 }
835- let footer: Footer = t ! ( serde_json:: from_slice( untrusted_token. untrusted_footer( ) ) . ok( ) ) ;
835+ let footer: Footer < ' _ > =
836+ t ! ( serde_json:: from_slice( untrusted_token. untrusted_footer( ) ) . ok( ) ) ;
836837 if footer. kip != paserk_pub_key_id {
837838 return false ;
838839 }
@@ -846,7 +847,6 @@ impl HttpServer {
846847 if footer. url != "https://github.com/rust-lang/crates.io-index"
847848 && footer. url != & format ! ( "sparse+http://{}/index/" , self . addr. to_string( ) )
848849 {
849- dbg ! ( footer. url) ;
850850 return false ;
851851 }
852852
@@ -862,20 +862,18 @@ impl HttpServer {
862862 _challenge : Option < & ' a str > , // todo: PASETO with challenges
863863 v : Option < u8 > ,
864864 }
865- let message: Message = t ! ( serde_json:: from_str( trusted_token. payload( ) ) . ok( ) ) ;
865+ let message: Message < ' _ > = t ! ( serde_json:: from_str( trusted_token. payload( ) ) . ok( ) ) ;
866866 let token_time = t ! ( OffsetDateTime :: parse( message. iat, & Rfc3339 ) . ok( ) ) ;
867867 let now = OffsetDateTime :: now_utc ( ) ;
868868 if ( now - token_time) > Duration :: MINUTE {
869869 return false ;
870870 }
871871 if private_key_subject. as_deref ( ) != message. sub {
872- dbg ! ( message. sub) ;
873872 return false ;
874873 }
875874 // - If the claim v is set, that it has the value of 1.
876875 if let Some ( v) = message. v {
877876 if v != 1 {
878- dbg ! ( message. v) ;
879877 return false ;
880878 }
881879 }
@@ -885,22 +883,18 @@ impl HttpServer {
885883 if let Some ( mutation) = mutation {
886884 // - That the operation matches the mutation field and is one of publish, yank, or unyank.
887885 if message. mutation != Some ( mutation. mutation ) {
888- dbg ! ( message. mutation) ;
889886 return false ;
890887 }
891888 // - That the package, and version match the request.
892889 if message. name != mutation. name {
893- dbg ! ( message. name) ;
894890 return false ;
895891 }
896892 if message. vers != mutation. vers {
897- dbg ! ( message. vers) ;
898893 return false ;
899894 }
900895 // - If the mutation is publish, that the version has not already been published, and that the hash matches the request.
901896 if mutation. mutation == "publish" {
902897 if message. cksum != mutation. cksum {
903- dbg ! ( message. cksum) ;
904898 return false ;
905899 }
906900 }
0 commit comments