Documentation ¶
Overview ¶
Package testhelpers is for test code that needs to be imported across packages DO NOT use this in production code
Index ¶
- func AddAuthPrincipalToGraphQLClientTest(principal authentication.ApplicationPrincipal) func(*client.Request)
- func AddAuthWithAllJobCodesToGraphQLClientTest(euaID string) func(*client.Request)
- func NewConfig() *viper.Viper
- func NewRequesterPrincipal() authentication.Principal
- func NewReviewerPrincipal() authentication.Principal
- func OktaAccessToken(config *viper.Viper) (string, error)
- type AuthnResponse
- type Embedded
- type Factor
- type FactorLink
- type FactorLinkVerify
- type SettableClock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAuthPrincipalToGraphQLClientTest ¶
func AddAuthPrincipalToGraphQLClientTest(principal authentication.ApplicationPrincipal) func(*client.Request)
AddAuthPrincipalToGraphQLClientTest returns a function to add an auth principal to a graphql client test
func AddAuthWithAllJobCodesToGraphQLClientTest ¶
AddAuthWithAllJobCodesToGraphQLClientTest adds authentication for all job codes
func NewRequesterPrincipal ¶
func NewRequesterPrincipal() authentication.Principal
NewRequesterPrincipal returns what represents an MINT user that is NOT empowered as a Reviewer
func NewReviewerPrincipal ¶
func NewReviewerPrincipal() authentication.Principal
NewReviewerPrincipal returns what represents an MINT user that is empowered as a member of the ADMIN.
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 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