mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
Improve test coverage. (#8)
* Improve test coverage. * Remove unused http status code argument from SignInPageMethod. * Removed log package in internal packages. * Add test to check https scheme is used for authorization url. * Add unit tests for global logging package.
This commit is contained in:
parent
5a75ace403
commit
56c89e8653
14 changed files with 478 additions and 105 deletions
|
@ -5,11 +5,9 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/aead"
|
||||
"github.com/pomerium/pomerium/internal/log"
|
||||
)
|
||||
|
||||
// ErrInvalidSession is an error for invalid sessions.
|
||||
|
@ -85,9 +83,6 @@ func (s *CookieStore) makeCookie(req *http.Request, name string, value string, e
|
|||
domain = h
|
||||
}
|
||||
if s.CookieDomain != "" {
|
||||
if !strings.HasSuffix(domain, s.CookieDomain) {
|
||||
log.Warn().Str("cookie-domain", s.CookieDomain).Msg("using configured cookie domain")
|
||||
}
|
||||
domain = s.CookieDomain
|
||||
}
|
||||
|
||||
|
@ -145,7 +140,6 @@ func (s *CookieStore) LoadSession(req *http.Request) (*SessionState, error) {
|
|||
}
|
||||
session, err := UnmarshalSession(c.Value, s.CookieCipher)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("remote-host", req.Host).Msg("error unmarshaling session")
|
||||
return nil, ErrInvalidSession
|
||||
}
|
||||
return session, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue