Store auth info in a JWT token in a cookie

This commit is contained in:
Ken-Håvard Lieng 2016-01-15 02:27:30 +01:00
parent 3e0a1be6bc
commit fb54d4966c
18 changed files with 499 additions and 331 deletions

View file

@ -21,32 +21,28 @@ func (d directory) LetsEncrypt() string {
return filepath.Join(d.Root(), "letsencrypt")
}
func (d directory) Logs() string {
return filepath.Join(d.Root(), "logs")
}
func (d directory) Log(userID string) string {
return filepath.Join(d.Logs(), userID+".log")
}
func (d directory) Index(userID string) string {
return filepath.Join(d.Logs(), userID+".idx")
}
func (d directory) Users() string {
return filepath.Join(d.Root(), "users")
}
func (d directory) User(userID string) string {
return filepath.Join(d.Users(), userID)
func (d directory) User(username string) string {
return filepath.Join(d.Users(), username)
}
func (d directory) Certificate(userID string) string {
return filepath.Join(d.User(userID), "cert.pem")
func (d directory) Log(username string) string {
return filepath.Join(d.User(username), "log")
}
func (d directory) Key(userID string) string {
return filepath.Join(d.User(userID), "key.pem")
func (d directory) Index(username string) string {
return filepath.Join(d.User(username), "index")
}
func (d directory) Certificate(username string) string {
return filepath.Join(d.User(username), "cert.pem")
}
func (d directory) Key(username string) string {
return filepath.Join(d.User(username), "key.pem")
}
func (d directory) Config() string {
@ -56,3 +52,7 @@ func (d directory) Config() string {
func (d directory) Database() string {
return filepath.Join(d.Root(), "dispatch.db")
}
func (d directory) HMACKey() string {
return filepath.Join(d.Root(), "hmac.key")
}