Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
id
go-sso
Commits
7c359bdb
Commit
7c359bdb
authored
Nov 16, 2018
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log keystore.Open on successful login
parent
a7e8bbce
Pipeline
#1561
passed with stages
in 1 minute and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
server/http.go
server/http.go
+6
-2
No files found.
server/http.go
View file @
7c359bdb
...
...
@@ -146,15 +146,17 @@ func New(loginService *LoginService, authClient authclient.Client, config *Confi
}
func
(
h
*
Server
)
loginCallback
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
,
username
,
password
string
,
userinfo
*
auth
.
UserInfo
)
error
{
log
.
Printf
(
"successful login for user %s"
,
username
)
// Open the keystore for this user with the password used to
// authenticate. Set the TTL to the duration of the
// authenticated session.
var
kmsg
string
if
h
.
keystore
!=
nil
{
var
shard
string
if
userinfo
!=
nil
{
shard
=
userinfo
.
Shard
kmsg
=
fmt
.
Sprintf
(
" (unlocked key on shard %s)"
,
shard
)
}
else
{
kmsg
=
" (unlocked key)"
}
if
err
:=
h
.
keystore
.
Open
(
req
.
Context
(),
shard
,
username
,
password
,
int
(
h
.
authSessionLifetime
.
Seconds
()));
err
!=
nil
{
log
.
Printf
(
"failed to unlock keystore for user %s: %v"
,
username
,
err
)
...
...
@@ -162,6 +164,8 @@ func (h *Server) loginCallback(w http.ResponseWriter, req *http.Request, usernam
}
}
log
.
Printf
(
"successful login for user %s%s"
,
username
,
kmsg
)
// Create cookie-based session for the authenticated user.
session
:=
newAuthSession
(
h
.
authSessionLifetime
,
username
,
userinfo
)
httpSession
,
_
:=
h
.
authSessionStore
.
Get
(
req
,
authSessionKey
)
// nolint
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment