controllers

package
v0.0.0-...-db47865 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionInfo

type SessionInfo struct {
	Identity            string // user identity (email)
	Issuer              string // Name of the connection
	EnableNotifications bool
	FullyAuthenticated  bool   // Whether authentication fully complies with requirement (ie MFA)
	SessionExpiry       int64  // Unix timestamp
	IconURL             string // LOGOURL
}

type UserController

type UserController struct {
	// contains filtered or unexported fields
}

func New

func New(db *gorm.DB, config *models.Config, notificationsManager *services.NotificationsManager) *UserController

New creates an instance of the controller and sets its DB handle

func (*UserController) GetPushSubscriptionKey

func (u *UserController) GetPushSubscriptionKey(w http.ResponseWriter, r *http.Request)

func (*UserController) GetSessionInfo

func (u *UserController) GetSessionInfo(w http.ResponseWriter, r *http.Request)

func (*UserController) Logout

func (u *UserController) Logout(w http.ResponseWriter, r *http.Request)

func (*UserController) RefreshAuth

func (u *UserController) RefreshAuth(w http.ResponseWriter, r *http.Request)

RefreshAuth is called by the browser worker when it receives a push notification asking it to do so. The push notification is triggered by a VPN connection attempt when there is valid VPN "session". If we still have a valid web session, we can notify the VPN controller to create a new VPN session transparently and accept the connection attempt.

func (*UserController) RegisterPushSubscription

func (u *UserController) RegisterPushSubscription(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL