@@ -111,6 +111,85 @@ func newTenant() *schema.Resource {
111111 Optional : true ,
112112 Computed : true ,
113113 },
114+ "idle_session_lifetime" : {
115+ Type : schema .TypeInt ,
116+ Optional : true ,
117+ },
118+ "flags" : {
119+ Type : schema .TypeList ,
120+ Optional : true ,
121+ MaxItems : 1 ,
122+ Elem : & schema.Resource {
123+ Schema : map [string ]* schema.Schema {
124+ "change_pwd_flow_v1" : {
125+ Type : schema .TypeBool ,
126+ Optional : true ,
127+ },
128+ "enable_client_connections" : {
129+ Type : schema .TypeBool ,
130+ Optional : true ,
131+ },
132+ "enable_apis_section" : {
133+ Type : schema .TypeBool ,
134+ Optional : true ,
135+ },
136+ "enable_pipeline2" : {
137+ Type : schema .TypeBool ,
138+ Optional : true ,
139+ },
140+ "enable_dynamic_client_registration" : {
141+ Type : schema .TypeBool ,
142+ Optional : true ,
143+ },
144+ "enable_custom_domain_in_emails" : {
145+ Type : schema .TypeBool ,
146+ Optional : true ,
147+ },
148+ "universal_login" : {
149+ Type : schema .TypeBool ,
150+ Optional : true ,
151+ },
152+ "enable_legacy_logs_search_v2" : {
153+ Type : schema .TypeBool ,
154+ Optional : true ,
155+ },
156+ "disable_clickjack_protection_headers" : {
157+ Type : schema .TypeBool ,
158+ Optional : true ,
159+ },
160+ "enable_public_signup_user_exists_error" : {
161+ Type : schema .TypeBool ,
162+ Optional : true ,
163+ },
164+ },
165+ },
166+ },
167+ "universal_login" : {
168+ Type : schema .TypeList ,
169+ Optional : true ,
170+ MaxItems : 1 ,
171+ Elem : & schema.Resource {
172+ Schema : map [string ]* schema.Schema {
173+ "colors" : {
174+ Type : schema .TypeList ,
175+ Optional : true ,
176+ MaxItems : 1 ,
177+ Elem : & schema.Resource {
178+ Schema : map [string ]* schema.Schema {
179+ "primary" : {
180+ Type : schema .TypeString ,
181+ Optional : true ,
182+ },
183+ "page_background" : {
184+ Type : schema .TypeString ,
185+ Optional : true ,
186+ },
187+ },
188+ },
189+ },
190+ },
191+ },
192+ },
114193 },
115194 }
116195}
@@ -165,6 +244,39 @@ func readTenant(d *schema.ResourceData, m interface{}) error {
165244 d .Set ("allowed_logout_urls" , t .AllowedLogoutURLs )
166245 d .Set ("session_lifetime" , t .SessionLifetime )
167246 d .Set ("sandbox_version" , t .SandboxVersion )
247+ d .Set ("idle_session_lifetime" , t .IdleSessionLifetime )
248+
249+ if flags := t .Flags ; flags != nil {
250+ d .Set ("flags" , []map [string ]interface {}{
251+ {
252+ "change_pwd_flow_v1" : flags .ChangePasswordFlowV1 ,
253+ "enable_client_connections" : flags .EnableClientConnections ,
254+ "enable_apis_section" : flags .EnableAPIsSection ,
255+ "enable_pipeline2" : flags .EnablePipeline2 ,
256+ "enable_dynamic_client_registration" : flags .EnableDynamicClientRegistration ,
257+ "enable_custom_domain_in_emails" : flags .EnableCustomDomainInEmails ,
258+ "universal_login" : flags .UniversalLogin ,
259+ "enable_legacy_logs_search_v2" : flags .EnableLegacyLogsSearchV2 ,
260+ "disable_clickjack_protection_headers" : flags .DisableClickjackProtectionHeaders ,
261+ "enable_public_signup_user_exists_error" : flags .EnablePublicSignupUserExistsError ,
262+ },
263+ })
264+ }
265+
266+ if universalLogin := t .UniversalLogin ; universalLogin != nil {
267+ if colors := universalLogin .Colors ; colors != nil {
268+ d .Set ("universal_login" , []map [string ]interface {}{
269+ {
270+ "colors" : []map [string ]interface {}{
271+ {
272+ "primary" : universalLogin .Colors .Primary ,
273+ "page_background" : universalLogin .Colors .PageBackground ,
274+ },
275+ },
276+ },
277+ })
278+ }
279+ }
168280
169281 return nil
170282}
@@ -186,15 +298,16 @@ func deleteTenant(d *schema.ResourceData, m interface{}) error {
186298
187299func buildTenant (d * schema.ResourceData ) * management.Tenant {
188300 t := & management.Tenant {
189- DefaultAudience : String (d , "default_audience" ),
190- DefaultDirectory : String (d , "default_directory" ),
191- FriendlyName : String (d , "friendly_name" ),
192- PictureURL : String (d , "picture_url" ),
193- SupportEmail : String (d , "support_email" ),
194- SupportURL : String (d , "support_url" ),
195- AllowedLogoutURLs : Slice (d , "allowed_logout_urls" ),
196- SessionLifetime : Int (d , "session_lifetime" ),
197- SandboxVersion : String (d , "sandbox_version" ),
301+ DefaultAudience : String (d , "default_audience" ),
302+ DefaultDirectory : String (d , "default_directory" ),
303+ FriendlyName : String (d , "friendly_name" ),
304+ PictureURL : String (d , "picture_url" ),
305+ SupportEmail : String (d , "support_email" ),
306+ SupportURL : String (d , "support_url" ),
307+ AllowedLogoutURLs : Slice (d , "allowed_logout_urls" ),
308+ SessionLifetime : Int (d , "session_lifetime" ),
309+ SandboxVersion : String (d , "sandbox_version" ),
310+ IdleSessionLifetime : Int (d , "idle_session_lifetime" ),
198311 }
199312
200313 List (d , "change_password" ).First (func (v interface {}) {
@@ -225,5 +338,36 @@ func buildTenant(d *schema.ResourceData) *management.Tenant {
225338 }
226339 })
227340
341+ List (d , "flags" ).First (func (v interface {}) {
342+ m := v .(map [string ]interface {})
343+
344+ t .Flags = & management.TenantFlags {
345+ ChangePasswordFlowV1 : Bool (MapData (m ), "change_pwd_flow_v1" ),
346+ EnableClientConnections : Bool (MapData (m ), "enable_client_connections" ),
347+ EnableAPIsSection : Bool (MapData (m ), "enable_apis_section" ),
348+ EnablePipeline2 : Bool (MapData (m ), "enable_pipeline2" ),
349+ EnableDynamicClientRegistration : Bool (MapData (m ), "enable_dynamic_client_registration" ),
350+ EnableCustomDomainInEmails : Bool (MapData (m ), "enable_custom_domain_in_emails" ),
351+ UniversalLogin : Bool (MapData (m ), "universal_login" ),
352+ EnableLegacyLogsSearchV2 : Bool (MapData (m ), "enable_legacy_logs_search_v2" ),
353+ DisableClickjackProtectionHeaders : Bool (MapData (m ), "disable_clickjack_protection_headers" ),
354+ EnablePublicSignupUserExistsError : Bool (MapData (m ), "enable_public_signup_user_exists_error" ),
355+ }
356+ })
357+
358+ List (d , "universal_login" ).First (func (v interface {}) {
359+ m := v .(map [string ]interface {})
360+
361+ t .UniversalLogin = & management.TenantUniversalLogin {}
362+
363+ List (MapData (m ), "colors" ).First (func (v interface {}) {
364+ m := v .(map [string ]interface {})
365+ t .UniversalLogin .Colors = & management.TenantUniversalLoginColors {
366+ Primary : String (MapData (m ), "primary" ),
367+ PageBackground : String (MapData (m ), "page_background" ),
368+ }
369+ })
370+ })
371+
228372 return t
229373}
0 commit comments