local

package
v0.0.0-...-b3f093e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMockUserData

func GetMockUserData() []*models.UserInfo

GetMockUserData returns a slice of *models.UserInfo that represents a response from the Okta server. Most of the data here is generated randomly, though some of it was curated specifically for the purpose of making tests pass.

func NewLocalAuthenticationMiddleware

func NewLocalAuthenticationMiddleware(store *storage.Store) func(http.Handler) http.Handler

NewLocalAuthenticationMiddleware stubs out context info for local (non-Okta) authentication

func NewOktaAPIClient

func NewOktaAPIClient() *client

NewOktaAPIClient returns an Okta API client that returns mock data

Types

type CedarEasiClient

type CedarEasiClient struct{}

CedarEasiClient mocks the CEDAR Easi client for local/test use

func NewCedarEasiClient

func NewCedarEasiClient() *CedarEasiClient

NewCedarEasiClient returns a fake CEDAR Easi Client

func (*CedarEasiClient) CheckConnection

func (c *CedarEasiClient) CheckConnection(context.Context) error

CheckConnection tries to verify if we are able to communicate with the CEDAR API

func (*CedarEasiClient) ValidateAndSubmitSystemIntake

func (c *CedarEasiClient) ValidateAndSubmitSystemIntake(ctx context.Context, intake *models.SystemIntake) (string, error)

ValidateAndSubmitSystemIntake submits a system intake to CEDAR

type DevUserConfig

type DevUserConfig struct {
	EUA      string   `json:"euaId"`
	JobCodes []string `json:"jobCodes"`
}

DevUserConfig is the set of values that can be passed in a request header

type SMTPSender

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

SMTPSender is a basic email sender that connects to an SMTP server; use with MailCatcher for testing locally

func NewSMTPSender

func NewSMTPSender(serverAddress string) SMTPSender

NewSMTPSender configures and returns an SMTPSender for local testing

func (SMTPSender) Send

func (sender SMTPSender) Send(ctx context.Context, toAddresses []models.EmailAddress, ccAddresses []models.EmailAddress, subject string, body string) error

Send sends and logs an email

type Sender

type Sender struct {
}

Sender is a mock email sender for local environments

func NewSender

func NewSender() Sender

NewSender returns a fake email sender

func (Sender) Send

func (s Sender) Send(ctx context.Context, toAddresses []models.EmailAddress, ccAddresses []models.EmailAddress, subject string, body string) error

Send logs an email

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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