Merge branch 'master' into ev/512

This commit is contained in:
Ev Kontsevoy 2016-11-17 20:29:24 -08:00 committed by GitHub
commit b481739b80
3 changed files with 5 additions and 2 deletions

View file

@ -42,7 +42,7 @@ Run
1. `go get github.com/gravitational/teleport`
2. `cd $GOPATH/src/github.com/gravitational/teleport`
3. `make`
3. `CGO_ENABLED=true make`
If the build was successful the binaries are here: `$GOPATH/src/github.com/gravitational/teleport/build`

View file

@ -454,7 +454,7 @@ func NewSessionResponse(ctx *SessionContext) (*CreateSessionResponse, error) {
Type: roundtrip.AuthBearer,
Token: webSession.WS.BearerToken,
User: user.WebSessionInfo(),
ExpiresIn: int(time.Now().Sub(webSession.WS.Expires) / time.Second),
ExpiresIn: int(webSession.WS.Expires.Sub(time.Now()) / time.Second),
}, nil
}

View file

@ -319,6 +319,9 @@ func (s *WebSuite) authPackFromResponse(c *C, re *roundtrip.Response) *authPack
if err != nil {
panic(err)
}
if session.ExpiresIn < 0 {
c.Errorf("expected expiry time to be in the future but got %v", session.ExpiresIn)
}
return &authPack{
user: session.User.GetName(),
session: session,