1+ /* eslint-disable max-len */
2+
13const { defaults } = require ( 'lodash' ) ;
24
35const instance = require ( '../helpers/weak_cache' ) ;
@@ -15,20 +17,12 @@ module.exports = function discoveryAction(provider) {
1517 id_token_signing_alg_values_supported : config . idTokenSigningAlgValues ,
1618 issuer : provider . issuer ,
1719 jwks_uri : ctx . oidc . urlFor ( 'certificates' ) ,
18- registration_endpoint : config . features . registration
19- ? ctx . oidc . urlFor ( 'registration' ) : undefined ,
20- request_object_signing_alg_values_supported :
21- config . features . request || config . features . requestUri
22- ? config . requestObjectSigningAlgValues : undefined ,
20+ registration_endpoint : config . features . registration ? ctx . oidc . urlFor ( 'registration' ) : undefined ,
21+ request_object_signing_alg_values_supported : config . features . request || config . features . requestUri ? config . requestObjectSigningAlgValues : undefined ,
2322 request_parameter_supported : ! ! config . features . request ,
2423 request_uri_parameter_supported : ! ! config . features . requestUri ,
25- require_request_uri_registration : config . features . requestUri
26- && config . features . requestUri . requireRequestUriRegistration ? true : undefined ,
27- response_modes_supported : [
28- 'form_post' ,
29- 'fragment' ,
30- 'query' ,
31- ] ,
24+ require_request_uri_registration : config . features . requestUri && config . features . requestUri . requireRequestUriRegistration ? true : undefined ,
25+ response_modes_supported : [ 'form_post' , 'fragment' , 'query' ] ,
3226 response_types_supported : config . responseTypes ,
3327 scopes_supported : config . scopes ,
3428 subject_types_supported : config . subjectTypes ,
@@ -37,26 +31,27 @@ module.exports = function discoveryAction(provider) {
3731 token_endpoint_auth_signing_alg_values_supported : config . tokenEndpointAuthSigningAlgValues ,
3832 userinfo_endpoint : ctx . oidc . urlFor ( 'userinfo' ) ,
3933 userinfo_signing_alg_values_supported : config . userinfoSigningAlgValues ,
40- code_challenge_methods_supported : config . features . pkce
41- ? config . features . pkce . supportedMethods : undefined ,
34+ code_challenge_methods_supported : config . features . pkce ? config . features . pkce . supportedMethods : undefined ,
4235 } ;
4336
4437 if ( config . features . webMessageResponseMode ) {
4538 ctx . body . response_modes_supported . push ( 'web_message' ) ;
4639 }
4740
4841 if ( config . features . introspection ) {
49- const prefix = 'introspection_endpoint' ;
5042 ctx . body . introspection_endpoint = ctx . oidc . urlFor ( 'introspection' ) ;
51- ctx . body [ `${ prefix } _auth_methods_supported` ] = config . introspectionEndpointAuthMethods ;
52- ctx . body [ `${ prefix } _auth_signing_alg_values_supported` ] = config . introspectionEndpointAuthSigningAlgValues ;
43+ ctx . body . introspection_endpoint_auth_methods_supported = config . introspectionEndpointAuthMethods ;
44+ ctx . body . introspection_endpoint_auth_signing_alg_values_supported = config . introspectionEndpointAuthSigningAlgValues ;
45+ }
46+
47+ if ( config . features . jwtIntrospection ) {
48+ ctx . body . introspection_endpoint_signing_alg_values_supported = config . introspectionSigningAlgValues ;
5349 }
5450
5551 if ( config . features . revocation ) {
56- const prefix = 'revocation_endpoint' ;
5752 ctx . body . revocation_endpoint = ctx . oidc . urlFor ( 'revocation' ) ;
58- ctx . body [ ` ${ prefix } _auth_methods_supported` ] = config . revocationEndpointAuthMethods ;
59- ctx . body [ ` ${ prefix } _auth_signing_alg_values_supported` ] = config . revocationEndpointAuthSigningAlgValues ;
53+ ctx . body . revocation_endpoint_auth_methods_supported = config . revocationEndpointAuthMethods ;
54+ ctx . body . revocation_endpoint_auth_signing_alg_values_supported = config . revocationEndpointAuthSigningAlgValues ;
6055 }
6156
6257 if ( config . features . encryption ) {
@@ -65,10 +60,14 @@ module.exports = function discoveryAction(provider) {
6560 ctx . body . userinfo_encryption_alg_values_supported = config . userinfoEncryptionAlgValues ;
6661 ctx . body . userinfo_encryption_enc_values_supported = config . userinfoEncryptionEncValues ;
6762
63+ if ( config . features . jwtIntrospection ) {
64+ ctx . body . introspection_encryption_alg_values_supported = config . introspectionEncryptionAlgValues ;
65+ ctx . body . introspection_encryption_enc_values_supported = config . introspectionEncryptionEncValues ;
66+ }
67+
6868 if ( config . features . request || config . features . requestUri ) {
69- const prefix = 'request_object_encryption' ;
70- ctx . body [ `${ prefix } _alg_values_supported` ] = config . requestObjectEncryptionAlgValues ;
71- ctx . body [ `${ prefix } _enc_values_supported` ] = config . requestObjectEncryptionEncValues ;
69+ ctx . body . request_object_encryption_alg_values_supported = config . requestObjectEncryptionAlgValues ;
70+ ctx . body . request_object_encryption_enc_values_supported = config . requestObjectEncryptionEncValues ;
7271 }
7372 }
7473
0 commit comments