MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / Clone

Method Clone

internal/oauth/session.go:55–67  ·  view source on GitHub ↗

Clone returns a deep-enough copy that fosite handlers can mutate the returned session without affecting the original. Required by the fosite.Session interface contract — fosite calls Clone() before handing a session to a handler that may extend it.

()

Source from the content-addressed store, hash-verified

53// fosite.Session interface contract — fosite calls Clone() before
54// handing a session to a handler that may extend it.
55func (s *Session) Clone() fosite.Session {
56 if s == nil {
57 return nil
58 }
59 cp := *s
60 if s.ExpiresAtMap != nil {
61 cp.ExpiresAtMap = make(map[fosite.TokenType]time.Time, len(s.ExpiresAtMap))
62 for k, v := range s.ExpiresAtMap {
63 cp.ExpiresAtMap[k] = v
64 }
65 }
66 return &cp
67}
68
69// Compile-time check.
70var _ fosite.Session = (*Session)(nil)

Callers 4

SubscriberReceiverFunction · 0.80
WebhookReceiverFunction · 0.80
ServeHTTPMethod · 0.80
handleOAuthConsentMethod · 0.80

Calls 1

makeFunction · 0.85

Tested by

no test coverage detected