Documentation
¶
Index ¶
- Constants
- type Cache
- func (c *Cache) Available() bool
- func (c *Cache) DeleteChallenge(ctx context.Context, challengeID string) error
- func (c *Cache) GetChallenge(ctx context.Context, challengeID string) (*ChallengeCacheEntry, error)
- func (c *Cache) IsStepUsed(ctx context.Context, factorID string, timeStep int64) (bool, error)
- func (c *Cache) MarkStepUsed(ctx context.Context, factorID string, timeStep int64, ttl time.Duration) error
- func (c *Cache) SetChallenge(ctx context.Context, entry *ChallengeCacheEntry, ttl time.Duration) error
- type ChallengeCacheEntry
Constants ¶
View Source
const (
// SubNamespace is the plugin sub-namespace within GoModularAuth cache keys.
SubNamespace = "twofactor"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache wraps the core cache adapter for the twofactor plugin.
func (*Cache) DeleteChallenge ¶
DeleteChallenge removes an MFA challenge from cache upon consumption.
func (*Cache) GetChallenge ¶
GetChallenge retrieves an MFA challenge from cache.
func (*Cache) IsStepUsed ¶
IsStepUsed checks whether a specific time-step for a factor was already seen in the cache.
func (*Cache) MarkStepUsed ¶
func (c *Cache) MarkStepUsed(ctx context.Context, factorID string, timeStep int64, ttl time.Duration) error
MarkStepUsed sets an ephemeral replay marker in the cache for a specific factor time-step.
func (*Cache) SetChallenge ¶
func (c *Cache) SetChallenge(ctx context.Context, entry *ChallengeCacheEntry, ttl time.Duration) error
SetChallenge caches a short-lived MFA challenge.
Click to show internal directories.
Click to hide internal directories.