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

Function sessionIndexRevocationKey

samlsp/session_revocation.go:141–148  ·  view source on GitHub ↗

sessionIndexRevocationKey returns the revocation key of the sessions of the user whose NameID has the value nameID with the given SessionIndex.

(nameID, sessionIndex string)

Source from the content-addressed store, hash-verified

139// sessionIndexRevocationKey returns the revocation key of the sessions of
140// the user whose NameID has the value nameID with the given SessionIndex.
141func sessionIndexRevocationKey(nameID, sessionIndex string) string {
142 h := sha256.New()
143 // The length of nameID separates it from sessionIndex unambiguously.
144 _ = binary.Write(h, binary.BigEndian, uint64(len(nameID)))
145 h.Write([]byte(nameID))
146 h.Write([]byte(sessionIndex))
147 return "sessionindex:" + hex.EncodeToString(h.Sum(nil))
148}
149
150// TerminateSessions implements SessionTerminator. It records the sessions
151// that req names in Revocations, where GetSession finds them: every session

Callers 3

TestRevocationKeysFunction · 0.85
TerminateSessionsMethod · 0.85
checkRevokedMethod · 0.85

Calls 2

NewMethod · 0.65
WriteMethod · 0.45

Tested by 1

TestRevocationKeysFunction · 0.68