File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ pub(crate) enum PreflightAlertStatus {
124
124
GeneralFailure ,
125
125
#[ serde( rename = "info" ) ]
126
126
Info ,
127
+ #[ serde( rename = "warn" ) ]
128
+ Warn ,
127
129
#[ serde( rename = "unsupported-operation" ) ]
128
130
UnsupportedOperation ,
129
131
#[ serde( rename = "invalid-parameters" ) ]
@@ -340,6 +342,17 @@ async fn handle_operation(
340
342
} ) ;
341
343
}
342
344
345
+ if conf. tls . is_none ( ) && operation. kind . as_str ( ) == OP_PROVISION_CREDENTIALS {
346
+ outputs. push ( PreflightOutput {
347
+ operation_id : operation. id ,
348
+ kind : PreflightOutputKind :: Alert {
349
+ status : PreflightAlertStatus :: Warn ,
350
+ message : "no TLS certificate configured, this may cause problems with credentials injection"
351
+ . to_owned ( ) ,
352
+ } ,
353
+ } ) ;
354
+ }
355
+
343
356
outputs. push ( PreflightOutput {
344
357
operation_id : operation. id ,
345
358
kind : PreflightOutputKind :: Ack ,
Original file line number Diff line number Diff line change @@ -87,9 +87,9 @@ async fn test_provision_credentials_success() -> anyhow::Result<()> {
87
87
88
88
let body = response. into_body ( ) . collect ( ) . await ?. to_bytes ( ) ;
89
89
let body: serde_json:: Value = serde_json:: from_slice ( & body) ?;
90
- assert_eq ! ( body. as_array( ) . expect( "an array" ) . len( ) , 1 ) ;
91
- assert_eq ! ( body[ 0 ] [ "operation_id" ] , op_id. to_string( ) ) ;
92
- assert_eq ! ( body[ 0 ] [ "kind" ] , "ack" , "{:?}" , body[ 0 ] ) ;
90
+ assert_eq ! ( body. as_array( ) . expect( "an array" ) . len( ) , 2 ) ;
91
+ assert_eq ! ( body[ 1 ] [ "operation_id" ] , op_id. to_string( ) ) ;
92
+ assert_eq ! ( body[ 1 ] [ "kind" ] , "ack" , "{:?}" , body[ 1 ] ) ;
93
93
94
94
let entry = state. credential_store . get ( token_id) . expect ( "the provisioned entry" ) ;
95
95
assert_eq ! ( entry. token, token) ;
You can’t perform that action at this time.
0 commit comments