MCPcopy Create free account
hub / github.com/crewjam/saml / NewMemoryReplayCache

Function NewMemoryReplayCache

samlsp/replay_cache.go:54–62  ·  view source on GitHub ↗

NewMemoryReplayCache returns a MemoryReplayCache that holds at most maxEntries unexpired assertion IDs. It panics if maxEntries is not positive.

(maxEntries int)

Source from the content-addressed store, hash-verified

52// NewMemoryReplayCache returns a MemoryReplayCache that holds at most
53// maxEntries unexpired assertion IDs. It panics if maxEntries is not positive.
54func NewMemoryReplayCache(maxEntries int) *MemoryReplayCache {
55 if maxEntries <= 0 {
56 panic(fmt.Sprintf("samlsp: NewMemoryReplayCache: maxEntries must be positive, got %d", maxEntries))
57 }
58 return &MemoryReplayCache{
59 maxEntries: maxEntries,
60 entries: map[string]time.Time{},
61 }
62}
63
64// Consume implements saml.AssertionReplayCache.
65func (c *MemoryReplayCache) Consume(assertionID string, expiresAt time.Time) error {

Calls

no outgoing calls