package mock
import "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/mock"
Index ¶
- Constants
- func GetAccessTokenBody(accessToken, idToken, refreshToken, clientInfo string, expiresIn, refreshIn int) []byte
- func GetIDToken(tenant, issuer string) string
- func GetInstanceDiscoveryBody(host, tenant string) []byte
- func GetTenantDiscoveryBody(host, tenant string) []byte
- func NewTestAuthnScheme() authority.AuthenticationScheme
- func WithBody(b []byte) responseOption
- func WithCallback(callback func(*http.Request)) responseOption
- func WithHTTPHeader(header http.Header) responseOption
- func WithHTTPStatusCode(statusCode int) responseOption
- type AuthnSchemeTest
- func (a *AuthnSchemeTest) AccessTokenType() string
- func (a *AuthnSchemeTest) FormatAccessToken(accessToken string) (string, error)
- func (a *AuthnSchemeTest) KeyID() string
- func (a *AuthnSchemeTest) TokenRequestParams() map[string]string
- type Client
Constants ¶
const Authnschemeformat = "%s-formated"
Functions ¶
func GetAccessTokenBody ¶
func GetAccessTokenBody(accessToken, idToken, refreshToken, clientInfo string, expiresIn, refreshIn int) []byte
func GetIDToken ¶
func GetInstanceDiscoveryBody ¶
func GetTenantDiscoveryBody ¶
func NewTestAuthnScheme ¶
func NewTestAuthnScheme() authority.AuthenticationScheme
func WithBody ¶
func WithBody(b []byte) responseOption
WithBody sets the HTTP response's body to the specified value.
func WithCallback ¶
WithCallback sets a callback to invoke before returning the response.
func WithHTTPHeader ¶
WithHTTPHeader sets the HTTP headers of the response to the specified value.
func WithHTTPStatusCode ¶
func WithHTTPStatusCode(statusCode int) responseOption
WithHTTPStatusCode sets the HTTP statusCode of response to the specified value.
Types ¶
type AuthnSchemeTest ¶
type AuthnSchemeTest struct { }
func (*AuthnSchemeTest) AccessTokenType ¶
func (a *AuthnSchemeTest) AccessTokenType() string
func (*AuthnSchemeTest) FormatAccessToken ¶
func (a *AuthnSchemeTest) FormatAccessToken(accessToken string) (string, error)
func (*AuthnSchemeTest) KeyID ¶
func (a *AuthnSchemeTest) KeyID() string
func (*AuthnSchemeTest) TokenRequestParams ¶
func (a *AuthnSchemeTest) TokenRequestParams() map[string]string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a mock HTTP client that returns a sequence of responses. Use AppendResponse to specify the sequence.
func NewClient ¶
func NewClient() *Client
func (*Client) AppendResponse ¶
func (c *Client) AppendResponse(opts ...responseOption)
func (*Client) CloseIdleConnections ¶
func (*Client) CloseIdleConnections()
CloseIdleConnections implements the comm.HTTPClient interface
func (*Client) Do ¶
Source Files ¶
- Version
- v1.4.2 (latest)
- Published
- Mar 26, 2025
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 2 days ago –
Tools for package owners.