handlers

package
v0.0.0-...-5a62e24 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2017 License: GPL-3.0 Imports: 14 Imported by: 2

Documentation

Overview

Package handlers implements all HTTP handler functions performing the application's main work when triggered by a request to defined routes and request methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSession

func CreateSession(name string, jwtSignSecret []byte, jwtValidFor time.Duration) (string, error)

CreateSession produces a JSON Web Token (JWT) with authenticated claims based on supplied user values and saves it inside the session storage.

func Index

func Index() gin.HandlerFunc

Index delivers the first page of protokollamt, a login form to authenticate via LDAP.

func IndexLogin

func IndexLogin(sessCreater SessionCreater) gin.HandlerFunc

IndexLogin accepts user supplied LDAP credentials, asks the LDAP service to verify them, and creates a new session for respective user.

func IndexLogout

func IndexLogout() gin.HandlerFunc

IndexLogout destroys the active session of requesting user, logging the user out.

func Mail

func Mail() gin.HandlerFunc

func Pipeline

func Pipeline(dbConner DBConner) gin.HandlerFunc

Pipeline provides an overview list of all configured removal and replacement elements executed during the analysis pipeline.

func PipelineRemovalsAdd

func PipelineRemovalsAdd(dbConner DBConner) gin.HandlerFunc

PipelineRemovalsAdd expects a NewRemovalPayload and adds described removal element to database.

func PipelineRemovalsDelete

func PipelineRemovalsDelete(dbConner DBConner) gin.HandlerFunc

PipelineRemovalsDelete removes the specified removal element from database, if existent.

func PipelineReplacementsAdd

func PipelineReplacementsAdd(dbConner DBConner) gin.HandlerFunc

PipelineReplacementsAdd expects a NewReplacementPayload and adds described replacement element to database.

func PipelineReplacementsDelete

func PipelineReplacementsDelete(dbConner DBConner) gin.HandlerFunc

PipelineReplacementsDelete removes the specified replacement element from database, if existent.

func Protocols

func Protocols(dbConner DBConner) gin.HandlerFunc

Protocols lists the existing meeting protocols and offers a button to upload a new protocol.

func ProtocolsNew

func ProtocolsNew() gin.HandlerFunc

ProtocolsNew delivers the page including the upload form for a new meeting protocol.

func ProtocolsNewUpload

func ProtocolsNewUpload(dbConner DBConner) gin.HandlerFunc

ProtocolsNewUpload processes submitted data for uploading a new meeting protocol.

func ProtocolsSingle

func ProtocolsSingle(dbConner DBConner) gin.HandlerFunc

ProtocolsSingle provides detail and review capabilities for a specific protocol.

func ProtocolsSingleChange

func ProtocolsSingleChange() gin.HandlerFunc

func ProtocolsSinglePublish

func ProtocolsSinglePublish() gin.HandlerFunc

func ProtocolsSingleReprocess

func ProtocolsSingleReprocess() gin.HandlerFunc

Types

type DBConner

type DBConner interface {
	GetDBConn() *gorm.DB
}

DBConner defines the functions needed to retrieve and update values in the database.

type LoginPayload

type LoginPayload struct {
	Name     string `form:"login-name"`
	Password string `form:"login-password"`
}

LoginPayload represents the values an user can supply to protokollamt in order to authenticate against configured LDAP.

type NewProtocolPayload

type NewProtocolPayload struct {
	Date    string `form:"protocol-date"`
	Content string `form:"protocol-content"`
}

NewProtocolPayload represents the form data needed to upload a new internal meeting protocol.

type NewRemovalPayload

type NewRemovalPayload struct {
	StartTag string `form:"removal-start"`
	EndTag   string `form:"removal-end"`
}

NewRemovalPayload represents the form data needed to create a new removal element in the analysis pipeline.

type NewReplacementPayload

type NewReplacementPayload struct {
	SearchString  string `form:"replacement-search"`
	ReplaceString string `form:"replacement-replace"`
}

NewReplacementPayload represents the form data needed to create a new replacement element in the analysis pipeline.

type SessionCreater

type SessionCreater interface {
	GetJWTSigningSecret() string
	GetJWTValidFor() time.Duration
	GetLDAPServiceAddr() string
	GetLDAPServerName() string
	GetLDAPBindDN() string
}

SessionCreater specifies what functionality is needed to communicate with and authenticate against configured LDAP service, and for creating signed session objects.

Jump to

Keyboard shortcuts

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