user.go raw

   1  package account
   2  
   3  // User wraps an NS1 /account/users resource
   4  type User struct {
   5  	// Read-only fields
   6  	LastAccess float64 `json:"last_access"`
   7  	Created    float64 `json:"created"`
   8  
   9  	Name                 string               `json:"name"`
  10  	Username             string               `json:"username"`
  11  	Email                string               `json:"email"`
  12  	TeamIDs              []string             `json:"teams"`
  13  	Notify               NotificationSettings `json:"notify"`
  14  	Permissions          PermissionsMap       `json:"permissions"`
  15  	IPWhitelist          []string             `json:"ip_whitelist"`
  16  	IPWhitelistStrict    bool                 `json:"ip_whitelist_strict"`
  17  	TwoFactorAuthEnabled bool                 `json:"2fa_enabled"`
  18  	InviteToken          string               `json:"invite_token,omitempty"`
  19  	SharedAuth           `json:"shared_auth"`
  20  }
  21  
  22  // NotificationSettings wraps a User's "notify" attribute
  23  type NotificationSettings struct {
  24  	Billing bool `json:"billing"`
  25  }
  26  
  27  // SharedAuth wraps the shared auth object on a User.
  28  type SharedAuth struct {
  29  	SAML `json:"saml"`
  30  }
  31  
  32  // SAML wraps the SAML object in SharedAuth.
  33  type SAML struct {
  34  	SSO bool `json:"sso"`
  35  	IDP `json:"idp"`
  36  }
  37  
  38  // IDP wraps the IDP object in SAML.
  39  type IDP struct {
  40  	UseMetadataURL *bool   `json:"use_metadata_url"`
  41  	MetadataURL    *string `json:"metadata_url"`
  42  	MetadataFile   *string `json:"metadata_file"`
  43  	Provider       *string `json:"provider"`
  44  }
  45