{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package oauthtest\n\nPackage oauthtest is a test double for an OAuth token endpoint whose refresh tokens are single-use and rotate, like the real vendors': a refresh token works exactly once, and replaying it is rejected with 400 invalid\\_grant. It counts refreshes so tests can assert that concurrent resolvers (goroutines or separate processes) spend a login exactly once.\n\n## Types\n\n```go\ntype Server struct {\n\t*httptest.Server\n\t// contains filtered or unexported fields\n}\n```\nServer is a rotating-refresh-token endpoint.\n\n```go\nfunc New(initialRefresh string, delay time.Duration, access func(n int) string) *Server\n```\nNew starts a server that accepts initialRefresh once. delay stalls each successful exchange (widening a race window); access mints the access token for the n-th refresh (1-based), nil meaning \"access-\\\u003cn\u003e\".\n\n```go\nfunc (s *Server) Refreshes() int\n```\nRefreshes is the number of successful refresh exchanges.\n\n```go\nfunc (s *Server) Rejected() int\n```\nRejected is the number of refused (replayed or unknown) refresh tokens.\n\n","path":"github.com/memcode-ai/memcode/internal/subscription/oauthtest","name":"oauthtest","synopsis":"Package oauthtest is a test double for an OAuth token endpoint whose refresh tokens are single-use and rotate, like the real vendors': a refresh token works exactly once, and replaying it is rejected with 400 invalid_grant.","isRedistributable":true}
