auth

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StatusInternal                = gstatus.New(codes.Internal, "auth: internal")
	StatusMissingCode             = gstatus.New(codes.InvalidArgument, "auth: code must not be empty")
	StatusMissingState            = gstatus.New(codes.InvalidArgument, "auth: state must not be empty")
	StatusMissingAuthType         = gstatus.New(codes.InvalidArgument, "auth: missing authType")
	StatusUnknownAuthType         = gstatus.New(codes.InvalidArgument, "auth: unknown authType")
	StatusMissingRedirectURL      = gstatus.New(codes.InvalidArgument, "auth: missing redirectURL")
	StatusUnregisteredRedirectURL = gstatus.New(codes.InvalidArgument, "auth: unregistered redirectURL")
	StatusMissingRefreshToken     = gstatus.New(codes.InvalidArgument, "auth: refreshToken must not be empty")
	StatusInvalidCode             = gstatus.New(codes.InvalidArgument, "auth: invalid code")
	StatusInvalidRefreshToken     = gstatus.New(codes.InvalidArgument, "auth: invalid refresh token")
	StatusUnapprovedAccount       = gstatus.New(codes.PermissionDenied, "auth: unapproved account")
	StatusAccessDeniedEmail       = gstatus.New(codes.PermissionDenied, "auth: access denied email")
	StatusUnauthenticated         = gstatus.New(codes.Unauthenticated, "auth: not authenticated")
	StateMissingUsername          = gstatus.New(codes.InvalidArgument, "auth: missing username")
	StateMissingPassword          = gstatus.New(codes.InvalidArgument, "auth: missing password")
	StatusAccessDenied            = gstatus.New(codes.PermissionDenied, "auth: access denied")
)

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Login(
		ctx context.Context,
		state, redirectURL string,
	) (string, error)
	Exchange(
		ctx context.Context,
		code, redirectURL string,
	) (*UserInfo, error)
}

type DemoSignInConfig

type DemoSignInConfig struct {
	Enabled                bool   `json:"enabled"`
	Password               string `json:"password"`
	Email                  string `json:"email"`
	OrganizationId         string `json:"organizationId"`
	OrganizationOwnerEmail string `json:"organizationOwnerEmail"`
	ProjectId              string `json:"projectId"`
	EnvironmentId          string `json:"environmentId"`
	IsSystemAdmin          bool   `json:"isSystemAdmin"`
}

type GoogleConfig

type GoogleConfig struct {
	Issuer       string   `json:"issuer"`
	ClientID     string   `json:"clientId"`
	ClientSecret string   `json:"clientSecret"`
	RedirectURLs []string `json:"redirectUrls"`
}

type OAuthConfig

type OAuthConfig struct {
	Issuer       string           `json:"issuer"`
	Audience     string           `json:"audience"`
	GoogleConfig GoogleConfig     `json:"google"`
	DemoSignIn   DemoSignInConfig `json:"demoSignIn"`
}

type UserInfo

type UserInfo struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Avatar    string `json:"avatar"`
	Email     string `json:"email"`
}

Directories

Path Synopsis
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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