auth

package
v0.0.55 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheExtraPermissions

func CacheExtraPermissions()

func CacheFirecloudAccounts

func CacheFirecloudAccounts(ctx context.Context) error

func FakeUserMiddleware

func FakeUserMiddleware() gin.HandlerFunc

func IapUserMiddleware

func IapUserMiddleware() gin.HandlerFunc

func KeepCacheUpdated

func KeepCacheUpdated(ctx context.Context, interval time.Duration)

Types

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 User

type User struct {
	AuthenticatedEmail      string            `json:"authenticatedEmail"`
	MatchedFirecloudAccount *FirecloudAccount `json:"matchedFirecloudAccount,omitempty"`
	MatchedExtraPermissions *ExtraPermissions `json:"matchedExtraPermissions,omitempty"`
	// contains filtered or unexported fields
}

func ExtractUserFromContext

func ExtractUserFromContext(ctx *gin.Context) (*User, error)

ExtractUserFromContext is the counterpart to the middlewares provided by this package: handlers can call it to extract a User from the context.

func GenerateUser

func GenerateUser(t *testing.T, suitable bool) *User

func (*User) AlphaNumericHyphenatedUsername

func (u *User) AlphaNumericHyphenatedUsername() string

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