NewMemoryReplayCache returns a MemoryReplayCache that holds at most maxEntries unexpired assertion IDs. It panics if maxEntries is not positive.
(maxEntries int)
| 52 | // NewMemoryReplayCache returns a MemoryReplayCache that holds at most |
| 53 | // maxEntries unexpired assertion IDs. It panics if maxEntries is not positive. |
| 54 | func 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. |
| 65 | func (c *MemoryReplayCache) Consume(assertionID string, expiresAt time.Time) error { |
no outgoing calls