Exemplo n.º 1
0
func (this *StateHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler) {
	mux.Get("/api/state", negroni.New(
		negroni.HandlerFunc(am.RequireTokenAuthentication),
		negroni.HandlerFunc(this.Get),
	))
	mux.Post("/api/state", negroni.New(
		negroni.HandlerFunc(am.RequireTokenAuthentication),
		negroni.HandlerFunc(this.Post),
	))
}
Exemplo n.º 2
0
func (this *MiddlewareHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler) {
	mux.Get("/api/middleware", negroni.New(
		negroni.HandlerFunc(am.RequireTokenAuthentication),
		negroni.HandlerFunc(this.Redirect),
	))

	mux.Post("/api/middleware", negroni.New(
		negroni.HandlerFunc(am.RequireTokenAuthentication),
		negroni.HandlerFunc(this.Redirect),
	))
}
Exemplo n.º 3
0
func (this *TemplatesHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler) {
	mux.Get("/api/templates", negroni.New(
		negroni.HandlerFunc(am.RequireTokenAuthentication),
		negroni.HandlerFunc(this.Get),
	))

	mux.Delete("/api/templates", negroni.New(
		negroni.HandlerFunc(am.RequireTokenAuthentication),
		negroni.HandlerFunc(this.Delete),
	))

	mux.Post("/api/templates", negroni.New(
		negroni.HandlerFunc(am.RequireTokenAuthentication),
		negroni.HandlerFunc(this.Post),
	))
}
Exemplo n.º 4
0
func (this *AuthHandler) RegisterRoutes(mux *bone.Mux) {

	mux.Post("/api/token-auth", http.HandlerFunc(this.Login))

	mux.Get("/api/refresh-token-auth", negroni.New(
		negroni.HandlerFunc(this.RequireTokenAuthentication),
		negroni.HandlerFunc(this.RefreshToken),
	))
	mux.Get("/api/logout", negroni.New(
		negroni.HandlerFunc(this.RequireTokenAuthentication),
		negroni.HandlerFunc(this.Logout),
	))

	mux.Get("/api/users", negroni.New(
		negroni.HandlerFunc(this.RequireTokenAuthentication),
		negroni.HandlerFunc(this.GetAllUsersHandler),
	))
}