github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/identity/v3.0/security/GetLoginAuthPolicy.go (about)

     1  package security
     2  
     3  import (
     4  	golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  )
     7  
     8  func GetLoginAuthPolicy(client *golangsdk.ServiceClient, id string) (*LoginPolicy, error) {
     9  	// GET  /v3.0/OS-SECURITYPOLICY/domains/{domain_id}/login-policy
    10  	raw, err := client.Get(client.ServiceURL("OS-SECURITYPOLICY", "domains", id, "login-policy"), nil, nil)
    11  	if err != nil {
    12  		return nil, err
    13  	}
    14  
    15  	var res LoginPolicy
    16  	err = extract.IntoStructPtr(raw.Body, &res, "login_policy")
    17  	return &res, err
    18  }
    19  
    20  type LoginPolicy struct {
    21  	// Validity period (days) to disable users if they have not logged in within the period. Value range: 0-240.
    22  	// Validity period (days) to disable users if they have not logged in within the period.
    23  	// If this parameter is set to 0, no users will be disabled.
    24  	AccountValidityPeriod *int `json:"account_validity_period"`
    25  	// Custom information that will be displayed upon successful login.
    26  	CustomInfoForLogin string `json:"custom_info_for_login"`
    27  	// Duration (minutes) to lock users out.
    28  	LockoutDuration int `json:"lockout_duration"`
    29  	// Number of unsuccessful login attempts to lock users out.
    30  	LoginFailedTimes int `json:"login_failed_times"`
    31  	// Period (minutes) to count the number of unsuccessful login attempts.
    32  	PeriodWithLoginFailures int `json:"period_with_login_failures"`
    33  	// Session timeout (minutes) that will apply if you or users created using your account
    34  	// do not perform any operations within a specific period.
    35  	SessionTimeout int `json:"session_timeout"`
    36  	// Indicates whether to display last login information upon successful login.
    37  	ShowRecentLoginInfo *bool `json:"show_recent_login_info"`
    38  }