Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dchest/authcookie
/ functions
Functions
12 in github.com/dchest/authcookie
⨍
Functions
12
◇
Types & classes
0
↓ 6 callers
Function
New
New returns a signed authentication cookie for the given login, expiration time, and secret key. If the login is empty, the function returns an empty
authcookie.go:83
↓ 4 callers
Function
newCookie
(login string, expires time.Time, secret []byte, noPadding bool)
authcookie.go:92
↓ 3 callers
Function
Login
Login returns a valid login extracted from the given cookie and verified using the given secret key. If verification fails or the cookie expired, the
authcookie.go:175
↓ 3 callers
Function
Parse
Parse verifies the given cookie with the secret key and returns login and expiration time extracted from the cookie. If the cookie fails verification
authcookie.go:133
↓ 2 callers
Function
getSignature
(b []byte, secret []byte)
authcookie.go:67
↓ 1 callers
Function
NewNoPadding
NewNoPadding is like New but returns cookie encoded without base64 padding characters.
authcookie.go:88
Function
NewSinceNow
NewSinceNow returns a signed authetication cookie for the given login, duration since current time, and secret key.
authcookie.go:114
Function
NewSinceNowNoPadding
NewSinceNowNoPadding is like NewSinceNow but returns a cookie without base64 padding characters.
authcookie.go:119
Function
TestLogin
(t *testing.T)
authcookie_test.go:76
Function
TestNew
(t *testing.T)
authcookie_test.go:8
Function
TestNewNoPadding
(t *testing.T)
authcookie_test.go:22
Function
TestParse
(t *testing.T)
authcookie_test.go:36