@@ -64,7 +64,7 @@ impl CommandContext for Cli {
6464 return Err ( CommandError :: InvalidRootCert ) ;
6565 }
6666 let tbs = root. tbs_certificate . to_der ( ) ?;
67- Signature :: new ( root. signature . raw_bytes ( ) . to_vec ( ) ) . verify ( & tbs, root) ?;
67+ Signature :: try_from ( root) ? . verify ( & tbs, & root. tbs_certificate . subject_public_key_info ) ?;
6868 if matches ! ( self . get_output_format( ) , OutputFormat :: Text ) {
6969 println ! (
7070 "✅ Verified root certificate for subject `{}`" ,
@@ -75,7 +75,8 @@ impl CommandContext for Cli {
7575 let mut prev = root;
7676 for cert in rest {
7777 let tbs = cert. tbs_certificate . to_der ( ) ?;
78- Signature :: new ( cert. signature . raw_bytes ( ) . to_vec ( ) ) . verify ( & tbs, prev) ?;
78+ Signature :: try_from ( cert) ?
79+ . verify ( & tbs, & prev. tbs_certificate . subject_public_key_info ) ?;
7980 prev = cert;
8081 if matches ! ( self . get_output_format( ) , OutputFormat :: Text ) {
8182 println ! (
@@ -117,10 +118,9 @@ impl CommandContext for Cli {
117118 if reserved. is_empty ( ) {
118119 println ! ( "✅ No reserved jobs" ) ;
119120 } else {
120- println ! ( "✅ {} reserved jobs" , reserved. len( ) ) ;
121- println ! ( "{:40}{}" , "Job ID" , "Time Reserved" ) ;
122- for ( job_id, time) in reserved {
123- println ! ( "{job_id:40}{time}" ) ;
121+ println ! ( "✅ {} reserved jobs:" , reserved. len( ) ) ;
122+ for job_id in reserved. keys ( ) {
123+ println ! ( "{job_id}" ) ;
124124 }
125125 }
126126 }
@@ -132,7 +132,7 @@ impl CommandContext for Cli {
132132 match self . get_output_format ( ) {
133133 OutputFormat :: Json => println ! ( "{}" , json!( reserved) ) ,
134134 OutputFormat :: Text => {
135- println ! ( "✅ Read {} reserved job IDs " , reserved. job_ids. len( ) ) ;
135+ println ! ( "✅ Read {} reserved jobs " , reserved. job_ids. len( ) ) ;
136136 }
137137 }
138138 Ok ( ( ) )
@@ -149,9 +149,9 @@ impl CommandContext for Cli {
149149 let n = job_ids. len ( ) ;
150150 match n {
151151 0 => println ! ( "✅ No jobs reserved" ) ,
152- 1 => println ! ( "✅ Reserved job ID {} at {}" , job_ids[ 0 ] , time_reserved) ,
152+ 1 => println ! ( "✅ Reserved job `{}` at {}" , job_ids[ 0 ] , time_reserved) ,
153153 _ => {
154- println ! ( "✅ Reserved {n} job IDs at {time_reserved}:" ) ;
154+ println ! ( "✅ Reserved {n} jobs at {time_reserved}:" ) ;
155155 for job_id in & reserved. job_ids {
156156 println ! ( "{job_id}" ) ;
157157 }
@@ -162,17 +162,17 @@ impl CommandContext for Cli {
162162 Ok ( ( ) )
163163 }
164164
165- fn job_aborted ( & mut self , job_id : JobId ) -> Result < ( ) , CommandError > {
165+ fn job_aborted ( & mut self , job_id : & JobId ) -> Result < ( ) , CommandError > {
166166 match self . get_output_format ( ) {
167167 OutputFormat :: Json => println ! ( "{job_id}" ) ,
168- OutputFormat :: Text => println ! ( "✅ Aborted job {job_id}" ) ,
168+ OutputFormat :: Text => println ! ( "✅ Aborted job ` {job_id}` " ) ,
169169 }
170170 Ok ( ( ) )
171171 }
172172
173173 fn job_stdout (
174174 & mut self ,
175- job_id : JobId ,
175+ _job_id : & JobId ,
176176 output : & [ u8 ] ,
177177 binary : bool ,
178178 ) -> Result < ( ) , CommandError > {
@@ -182,7 +182,7 @@ impl CommandContext for Cli {
182182 OutputFormat :: Text if binary => stdout ( ) . write ( output) . map ( |_| ( ) ) ?,
183183 OutputFormat :: Text if output. is_empty ( ) => ( ) ,
184184 OutputFormat :: Text => {
185- println ! ( "✅ Job {job_id} stdout:" ) ;
185+ println ! ( "✅ Job stdout:" ) ;
186186 let output = String :: from_utf8 ( output. to_vec ( ) ) ?;
187187 if output. ends_with ( '\n' ) {
188188 print ! ( "{output}" ) ;
@@ -196,7 +196,7 @@ impl CommandContext for Cli {
196196
197197 fn job_stderr (
198198 & mut self ,
199- job_id : JobId ,
199+ _job_id : & JobId ,
200200 errors : & [ u8 ] ,
201201 binary : bool ,
202202 ) -> Result < ( ) , CommandError > {
@@ -206,7 +206,7 @@ impl CommandContext for Cli {
206206 OutputFormat :: Text if binary => stdout ( ) . write ( errors) . map ( |_| ( ) ) ?,
207207 OutputFormat :: Text if errors. is_empty ( ) => ( ) ,
208208 OutputFormat :: Text => {
209- println ! ( "❌ Job {job_id} stderr:" ) ;
209+ println ! ( "❌ Job stderr:" ) ;
210210 let errors = String :: from_utf8 ( errors. to_vec ( ) ) ?;
211211 if errors. ends_with ( '\n' ) {
212212 print ! ( "{errors}" ) ;
@@ -218,11 +218,11 @@ impl CommandContext for Cli {
218218 Ok ( ( ) )
219219 }
220220
221- fn job_status ( & mut self , job_id : JobId , status : & JobStatus ) -> Result < ( ) , CommandError > {
221+ fn job_status ( & mut self , job_id : & JobId , status : & JobStatus ) -> Result < ( ) , CommandError > {
222222 match self . get_output_format ( ) {
223223 OutputFormat :: Json => println ! ( "{}" , json!( status) ) ,
224224 OutputFormat :: Text => match status {
225- JobStatus :: NotFound => println ! ( "❌ Job {job_id} not found" ) ,
225+ JobStatus :: NotFound => println ! ( "❌ Job ` {job_id}` not found" ) ,
226226 JobStatus :: Reserved {
227227 job_id,
228228 time_reserved,
@@ -291,10 +291,10 @@ impl CommandContext for Cli {
291291 OutputFormat :: Text => {
292292 let n = revoked. len ( ) ;
293293 match n {
294- 0 => println ! ( "✅ No job IDs revoked" ) ,
295- 1 => println ! ( "✅ Revoked job ID {} " , revoked[ 0 ] ) ,
294+ 0 => println ! ( "✅ No jobs revoked" ) ,
295+ 1 => println ! ( "✅ Revoked job `{}` " , revoked[ 0 ] ) ,
296296 _ => {
297- println ! ( "✅ Revoked {} job IDs :" , revoked. len( ) ) ;
297+ println ! ( "✅ Revoked {} jobs :" , revoked. len( ) ) ;
298298 for job_id in revoked {
299299 println ! ( "{job_id}" ) ;
300300 }
@@ -309,7 +309,7 @@ impl CommandContext for Cli {
309309 match self . get_output_format ( ) {
310310 OutputFormat :: Json => println ! ( "{}" , serde_json:: to_string( & job) ?) ,
311311 OutputFormat :: Text => println ! (
312- "✅ Signed request for job {} \n {}" ,
312+ "✅ Signed request for job `{}` \n {}" ,
313313 job. job_id( ) ,
314314 serde_json:: to_string_pretty( & job) ?
315315 ) ,
0 commit comments