{"modulePath":"github.com/kernel/hypeman","version":"v0.4.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package tokenrevocation\n\nPackage tokenrevocation rejects specific API tokens before their expiry.\n\nTokens are identified by the hex SHA-256 of the raw token string, so revoking a token does not require it to carry a jti claim and the configuration never holds a usable credential.\n\n## Functions\n\n```go\nfunc Hash(token string) string\n```\nHash returns the hex-encoded SHA-256 of a token string. For an issued token this equals the SHA-256 of the raw string.\n\nThe signature segment is canonicalized first. The JWT parser verifies the decoded signature bytes, not the segment text, and its non-strict base64 decoding accepts other spellings of the same signature (unused trailing bits, embedded CR/LF). Without canonicalization those spellings would verify but hash differently, bypassing revocation.\n\n## Types\n\n```go\ntype List struct {\n\t// contains filtered or unexported fields\n}\n```\nList is a set of revoked token hashes. A nil List revokes nothing.\n\n```go\nfunc New(hashes []string) (*List, error)\n```\nNew builds a List from hex-encoded SHA-256 token hashes.\n\n```go\nfunc (l *List) IsRevoked(token string) bool\n```\nIsRevoked reports whether the raw token string has been revoked.\n\n```go\nfunc (l *List) Len() int\n```\nLen returns the number of revoked token hashes.\n\n","path":"github.com/kernel/hypeman/lib/tokenrevocation","name":"tokenrevocation","synopsis":"Package tokenrevocation rejects specific API tokens before their expiry.","isRedistributable":true}
