Versions in this module Expand all Collapse all v0 v0.14.0 Apr 24, 2024 Changes in this version type RemoteTokenStoreOption + ContextPath string + Scheme string v0.13.0 Feb 27, 2024 Changes in this version + const CLIRecordModeFlag + const CheckTokenPath + const DefaultHTTPDuration + const DefaultHost + var BodySanitizers = map[string]ValueSanitizer + var FuzzyRequestHeaders = utils.NewStringSet("Authorization") + var FuzzyRequestJsonPaths = utils.NewStringSet() + var FuzzyRequestQueries = utils.NewStringSet("password", "secret", "nonce", "token", "access_token") + var FuzzyResponseHeaders = utils.NewStringSet("Date") + var FuzzyResponseJsonPaths = utils.NewStringSet("$..access_token") + var HeaderSanitizers = map[string]ValueSanitizer + var IgnoredRequestHeaders = utils.NewStringSet(xInteractionIndexHeader) + var QuerySanitizers = map[string]ValueSanitizer + func AdditionalMatcherOptions(ctx context.Context, opts ...RecordMatcherOptions) + func Client(ctx context.Context) *http.Client + func ConvertCassetteFileV1toV2(src, dest string) error + func FixedDurationHook(duration time.Duration) func(i *cassette.Interaction) error + func InteractionIndexAwareHook() func(i *cassette.Interaction) error + func IsRecording(ctx context.Context) bool + func LocalhostRewriteHook() func(i *cassette.Interaction) error + func NewRemoteTokenStoreReader(opts ...RemoteTokenStoreOptions) oauth2.TokenStoreReader + func PackageHttpRecordingMode() suitetest.PackageOptions + func SanitizingHook() func(i *cassette.Interaction) error + func WithHttpPlayback(t *testing.T, opts ...HTTPVCROptions) test.Options + func WithRecordedScopes() test.Options + type GenericMatcherFunc func(O, R) error + func NewRecordHeaderMatcher(fuzzyKeys ...string) GenericMatcherFunc[http.Header, http.Header] + func NewRecordMatcher(opts ...RecordMatcherOptions) GenericMatcherFunc[*http.Request, cassette.Request] + func NewRecordQueryMatcher(fuzzyKeys ...string) GenericMatcherFunc[url.Values, url.Values] + func NewRecordURLMatcher(ignoreHost bool) GenericMatcherFunc[*url.URL, *url.URL] + type HTTPVCROption struct + Hooks []RecorderHook + Mode Mode + Name string + RealTransport http.RoundTripper + RecordMatching []RecordMatcherOptions + SavePath string + SkipRequestLatency bool + type HTTPVCROptions func(opt *HTTPVCROption) + func ApplyHttpLatency() HTTPVCROptions + func DisableHttpRecordOrdering() HTTPVCROptions + func DisableHttpRecordingMode() HTTPVCROptions + func HttpRecordIgnoreHost() HTTPVCROptions + func HttpRecordMatching(opts ...RecordMatcherOptions) HTTPVCROptions + func HttpRecordName(name string) HTTPVCROptions + func HttpRecorderHooks(hooks ...RecorderHook) HTTPVCROptions + func HttpRecordingMode() HTTPVCROptions + func HttpTransport(transport *http.Transport) HTTPVCROptions + type HttpRecorder struct + Matcher cassette.MatcherFunc + Options *HTTPVCROption + RawOptions *recorder.Options + func NewHttpRecorder(opts ...HTTPVCROptions) (*HttpRecorder, error) + type Mode int + const ModeCommandline + const ModeRecording + const ModeReplaying + type RecordBodyMatcher interface + Matches func(out []byte, record []byte) error + Support func(contentType string) bool + func NewRecordFormBodyMatcher(fuzzyKeys ...string) RecordBodyMatcher + func NewRecordJsonBodyMatcher(fuzzyJsonPaths ...string) RecordBodyMatcher + func NewRecordLiteralBodyMatcher() RecordBodyMatcher + type RecordBodyMatcherFunc GenericMatcherFunc[[]byte, []byte] + type RecordFormBodyMatcher GenericMatcherFunc[[]byte, []byte] + func (m RecordFormBodyMatcher) Matches(out []byte, record []byte) error + func (m RecordFormBodyMatcher) Support(contentType string) bool + type RecordHeaderMatcherFunc GenericMatcherFunc[http.Header, http.Header] + type RecordJsonBodyMatcher GenericMatcherFunc[[]byte, []byte] + func (m RecordJsonBodyMatcher) Matches(out []byte, record []byte) error + func (m RecordJsonBodyMatcher) Support(contentType string) bool + type RecordLiteralBodyMatcher GenericMatcherFunc[[]byte, []byte] + func (m RecordLiteralBodyMatcher) Matches(out []byte, record []byte) error + func (m RecordLiteralBodyMatcher) Support(_ string) bool + type RecordMatcherFunc GenericMatcherFunc[*http.Request, cassette.Request] + type RecordMatcherOption struct + BodyMatchers []RecordBodyMatcher + FuzzyHeaders []string + FuzzyJsonPaths []string + FuzzyPostForm []string + FuzzyQueries []string + HeaderMatcher RecordHeaderMatcherFunc + IgnoreHost bool + QueryMatcher RecordQueryMatcherFunc + URLMatcher RecordURLMatcherFunc + type RecordMatcherOptions func(opt *RecordMatcherOption) + func FuzzyForm(formKeys ...string) RecordMatcherOptions + func FuzzyHeaders(headers ...string) RecordMatcherOptions + func FuzzyJsonPaths(jsonPaths ...string) RecordMatcherOptions + func FuzzyQueries(queries ...string) RecordMatcherOptions + func IgnoreHost() RecordMatcherOptions + type RecordQueryMatcherFunc GenericMatcherFunc[url.Values, url.Values] + type RecordURLMatcherFunc GenericMatcherFunc[*url.URL, *url.URL] + type RecorderDI struct + HTTPVCROption *HTTPVCROption + Recorder *recorder.Recorder + RecorderMatcher cassette.MatcherFunc + RecorderOption *recorder.Options + type RecorderHook interface + Handler func() recorder.HookFunc + Kind func() recorder.HookKind + func NewRecorderHook(fn recorder.HookFunc, kind recorder.HookKind) RecorderHook + func NewRecorderHookWithOrder(fn recorder.HookFunc, kind recorder.HookKind, order int) RecorderHook + type RemoteTokenStoreOption struct + BaseUrl string + ClientId string + ClientSecret string + HttpClient httpclient.Client + HttpClientConfig *httpclient.ClientConfig + JwtDecoder jwt.JwtDecoder + ServiceName string + SkipRemoteCheck bool + type RemoteTokenStoreOptions func(opt *RemoteTokenStoreOption) + type RemoteTokenStoreReader struct + ClientId string + ClientSecret string + HttpClient httpclient.Client + JwtDecoder jwt.JwtDecoder + SkipRemoteCheck bool + func (r *RemoteTokenStoreReader) ReadAccessToken(ctx context.Context, value string) (oauth2.AccessToken, error) + func (r *RemoteTokenStoreReader) ReadAuthentication(ctx context.Context, tokenValue string, hint oauth2.TokenHint) (oauth2.Authentication, error) + func (r *RemoteTokenStoreReader) ReadRefreshToken(ctx context.Context, value string) (oauth2.RefreshToken, error) + type V1Cassette struct + Interactions []V1Interaction + Version int + type V1Interaction struct + Request map[string]interface{} + Response map[string]interface{} + type V2Cassette struct + Interactions []V2Interaction + Version int + type V2Interaction struct + ID int + Request map[string]interface{} + Response map[string]interface{} + type ValueSanitizer func(any) any + func DefaultValueSanitizer() ValueSanitizer + func RegExpValueSanitizer(regex, repl string) ValueSanitizer + func SubstituteValueSanitizer(repl any) ValueSanitizer