Documentation
¶
Index ¶
- type KV
- func (k *KV) Client() *redis.Client
- func (k *KV) Consume(ctx context.Context, key string) ([]byte, bool, error)
- func (k *KV) Del(ctx context.Context, key string) error
- func (k *KV) Get(ctx context.Context, key string) ([]byte, bool, error)
- func (k *KV) Incr(ctx context.Context, key string, ttl time.Duration) (int64, error)
- func (k *KV) Prefix() string
- func (k *KV) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
- type SIWSCache
- func (c *SIWSCache) Consume(ctx context.Context, nonce string) (siws.ChallengeData, bool, error)
- func (c *SIWSCache) Del(ctx context.Context, nonce string) error
- func (c *SIWSCache) Get(ctx context.Context, nonce string) (siws.ChallengeData, bool, error)
- func (c *SIWSCache) Put(ctx context.Context, nonce string, data siws.ChallengeData) error
- type StateCache
- func (s *StateCache) Consume(ctx context.Context, state string) (oidckit.StateData, bool, error)
- func (s *StateCache) Del(ctx context.Context, state string) error
- func (s *StateCache) Get(ctx context.Context, state string) (oidckit.StateData, bool, error)
- func (s *StateCache) Put(ctx context.Context, state string, data oidckit.StateData) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
KV is the Redis ephemeral store. Every key is namespaced by prefix (#307) so several AuthKit deployments can share one Redis database without colliding.
type SIWSCache ¶
type SIWSCache struct {
// contains filtered or unexported fields
}
SIWSCache stores pending SIWS challenges in Redis.
func NewSIWSCache ¶
NewSIWSCache creates a new Redis-backed SIWS challenge cache. NewSIWSCache stores SIWS challenges under keyPrefix (the deployment namespace plus "siws:nonce:", #307).
func (*SIWSCache) Consume ¶
Consume atomically retrieves and deletes a challenge (single-use). Redis GETDEL guarantees only one concurrent caller receives the value, so a replayed SIWS signature can't reuse the same nonce within the challenge TTL.
type StateCache ¶
type StateCache struct {
// contains filtered or unexported fields
}
func NewStateCache ¶
NewStateCache stores OIDC state under keyPrefix (the deployment namespace plus "oidc:state:", #307).
func (*StateCache) Consume ¶
Consume atomically returns and deletes the state via Redis GETDEL, closing the replay/TOCTOU window a separate Get+Del leaves open. ok=false if absent/consumed.