auth

package
v0.0.0-...-f01c647 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package auth is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountryPermissions

type CountryPermissions map[string]containers.Set[Permission]

type Interface

type Interface interface {
	IsGlobalAdmin() bool
	GetAllowedCountries() containers.StringSet
	HasCountryLevelPermission(countryID string, perm Permission) bool
	HasCountryPermissionWrite(countryID string) bool
	HasCountryPermissionRead(countryID string) bool
}

func New

func New(countryPermissions CountryPermissions, allCountryIDs containers.StringSet, isGlobalAdmin bool) Interface

type MockInterface

type MockInterface struct {
	// contains filtered or unexported fields
}

MockInterface is a mock of Interface interface.

func NewMockInterface

func NewMockInterface(ctrl *gomock.Controller) *MockInterface

NewMockInterface creates a new mock instance.

func (*MockInterface) CanReadWriteToCountryID

func (m *MockInterface) CanReadWriteToCountryID(arg0 string) bool

CanReadWriteToCountryID mocks base method.

func (*MockInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInterface) GetAllowedCountries

func (m *MockInterface) GetAllowedCountries() containers.Set[string]

GetAllowedCountries mocks base method.

func (*MockInterface) IsGlobalAdmin

func (m *MockInterface) IsGlobalAdmin() bool

IsGlobalAdmin mocks base method.

type MockInterfaceMockRecorder

type MockInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockInterfaceMockRecorder is the mock recorder for MockInterface.

func (*MockInterfaceMockRecorder) CanReadWriteToCountryID

func (mr *MockInterfaceMockRecorder) CanReadWriteToCountryID(arg0 interface{}) *gomock.Call

CanReadWriteToCountryID indicates an expected call of CanReadWriteToCountryID.

func (*MockInterfaceMockRecorder) GetAllowedCountries

func (mr *MockInterfaceMockRecorder) GetAllowedCountries() *gomock.Call

GetAllowedCountries indicates an expected call of GetAllowedCountries.

func (*MockInterfaceMockRecorder) IsGlobalAdmin

func (mr *MockInterfaceMockRecorder) IsGlobalAdmin() *gomock.Call

IsGlobalAdmin indicates an expected call of IsGlobalAdmin.

type Permission

type Permission uint8
const (
	PermissionGlobalAdmin Permission = iota
	PermissionWrite
	PermissionRead
)

type Session

type Session interface {
	IsAuthenticated() bool
	GetUserID() string
	GetUserGroups() []string
	GetUserEmail() string
	GetIssuer() string
	GetSubject() string
	GetExpiration() time.Time
	GetIssuedAt() time.Time
	WillExpireIn(duration time.Duration) bool
}

func NewAuthenticatedSession

func NewAuthenticatedSession(
	userGroups []string,
	userEmail string,
	issuer string,
	subject string,
	expiration time.Time,
	issuedAt time.Time,
) Session

Jump to

Keyboard shortcuts

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