@@ -8,21 +8,33 @@ const joi = require('joi')
8
8
* The plugin options scheme
9
9
*/
10
10
const scheme = joi . object ( {
11
- realmUrl : joi . string ( ) . uri ( ) . required ( ) ,
12
- clientId : joi . string ( ) . min ( 1 ) . required ( ) ,
13
- secret : joi . string ( ) . min ( 1 ) ,
11
+ realmUrl : joi . string ( ) . uri ( ) . required ( )
12
+ . description ( 'The absolute uri of the Keycloak realm' )
13
+ . example ( 'https://localhost:8080/auth/realms/testme' ) ,
14
+ clientId : joi . string ( ) . min ( 1 ) . required ( )
15
+ . description ( 'The identifier of the Keycloak client/application' )
16
+ . example ( 'foobar' ) ,
17
+ secret : joi . string ( ) . min ( 1 )
18
+ . description ( 'The related secret of the Keycloak client/application' )
19
+ . example ( '1234-bar-4321-foo' ) ,
14
20
publicKey : joi . alternatives ( ) . try (
15
21
joi . string ( ) . regex ( / ^ - - - - - B E G I N (?: R S A ) ? P U B L I C K E Y - - - - - [ \s \S ] * - - - - - E N D (?: R S A ) ? P U B L I C K E Y - - - - - \s ? $ / ig, 'PEM' ) ,
16
22
joi . object ( ) . type ( Buffer ) ,
17
23
joi . object ( {
18
24
kty : joi . string ( ) . required ( )
19
25
} ) . unknown ( true )
20
- ) ,
21
- minTimeBetweenJwksRequests : joi . number ( ) . integer ( ) . positive ( ) . allow ( 0 ) . default ( 0 ) ,
26
+ ) . description ( 'The related public key of the Keycloak client/application' ) ,
27
+ minTimeBetweenJwksRequests : joi . number ( ) . integer ( ) . positive ( ) . allow ( 0 ) . default ( 0 )
28
+ . description ( 'The minimum time between JWKS requests in seconds' )
29
+ . example ( 15 ) ,
22
30
cache : joi . alternatives ( ) . try ( joi . object ( {
23
31
segment : joi . string ( ) . default ( 'keycloakJwt' )
24
- } ) , joi . boolean ( ) ) . default ( false ) ,
32
+ } ) , joi . boolean ( ) ) . default ( false )
33
+ . description ( 'The configuration of the hapi.js cache powered by catbox' )
34
+ . example ( 'true' ) ,
25
35
userInfo : joi . array ( ) . items ( joi . string ( ) . min ( 1 ) )
36
+ . description ( 'List of properties which should be included in the `request.auth.credentials` object' )
37
+ . example ( [ 'name' , 'email' ] )
26
38
} )
27
39
. nand ( 'secret' , 'publicKey' )
28
40
. required ( )
0 commit comments