diff --git a/modules/distribution/resources/api_templates/velocity_template.xml b/modules/distribution/resources/api_templates/velocity_template.xml index 4732d712ef..715e482c8f 100644 --- a/modules/distribution/resources/api_templates/velocity_template.xml +++ b/modules/distribution/resources/api_templates/velocity_template.xml @@ -31,6 +31,8 @@ #set( $endpointClass = $endpoint_config.get("endpoint_type") ) #set( $endpoints = $endpoint_config.get("${type}_endpoints")) #set( $ep_key = "${endpointKey}_API${type}Endpoint") + #set( $endpointSecurityProd = $endpoint_security.get("production")) + #set( $endpointSecuritySand = $endpoint_security.get("sandbox")) #set( $endpointsecurity = $endpoint_security.get("${type}")) ## IF endpoint secured #if($endpointsecurity.enabled) @@ -346,9 +348,26 @@ $out_sequences.get("$resource.getUriTemplate()").get($uri) #if( $responseCacheEnabled ) #end - #if( $endpointsecurity.type == "oauth" || $endpointsecurity.type == "OAUTH" ) - - #end + #if($apiStatus != 'PROTOTYPED' && ($apiIsOauthProtected || $apiIsApiKeyProtected || $apiIsBasicAuthProtected)) + + + #end + #if($endpointSecurityProd.clientId) + #set( $endpointSecurityProd = $endpoint_security.get("${type}")) + #if($endpointSecurityProd.type == "oauth" || $endpointSecurityProd.type == "OAUTH") + + #end + #end + + + #if($endpointSecuritySand.clientId) + #set( $endpointSecuritySand = $endpoint_security.get("${type}")) + #if($endpointSecuritySand.type == "oauth" || $endpointSecuritySand.type == "OAUTH") + + #end + #end + +