Documentation
¶
Index ¶
- Constants
- Variables
- func HashPassword(password []byte) (string, error)
- func VerifyPassword(encoded string, password []byte) bool
- func WithSession(ctx context.Context, session Session) context.Context
- type Service
- func (s *Service) Authenticate(r *http.Request) (Session, error)
- func (s *Service) Login(w http.ResponseWriter, r *http.Request, username, password string) (Session, error)
- func (s *Service) Logout(w http.ResponseWriter, r *http.Request)
- func (s *Service) Reauthenticate(ctx context.Context, username, password string) error
- func (s *Service) ReauthenticateRequest(r *http.Request, username, password string) error
- func (s *Service) RefreshCurrentSession(r *http.Request, user access.User) (Session, error)
- func (s *Service) ValidateCSRF(r *http.Request, session Session) error
- type Session
- type UserStore
Constants ¶
View Source
const CookieName = "ops_deploy_session"
Variables ¶
Functions ¶
func HashPassword ¶
func VerifyPassword ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(config appconfig.SecurityConfig, encodedPasswordHash string) (*Service, error)
func NewServiceWithUsers ¶
func (*Service) Reauthenticate ¶
Reauthenticate verifies the current user's password without issuing a new session. It is used for short-lived access to production credentials.
func (*Service) ReauthenticateRequest ¶
ReauthenticateRequest adds an independent client/user lockout to sensitive operations, so a stolen session cannot be used to brute-force a password.
func (*Service) RefreshCurrentSession ¶
RefreshCurrentSession keeps the caller signed in after a profile-only update while preserving the normal updated_at based invalidation for all other sessions.
Click to show internal directories.
Click to hide internal directories.