6
6
//! aiding clients in discovering the capabilities offered by their underlying
7
7
//! platform.
8
8
use super :: Provide ;
9
+ use crate :: authenticators:: ApplicationName ;
9
10
use derivative:: Derivative ;
10
11
use log:: trace;
11
- use parsec_interface:: operations:: { list_authenticators, list_opcodes, list_providers, ping} ;
12
12
use parsec_interface:: operations:: {
13
- list_authenticators:: AuthenticatorInfo , list_providers:: ProviderInfo ,
13
+ list_authenticators, list_keys, list_opcodes, list_providers, ping,
14
+ } ;
15
+ use parsec_interface:: operations:: {
16
+ list_authenticators:: AuthenticatorInfo , list_keys:: KeyInfo , list_providers:: ProviderInfo ,
14
17
} ;
15
18
use parsec_interface:: requests:: { Opcode , ProviderID , ResponseStatus , Result } ;
16
19
use std:: collections:: { HashMap , HashSet } ;
@@ -20,11 +23,12 @@ use std::sync::Arc;
20
23
use uuid:: Uuid ;
21
24
use version:: { version, Version } ;
22
25
23
- const SUPPORTED_OPCODES : [ Opcode ; 4 ] = [
26
+ const SUPPORTED_OPCODES : [ Opcode ; 5 ] = [
24
27
Opcode :: ListProviders ,
25
28
Opcode :: ListOpcodes ,
26
29
Opcode :: Ping ,
27
30
Opcode :: ListAuthenticators ,
31
+ Opcode :: ListKeys ,
28
32
] ;
29
33
30
34
/// Service information provider
@@ -73,6 +77,22 @@ impl Provide for Provider {
73
77
} )
74
78
}
75
79
80
+ fn list_keys (
81
+ & self ,
82
+ app_name : ApplicationName ,
83
+ _op : list_keys:: Operation ,
84
+ ) -> Result < list_keys:: Result > {
85
+ trace ! ( "list_keys ingress" ) ;
86
+
87
+ let mut keys: Vec < KeyInfo > = Vec :: new ( ) ;
88
+ for provider in & self . prov_list {
89
+ let mut result = provider. list_keys ( app_name. clone ( ) , _op) ?;
90
+ keys. append ( & mut result. keys ) ;
91
+ }
92
+
93
+ Ok ( list_keys:: Result { keys } )
94
+ }
95
+
76
96
fn ping ( & self , _op : ping:: Operation ) -> Result < ping:: Result > {
77
97
trace ! ( "ping ingress" ) ;
78
98
let result = ping:: Result {
0 commit comments