@@ -46,6 +46,9 @@ type AuthConnectionCreateInput struct {
4646 SaveCredentials bool
4747 NoSaveCredentials bool
4848 HealthCheckInterval int
49+ NoHealthChecks bool
50+ NoAutoReauth bool
51+ RecordSession bool
4952 Output string
5053}
5154
@@ -74,6 +77,9 @@ type AuthConnectionUpdateInput struct {
7477 SaveCredentials BoolFlag
7578 HealthCheckInterval int
7679 HealthCheckIntervalSet bool
80+ HealthChecks BoolFlag
81+ AutoReauth BoolFlag
82+ RecordSession BoolFlag
7783 Output string
7884}
7985
@@ -179,6 +185,18 @@ func (c AuthConnectionCmd) Create(ctx context.Context, in AuthConnectionCreateIn
179185 params .ManagedAuthCreateRequest .SaveCredentials = kernel .Opt (false )
180186 }
181187
188+ if in .NoHealthChecks {
189+ params .ManagedAuthCreateRequest .HealthChecks = kernel .Opt (false )
190+ }
191+
192+ if in .NoAutoReauth {
193+ params .ManagedAuthCreateRequest .AutoReauth = kernel .Opt (false )
194+ }
195+
196+ if in .RecordSession {
197+ params .ManagedAuthCreateRequest .RecordSession = kernel .Opt (true )
198+ }
199+
182200 if in .Output != "json" {
183201 pterm .Info .Printf ("Creating managed auth for %s...\n " , in .Domain )
184202 }
@@ -218,6 +236,9 @@ func printManagedAuthSummary(auth *kernel.ManagedAuth) {
218236 if auth .ProxyID != "" {
219237 tableData = append (tableData , []string {"Proxy ID" , auth .ProxyID })
220238 }
239+ tableData = append (tableData , []string {"Health Checks" , fmt .Sprintf ("%t" , auth .HealthChecks )})
240+ tableData = append (tableData , []string {"Auto Reauth" , fmt .Sprintf ("%t" , auth .AutoReauth )})
241+ tableData = append (tableData , []string {"Record Session" , fmt .Sprintf ("%t" , auth .RecordSession )})
221242 PrintTableNoPad (tableData , true )
222243}
223244
@@ -243,6 +264,18 @@ func (c AuthConnectionCmd) Update(ctx context.Context, in AuthConnectionUpdateIn
243264 params .ManagedAuthUpdateRequest .SaveCredentials = kernel .Opt (in .SaveCredentials .Value )
244265 hasChanges = true
245266 }
267+ if in .HealthChecks .Set {
268+ params .ManagedAuthUpdateRequest .HealthChecks = kernel .Opt (in .HealthChecks .Value )
269+ hasChanges = true
270+ }
271+ if in .AutoReauth .Set {
272+ params .ManagedAuthUpdateRequest .AutoReauth = kernel .Opt (in .AutoReauth .Value )
273+ hasChanges = true
274+ }
275+ if in .RecordSession .Set {
276+ params .ManagedAuthUpdateRequest .RecordSession = kernel .Opt (in .RecordSession .Value )
277+ hasChanges = true
278+ }
246279 if in .AllowedDomainsSet {
247280 params .ManagedAuthUpdateRequest .AllowedDomains = in .AllowedDomains
248281 hasChanges = true
@@ -810,6 +843,9 @@ func init() {
810843 authConnectionsCreateCmd .Flags ().String ("proxy-name" , "" , "Proxy name to use" )
811844 authConnectionsCreateCmd .Flags ().Bool ("no-save-credentials" , false , "Disable saving credentials after successful login" )
812845 authConnectionsCreateCmd .Flags ().Int ("health-check-interval" , 0 , "Interval in seconds between health checks (300-86400)" )
846+ authConnectionsCreateCmd .Flags ().Bool ("no-health-checks" , false , "Disable periodic health checks (also prevents automatic re-auth)" )
847+ authConnectionsCreateCmd .Flags ().Bool ("no-auto-reauth" , false , "Disable automatic re-authentication when a health check detects an expired session" )
848+ authConnectionsCreateCmd .Flags ().Bool ("record-session" , false , "Record browser sessions for this connection by default" )
813849 _ = authConnectionsCreateCmd .MarkFlagRequired ("domain" )
814850 _ = authConnectionsCreateCmd .MarkFlagRequired ("profile-name" )
815851 authConnectionsCreateCmd .MarkFlagsMutuallyExclusive ("credential-name" , "credential-provider" )
@@ -830,8 +866,17 @@ func init() {
830866 authConnectionsUpdateCmd .Flags ().Bool ("save-credentials" , false , "Enable saving credentials after successful login" )
831867 authConnectionsUpdateCmd .Flags ().Bool ("no-save-credentials" , false , "Disable saving credentials after successful login" )
832868 authConnectionsUpdateCmd .Flags ().Int ("health-check-interval" , 0 , "Interval in seconds between health checks" )
869+ authConnectionsUpdateCmd .Flags ().Bool ("health-checks" , false , "Enable periodic health checks" )
870+ authConnectionsUpdateCmd .Flags ().Bool ("no-health-checks" , false , "Disable periodic health checks (also prevents automatic re-auth)" )
871+ authConnectionsUpdateCmd .Flags ().Bool ("auto-reauth" , false , "Enable automatic re-authentication on health check failure" )
872+ authConnectionsUpdateCmd .Flags ().Bool ("no-auto-reauth" , false , "Disable automatic re-authentication" )
873+ authConnectionsUpdateCmd .Flags ().Bool ("record-session" , false , "Record browser sessions for this connection by default" )
874+ authConnectionsUpdateCmd .Flags ().Bool ("no-record-session" , false , "Do not record browser sessions by default" )
833875 authConnectionsUpdateCmd .MarkFlagsMutuallyExclusive ("credential-name" , "credential-provider" )
834876 authConnectionsUpdateCmd .MarkFlagsMutuallyExclusive ("save-credentials" , "no-save-credentials" )
877+ authConnectionsUpdateCmd .MarkFlagsMutuallyExclusive ("health-checks" , "no-health-checks" )
878+ authConnectionsUpdateCmd .MarkFlagsMutuallyExclusive ("auto-reauth" , "no-auto-reauth" )
879+ authConnectionsUpdateCmd .MarkFlagsMutuallyExclusive ("record-session" , "no-record-session" )
835880
836881 // List flags
837882 authConnectionsListCmd .Flags ().StringP ("output" , "o" , "" , "Output format: json for raw API response" )
@@ -887,6 +932,9 @@ func runAuthConnectionsCreate(cmd *cobra.Command, args []string) error {
887932 proxyName , _ := cmd .Flags ().GetString ("proxy-name" )
888933 noSaveCredentials , _ := cmd .Flags ().GetBool ("no-save-credentials" )
889934 healthCheckInterval , _ := cmd .Flags ().GetInt ("health-check-interval" )
935+ noHealthChecks , _ := cmd .Flags ().GetBool ("no-health-checks" )
936+ noAutoReauth , _ := cmd .Flags ().GetBool ("no-auto-reauth" )
937+ recordSession , _ := cmd .Flags ().GetBool ("record-session" )
890938
891939 svc := client .Auth .Connections
892940 c := AuthConnectionCmd {svc : & svc }
@@ -903,6 +951,9 @@ func runAuthConnectionsCreate(cmd *cobra.Command, args []string) error {
903951 ProxyName : proxyName ,
904952 NoSaveCredentials : noSaveCredentials ,
905953 HealthCheckInterval : healthCheckInterval ,
954+ NoHealthChecks : noHealthChecks ,
955+ NoAutoReauth : noAutoReauth ,
956+ RecordSession : recordSession ,
906957 Output : output ,
907958 })
908959}
@@ -942,6 +993,36 @@ func runAuthConnectionsUpdate(cmd *cobra.Command, args []string) error {
942993 saveCredentialsFlag = BoolFlag {Set : true , Value : ! noSaveCredentials }
943994 }
944995
996+ healthChecksFlag := BoolFlag {}
997+ if cmd .Flags ().Changed ("health-checks" ) {
998+ v , _ := cmd .Flags ().GetBool ("health-checks" )
999+ healthChecksFlag = BoolFlag {Set : true , Value : v }
1000+ }
1001+ if cmd .Flags ().Changed ("no-health-checks" ) {
1002+ v , _ := cmd .Flags ().GetBool ("no-health-checks" )
1003+ healthChecksFlag = BoolFlag {Set : true , Value : ! v }
1004+ }
1005+
1006+ autoReauthFlag := BoolFlag {}
1007+ if cmd .Flags ().Changed ("auto-reauth" ) {
1008+ v , _ := cmd .Flags ().GetBool ("auto-reauth" )
1009+ autoReauthFlag = BoolFlag {Set : true , Value : v }
1010+ }
1011+ if cmd .Flags ().Changed ("no-auto-reauth" ) {
1012+ v , _ := cmd .Flags ().GetBool ("no-auto-reauth" )
1013+ autoReauthFlag = BoolFlag {Set : true , Value : ! v }
1014+ }
1015+
1016+ recordSessionFlag := BoolFlag {}
1017+ if cmd .Flags ().Changed ("record-session" ) {
1018+ v , _ := cmd .Flags ().GetBool ("record-session" )
1019+ recordSessionFlag = BoolFlag {Set : true , Value : v }
1020+ }
1021+ if cmd .Flags ().Changed ("no-record-session" ) {
1022+ v , _ := cmd .Flags ().GetBool ("no-record-session" )
1023+ recordSessionFlag = BoolFlag {Set : true , Value : ! v }
1024+ }
1025+
9451026 svc := client .Auth .Connections
9461027 c := AuthConnectionCmd {svc : & svc }
9471028 return c .Update (cmd .Context (), AuthConnectionUpdateInput {
@@ -964,6 +1045,9 @@ func runAuthConnectionsUpdate(cmd *cobra.Command, args []string) error {
9641045 SaveCredentials : saveCredentialsFlag ,
9651046 HealthCheckInterval : healthCheckInterval ,
9661047 HealthCheckIntervalSet : cmd .Flags ().Changed ("health-check-interval" ),
1048+ HealthChecks : healthChecksFlag ,
1049+ AutoReauth : autoReauthFlag ,
1050+ RecordSession : recordSessionFlag ,
9671051 Output : output ,
9681052 })
9691053}
0 commit comments