2017-09-26 12:50:09 +00:00
|
|
|
package model
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
2017-11-24 05:03:51 +00:00
|
|
|
// Perm control scope
|
|
|
|
const (
|
|
|
|
PermNone = 0
|
|
|
|
PermWrite = 1
|
|
|
|
PermReadWrite = 2
|
|
|
|
)
|
|
|
|
|
2017-11-09 09:16:18 +00:00
|
|
|
// Setting represents the options of swirl.
|
2017-09-26 12:50:09 +00:00
|
|
|
type Setting struct {
|
2018-04-04 10:46:59 +00:00
|
|
|
Version string
|
|
|
|
LDAP struct {
|
2017-11-13 10:49:00 +00:00
|
|
|
Enabled bool `bson:"enabled" json:"enabled,omitempty"`
|
|
|
|
Address string `bson:"address" json:"address,omitempty"`
|
|
|
|
Security int32 `bson:"security" json:"security,omitempty"` // 0-None/1-TLS/2-StartTLS
|
|
|
|
//TLSCert string `bson:"tls_cert" json:"tls_cert,omitempty"` // TLS cert
|
|
|
|
//TLSVerify bool `bson:"tls_verify" json:"tls_verify,omitempty"` // Verify cert
|
2017-11-13 10:16:16 +00:00
|
|
|
Authentication int32 `bson:"auth" json:"auth,omitempty"` // 0-Simple/1-Bind
|
2017-11-09 09:16:18 +00:00
|
|
|
BindDN string `bson:"bind_dn" json:"bind_dn,omitempty"` // DN to bind with
|
|
|
|
BindPassword string `bson:"bind_pwd" json:"bind_pwd,omitempty"` // Bind DN password
|
|
|
|
BaseDN string `bson:"base_dn" json:"base_dn,omitempty"` // Base search path for users
|
|
|
|
UserDN string `bson:"user_dn" json:"user_dn,omitempty"` // Template for the DN of the user for simple auth
|
|
|
|
UserFilter string `bson:"user_filter" json:"user_filter,omitempty"` // Search filter for user
|
|
|
|
NameAttr string `bson:"name_attr" json:"name_attr,omitempty"`
|
|
|
|
EmailAttr string `bson:"email_attr" json:"email_attr,omitempty"`
|
2017-09-26 12:50:09 +00:00
|
|
|
} `bson:"ldap" json:"ldap,omitempty"`
|
|
|
|
TimeZone struct {
|
|
|
|
Name string `bson:"name" json:"name,omitempty"` // Asia/Shanghai
|
|
|
|
Offset int32 `bson:"offset" json:"offset,omitempty"` // seconds east of UTC
|
|
|
|
} `bson:"tz" json:"tz,omitempty"`
|
2018-03-09 11:00:03 +00:00
|
|
|
Language string `bson:"lang" json:"lang,omitempty"`
|
|
|
|
Metrics struct {
|
|
|
|
Prometheus string `bson:"prometheus" json:"prometheus"`
|
|
|
|
} `bson:"metrics" json:"metrics"`
|
2017-09-26 12:50:09 +00:00
|
|
|
UpdatedBy string `bson:"updated_by" json:"updated_by,omitempty"`
|
|
|
|
UpdatedAt time.Time `bson:"updated_at" json:"updated_at,omitempty"`
|
|
|
|
}
|
2017-11-24 05:03:51 +00:00
|
|
|
|
|
|
|
// Perm holds permissions of Docker resource.
|
|
|
|
type Perm struct {
|
|
|
|
ResType string `json:"res_type"`
|
|
|
|
ResID string `json:"res_id"`
|
|
|
|
Scope int32 `json:"scope"`
|
|
|
|
Roles []string `json:"roles"`
|
|
|
|
Users []string `json:"users"`
|
|
|
|
}
|