Documentation ¶
Index ¶
- func IdentityExists(i Identity) bool
- type ConfigError
- type DiffResult
- type FatalError
- type GitHub
- type GitHubConfig
- type GitHubIdentity
- type GitHubSAMLMapping
- type GroupIdent
- type Identity
- type LDAP
- type LDAPConfig
- type LDAPIdentity
- type Mapping
- type MockIdentity
- type MockService
- type NoneIdentity
- type Service
- type ServiceNotDefined
- type SourceGroupEmptyError
- type Target
- type TargetNotDefined
- type User
- type YAMLGroupIdent
- type YAMLMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IdentityExists ¶
Types ¶
type ConfigError ¶
type ConfigError struct {
// contains filtered or unexported fields
}
func (ConfigError) Error ¶
func (e ConfigError) Error() string
type DiffResult ¶ added in v0.0.4
type FatalError ¶
type FatalError struct {
// contains filtered or unexported fields
}
A wrapper used to let upper layers know the error isn't recoverable.
func (FatalError) Error ¶
func (e FatalError) Error() string
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
func NewGitHub ¶
func NewGitHub(cfg GitHubConfig) *GitHub
type GitHubConfig ¶
type GitHubIdentity ¶
func (GitHubIdentity) String ¶
func (i GitHubIdentity) String() string
type GitHubSAMLMapping ¶
type GitHubSAMLMapping struct { User struct { ID string Name string Email string Login string } SamlIdentity struct { NameID string `graphql:"nameId"` } `graphql:"samlIdentity"` }
GitHubSAMLMapping represents a mapping of a GitHub identity to a SAML identity.
type GroupIdent ¶ added in v0.0.4
type GroupIdent struct {
// contains filtered or unexported fields
}
func ParseGroupIdent ¶ added in v0.0.4
func ParseGroupIdent(str string) (GroupIdent, error)
func (*GroupIdent) GetMembers ¶ added in v0.0.4
func (i *GroupIdent) GetMembers() error
func (GroupIdent) Members ¶ added in v0.0.4
func (i GroupIdent) Members() ([]User, error)
type Identity ¶
type Identity interface { String() string // contains filtered or unexported methods }
type LDAP ¶
type LDAP struct {
// contains filtered or unexported fields
}
LDAP contains the LDAP config and (once established) the active connection to an LDAP server.
func NewLDAP ¶
func NewLDAP(cfg LDAPConfig) *LDAP
NewLDAP creates a new instance of LDAP with the provided configuration.
type LDAPConfig ¶
type LDAPConfig struct { // Connection Port int32 Server string SSL bool SkipVerify bool `mapstructure:"skip_verify"` // Auth BindUser string `mapstructure:"bind_user"` BindPassword string `mapstructure:"bind_password"` // Schema UserBaseDN string `mapstructure:"user_base_dn"` GroupBaseDN string `mapstructure:"group_base_dn"` UserClass string `mapstructure:"user_class"` SearchAttribute string `mapstructure:"search_attribute"` UserIDAttribute string `mapstructure:"user_id_attribute"` }
LDAPConfig contains all the ino needed to connect to (and authenticate with) an LDAP instance, as well as how to fetch group membership data from the particular scheme used.
type LDAPIdentity ¶
type LDAPIdentity struct {
// contains filtered or unexported fields
}
func (LDAPIdentity) String ¶
func (i LDAPIdentity) String() string
type Mapping ¶ added in v0.0.4
type Mapping struct {
// contains filtered or unexported fields
}
A Mapping is a single Mapping of source group(s) onto a target group.
func NewMapping ¶ added in v0.0.4
func NewMapping(src []GroupIdent, tar GroupIdent) Mapping
func (*Mapping) CommitChanges ¶ added in v0.0.4
func (*Mapping) Diff ¶ added in v0.0.4
func (m *Mapping) Diff() (DiffResult, error)
type MockIdentity ¶
type MockIdentity struct {
// contains filtered or unexported fields
}
func (MockIdentity) String ¶
func (i MockIdentity) String() string
type MockService ¶
type MockService struct { }
func (MockService) AddMembers ¶
func (t MockService) AddMembers(users []User) error
func (MockService) GroupMembers ¶
func (t MockService) GroupMembers(group string) ([]User, error)
func (MockService) RemoveMembers ¶
func (t MockService) RemoveMembers(users []User) error
type NoneIdentity ¶
type NoneIdentity struct{}
func (NoneIdentity) String ¶
func (_ NoneIdentity) String() string
type Service ¶
type Service interface { // Get the members of group `group` as a slice of User instances. GroupMembers(group string) ([]User, error) }
Service represents a service that holds information about groups and group memberships.
func SvcFromString ¶
SvcFromString produces a Service object with config taken from the global cfg variable.
type ServiceNotDefined ¶
type ServiceNotDefined struct {
// contains filtered or unexported fields
}
func (ServiceNotDefined) Error ¶
func (e ServiceNotDefined) Error() string
type SourceGroupEmptyError ¶
type SourceGroupEmptyError struct { }
func (SourceGroupEmptyError) Error ¶
func (e SourceGroupEmptyError) Error() string
type Target ¶
type Target interface { AddMembers(team string, users []User) error RemoveMembers(team string, users []User) error // Target implementors should also implement Service. GroupMembers(group string) ([]User, error) // contains filtered or unexported methods }
Target represents a service whose group memberships can be mutated.
func TargetFromString ¶
type TargetNotDefined ¶
type TargetNotDefined struct {
// contains filtered or unexported fields
}
func (TargetNotDefined) Error ¶
func (e TargetNotDefined) Error() string
type User ¶
type User struct {
// contains filtered or unexported fields
}
User is used to identify users by their unique data acquired from services.
type YAMLGroupIdent ¶ added in v0.0.4
YAML
type YAMLMapping ¶ added in v0.0.4
type YAMLMapping struct { Sources []YAMLGroupIdent Users []string Target YAMLGroupIdent }
YAMLMapping is a mapping parsed from a YAML mappings file.
func (YAMLMapping) IntoMapping ¶ added in v0.0.4
func (y YAMLMapping) IntoMapping() Mapping