sessionIndexRevocationKey returns the revocation key of the sessions of the user whose NameID has the value nameID with the given SessionIndex.
(nameID, sessionIndex string)
| 139 | // sessionIndexRevocationKey returns the revocation key of the sessions of |
| 140 | // the user whose NameID has the value nameID with the given SessionIndex. |
| 141 | func 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 |