File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -148,14 +148,13 @@ async fn import_credential(
148
148
import_args : & ImportCredentialArgs ,
149
149
) -> anyhow:: Result < ( ) > {
150
150
let import_type: ImportCredentialTypeEnum = import_args. credential_type . clone ( ) . into ( ) ;
151
- let request = match import_type {
152
- ImportCredentialTypeEnum :: Path ( _path) => todo ! ( ) ,
153
- ImportCredentialTypeEnum :: Data ( data) => {
154
- let bin = parse_encoded_credential_data ( & data) ?;
155
- tonic:: Request :: new ( ImportUserCredentialRequest { credential : bin } )
156
- }
151
+ let raw_credential = match import_type {
152
+ ImportCredentialTypeEnum :: Path ( path) => std:: fs:: read ( path) ?,
153
+ ImportCredentialTypeEnum :: Data ( data) => parse_encoded_credential_data ( & data) ?,
157
154
} ;
158
-
155
+ let request = tonic:: Request :: new ( ImportUserCredentialRequest {
156
+ credential : raw_credential,
157
+ } ) ;
159
158
let mut client = get_client ( args) . await ?;
160
159
let response = client. import_user_credential ( request) . await ?. into_inner ( ) ;
161
160
println ! ( "{:?}" , response) ;
You can’t perform that action at this time.
0 commit comments