Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HTMLTemplates = []string{
"auth/decide_method.tmpl",
"auth/fallback_sign_in.tmpl",
"auth/withssb_server_start.tmpl",
}
Functions ¶
This section is empty.
Types ¶
type WithSSBHandler ¶
type WithSSBHandler struct {
// contains filtered or unexported fields
}
WithSSBHandler implements the oauth-like challenge/response dance described in https://ssb-ngi-pointer.github.io/ssb-http-auth-spec
func NewWithSSBHandler ¶
func NewWithSSBHandler( m *mux.Router, r *render.Renderer, netInfo network.ServerEndpointDetails, endpoints network.Endpoints, aliasDB roomdb.AliasesService, membersDB roomdb.MembersService, sessiondb roomdb.AuthWithSSBService, cookies sessions.Store, bridge *signinwithssb.SignalBridge, ) *WithSSBHandler
func (WithSSBHandler) AuthenticateRequest ¶
AuthenticateRequest uses the passed request to load and return the session data that was stored previously. If it is invalid or there is no session, it will return ErrNotAuthorized. Otherwise it will return the member that belongs to the session.
func (WithSSBHandler) DecideMethod ¶
func (h WithSSBHandler) DecideMethod(w http.ResponseWriter, req *http.Request)
this is the /login landing page which branches out to the different methods based on the query parameters that are present
func (WithSSBHandler) Logout ¶
func (h WithSSBHandler) Logout(w http.ResponseWriter, r *http.Request) error
Logout destroys the session data and updates the cookie with an invalidated one.
Click to show internal directories.
Click to hide internal directories.