11package org .avni .server .web ;
22
3+ import com .fasterxml .jackson .annotation .JsonProperty ;
34import org .avni .server .config .AvniKeycloakConfig ;
45import org .avni .server .config .CognitoConfig ;
56import org .avni .server .config .IdpType ;
@@ -32,6 +33,9 @@ public class AuthDetailsController {
3233 @ Value ("${avni.copilot.enabled}" )
3334 private boolean copilotEnabled ;
3435
36+ @ JsonProperty ("show_templates" )
37+ private boolean showTemplates ;
38+
3539 @ Autowired
3640 public AuthDetailsController (AvniKeycloakConfig avniKeycloakConfig , AdapterConfig adapterConfig , CognitoConfig cognitoConfig ) {
3741 this .avniKeycloakConfig = avniKeycloakConfig ;
@@ -54,7 +58,7 @@ public CompositeIDPDetails getIDPDetails() {
5458 String cognitoConfigClientId = cognitoConfig .getClientId ();
5559 return new AuthDetailsController .CompositeIDPDetails ( keycloakAuthServerUrl , keycloakClientId ,
5660 keycloakGrantType , keycloakScope , avniKeycloakConfig .getRealm (), cognitoConfigPoolId ,
57- cognitoConfigClientId , idpType , webAppTimeoutInMinutes , avniEnvironment , avniMcpServerUrl , copilotEnabled );
61+ cognitoConfigClientId , idpType , webAppTimeoutInMinutes , avniEnvironment , avniMcpServerUrl , copilotEnabled , showTemplates );
5862 }
5963
6064 public static class CompositeIDPDetails {
@@ -64,11 +68,11 @@ public static class CompositeIDPDetails {
6468 private final Cognito cognito ;
6569
6670 public CompositeIDPDetails ( String authServerUrl , String keycloakClientId , String grantType , String scope , String keycloakRealm ,
67- String poolId , String clientId , IdpType idpType , int webAppTimeoutInMinutes , String avniEnvironment , String avniMcpServerUrl , boolean copilotEnabled ) {
71+ String poolId , String clientId , IdpType idpType , int webAppTimeoutInMinutes , String avniEnvironment , String avniMcpServerUrl , boolean copilotEnabled , boolean showTemplates ) {
6872 this .idpType = idpType ;
6973 this .keycloak = new Keycloak (authServerUrl , keycloakClientId , grantType , scope , keycloakRealm );
7074 this .cognito = new Cognito (poolId , clientId );
71- this .genericConfig = new GenericConfig (webAppTimeoutInMinutes , avniEnvironment , avniMcpServerUrl , copilotEnabled );
75+ this .genericConfig = new GenericConfig (webAppTimeoutInMinutes , avniEnvironment , avniMcpServerUrl , copilotEnabled , showTemplates );
7276 }
7377
7478 public Keycloak getKeycloak () {
@@ -146,12 +150,14 @@ public static class GenericConfig {
146150 private final String avniEnvironment ;
147151 private final String avniMcpServerUrl ;
148152 private final boolean copilotEnabled ;
153+ private final boolean showTemplates ;
149154
150- public GenericConfig (int webAppTimeoutInMinutes , String avniEnvironment , String avniMcpServerUrl , boolean copilotEnabled ) {
155+ public GenericConfig (int webAppTimeoutInMinutes , String avniEnvironment , String avniMcpServerUrl , boolean copilotEnabled , boolean showTemplates ) {
151156 this .webAppTimeoutInMinutes = webAppTimeoutInMinutes ;
152157 this .avniEnvironment = avniEnvironment ;
153158 this .avniMcpServerUrl = avniMcpServerUrl ;
154159 this .copilotEnabled = copilotEnabled ;
160+ this .showTemplates = showTemplates ;
155161 }
156162
157163 public int getWebAppTimeoutInMinutes () {
@@ -169,6 +175,10 @@ public String getAvniMcpServerUrl() {
169175 public boolean isCopilotEnabled () {
170176 return copilotEnabled ;
171177 }
178+
179+ public boolean isShowTemplates () {
180+ return showTemplates ;
181+ }
172182 }
173183 }
174184}
0 commit comments