Mercurial > gemma
comparison auth/session.go @ 408:ac23905e64b1
Improve WFS proxy a lot. It now generates signed re-writings.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 15 Aug 2018 15:55:41 +0200 |
parents | 4c211ad5349e |
children |
comparison
equal
deleted
inserted
replaced
407:cffd144c99ea | 408:ac23905e64b1 |
---|---|
3 import ( | 3 import ( |
4 "encoding/base64" | 4 "encoding/base64" |
5 "io" | 5 "io" |
6 "time" | 6 "time" |
7 | 7 |
8 "gemma.intevation.de/gemma/common" | |
8 "gemma.intevation.de/gemma/misc" | 9 "gemma.intevation.de/gemma/misc" |
9 ) | 10 ) |
10 | 11 |
11 type Roles []string | 12 type Roles []string |
12 | 13 |
72 return rd.Err | 73 return rd.Err |
73 } | 74 } |
74 | 75 |
75 func GenerateSessionKey() string { | 76 func GenerateSessionKey() string { |
76 return base64.URLEncoding.EncodeToString( | 77 return base64.URLEncoding.EncodeToString( |
77 misc.GenerateRandomKey(sessionKeyLength)) | 78 common.GenerateRandomKey(sessionKeyLength)) |
78 } | 79 } |
79 | 80 |
80 func GenerateSession(user, password string) (string, *Session, error) { | 81 func GenerateSession(user, password string) (string, *Session, error) { |
81 roles, err := AllOtherRoles(user, password) | 82 roles, err := AllOtherRoles(user, password) |
82 if err != nil { | 83 if err != nil { |