Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPolicyNotFound = errors.New("Error: Policy not found")
ErrPolicyNotFound is the error returned if a user can't be found
var ErrUserNotFound = errors.New("Error: User not found")
ErrUserNotFound is the error returned if a user can't be found
var IsDNSNameRegex = regexp.MustCompile(`^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$`)
IsDNSNameRegex is used to verify if a string is a DNS Name (Domain Name)
var SafeString = regexp.MustCompile(`^[a-zA-Z0-9:\-@ !#$^&*().,?]+$`)
Regex's are used to verify the users input
var ValidEmail = regexp.MustCompile(`^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,4}$`)
ValidEmail is a regex used to verify an email is valid
Functions ¶
This section is empty.
Types ¶
type Permissions ¶
type Permissions []string
Permissions contains a list of allowed permissions for a user.
type Policy ¶
type Policy struct { UUID PolicyUUID DisplayName string Payload []PolicyPayload `graphql:",optional"` }
A Policy contains instructions that are send to scoped managed device upon enrollment
type PolicyPayload ¶
type PolicyPayload struct {
DisplayName string
}
PolicyPayload is a raw MDM instruction contain inside a Policy
type PolicyService ¶
type PolicyService interface { GetAll() ([]Policy, error) Get(uuid PolicyUUID) (Policy, error) CreateOrEdit(uuid PolicyUUID, policy Policy) error }
PolicyService contains the implemented functionality for policies
type RawPassword ¶
type RawPassword string
RawPassword is a string that contains the hashed + salted password. This type should NEVER EVER EVER contain a plain text password!!!!!! It is not exposed outside this package to force the use of helpers to keep the password secure!
type User ¶
type User struct { DisplayName string Email string Password RawPassword Activity []Action `graphql:",optional"` // TODO: API Read only Permissions Permissions `graphql:",optional"` // TODO: API Require PERM to change }
A User is either an administrator or end user who owns a managed device.
type UserService ¶
type UserService interface { GetAll() ([]User, error) Get(email string) (User, error) CreateOrEdit(email string, user User) error VerifyLogin(email string, password string) (bool, error) HasPermission(email string, permission string) (bool, error) HashPassword(password []byte) (RawPassword, error) }
UserService contains the implemented functionality for users