auth_models

package
v0.1.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMethod added in v0.1.18

type AuthMethod int
const (
	AuthMethodIAP AuthMethod = iota
	AuthMethodGHA
)

type ExtraPermissions

type ExtraPermissions struct {
	Suitable bool `json:"suitable"`
}

type FirecloudAccount

type FirecloudAccount struct {
	Email               string                    `json:"email"`
	AcceptedGoogleTerms bool                      `json:"acceptedGoogleTerms"`
	EnrolledIn2fa       bool                      `json:"enrolledIn2Fa"`
	Suspended           bool                      `json:"suspended"`
	Archived            bool                      `json:"archived"`
	SuspensionReason    string                    `json:"suspensionReason,omitempty"`
	Groups              *FirecloudGroupMembership `json:"groups"`
}

type FirecloudGroupMembership

type FirecloudGroupMembership struct {
	FcAdmins               bool `json:"fc-admins"`
	FirecloudProjectOwners bool `json:"firecloud-project-owners"`
}

type InferredUserFields

type InferredUserFields struct {
	MatchedFirecloudAccount *FirecloudAccount `json:"matchedFirecloudAccount,omitempty"`
	MatchedExtraPermissions *ExtraPermissions `json:"matchedExtraPermissions,omitempty"`
}

type StoredControlledUserFields added in v0.1.17

type StoredControlledUserFields struct {
	Email          string  `json:"email" form:"email" gorm:"not null;default:null;unique"`
	GoogleID       string  `json:"googleID" form:"googleID" gorm:"not null;default:null;unique"`
	GithubUsername *string `json:"githubUsername" form:"githubUsername"`
	GithubID       *string `json:"githubID" form:"githubID"`
}

type StoredMutableUserFields added in v0.1.17

type StoredMutableUserFields struct {
	Name                   *string `json:"name,omitempty" form:"name"`
	NameInferredFromGithub *bool   `json:"nameInferredFromGithub" form:"nameInferredFromGithub"`
}

type User

type User struct {
	ID uint `json:"id" form:"id"`
	StoredControlledUserFields
	StoredMutableUserFields
	InferredUserFields
	AuthMethod AuthMethod `json:"authMethod" form:"authMethod"`
	Via        *User      `json:"via,omitempty" form:"-"`
}

func (*User) AlphaNumericHyphenatedUsername

func (u *User) AlphaNumericHyphenatedUsername() string

func (*User) IsFromAuthMethod added in v0.1.25

func (u *User) IsFromAuthMethod(authMethod AuthMethod) bool

IsFromAuthMethod checks if this User is entirely derived from the provided auth method. This function is recursive on the "Via" User field.

func (*User) SuitableOrError

func (u *User) SuitableOrError() error

func (*User) Username

func (u *User) Username() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL