Documentation ¶
Overview ¶
Package testhelpers is for test code that needs to be imported across packages DO NOT use this in production code
Index ¶
- func NewAction() models.Action
- func NewBusinessCase(systemIntakeID uuid.UUID) models.BusinessCase
- func NewConfig() *viper.Viper
- func NewEstimatedLifecycleCost(opts EstimatedLifecycleCostOptions) models.EstimatedLifecycleCost
- func NewNote() models.SystemIntakeNote
- func NewSystemIntake() models.SystemIntake
- func NewValidLifecycleCosts(id *uuid.UUID) models.EstimatedLifecycleCosts
- func OktaAccessToken(config *viper.Viper) (string, error)
- func RandomEUAID() string
- func RandomEUAIDNull() null.String
- type AuthnResponse
- type Embedded
- type EstimatedLifecycleCostOptions
- type Factor
- type FactorLink
- type FactorLinkVerify
- type SettableClock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBusinessCase ¶
func NewBusinessCase(systemIntakeID uuid.UUID) models.BusinessCase
NewBusinessCase allows us to generate a business case for tests
func NewEstimatedLifecycleCost ¶
func NewEstimatedLifecycleCost(opts EstimatedLifecycleCostOptions) models.EstimatedLifecycleCost
NewEstimatedLifecycleCost helps generate a new lifecycle cost for a given business case
func NewSystemIntake ¶
func NewSystemIntake() models.SystemIntake
NewSystemIntake generates a system intake to use in tests
func NewValidLifecycleCosts ¶
func NewValidLifecycleCosts(id *uuid.UUID) models.EstimatedLifecycleCosts
NewValidLifecycleCosts helps generate valid lifecycle costs for a given business case ready for submission
func OktaAccessToken ¶
OktaAccessToken is a thread safe config retrieval for an access token It only fetches a new token if it hasn't been set already
func RandomEUAIDNull ¶
RandomEUAIDNull returns a random EUA ID for testing, in the form of a null.String
Types ¶
type AuthnResponse ¶
type AuthnResponse struct { StateToken string `json:"stateToken"` Status string `json:"status"` Embedded Embedded `json:"_embedded"` SessionToken string `json:"sessionToken"` }
AuthnResponse is a response marshaled from Okta authn API
type Embedded ¶
type Embedded struct {
Factors []Factor `json:"factors"`
}
Embedded is part of the Okta authn response
type EstimatedLifecycleCostOptions ¶
type EstimatedLifecycleCostOptions struct { BusinessCaseID *uuid.UUID Solution *models.LifecycleCostSolution Phase *models.LifecycleCostPhase Year *models.LifecycleCostYear Cost *int }
EstimatedLifecycleCostOptions allows cost options to be customized
type Factor ¶
type Factor struct { ID string `json:"id"` Provider string `json:"provider"` Link FactorLink `json:"_links"` }
Factor has a challenge factor for MFA
type FactorLink ¶
type FactorLink struct {
Verify FactorLinkVerify `json:"verify"`
}
FactorLink is a wrapper for a challenge link
type FactorLinkVerify ¶
type FactorLinkVerify struct {
HREF string `json:"href"`
}
FactorLinkVerify is the challenge verification link
type SettableClock ¶
SettableClock is a mock clock that can be set
func (*SettableClock) Set ¶
func (c *SettableClock) Set(now time.Time)
Set sets the clock's Now() to the given time