actions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgFacCore  = "core"
	MsgFacAuth  = "auth"
	MsgFacApp   = "app"
	MsgFacUser  = "user"
	MsgFacMesg  = "messaging"
	MsgFacCron  = "scheduler"
	MsgFacSecu  = "security"
	MsgPriEmerg = 0 // RESERVED
	MsgPriAlert = 1 // for alert
	MsgPriCrit  = 2 // FATAL
	MsgPriErr   = 3
	MsgPriWarn  = 4
	MsgPriNote  = 5 // for notification
	MsgPriInfo  = 6
	MsgPriDebug = 7
)

constants for messaging/logging subsystem

Variables

View Source
var (
	ENV = envy.Get("GO_ENV", "development")

	T *i18n.Translator
)

ENV is used to help switch settings based on where the application is being run. Default is "development".

Functions

func App

func App() *buffalo.App

App is where all routes and middleware for buffalo should be defined. This is the nerve center of your application.

func AuthCallback

func AuthCallback(c buffalo.Context) error

AuthCallback is a callback handler for oauth2 authentication

func AuthenticateHandler

func AuthenticateHandler(next buffalo.Handler) buffalo.Handler

AuthenticateHandler protect all application pages from unauthorized access.

func HomeHandler

func HomeHandler(c buffalo.Context) error

HomeHandler is a default handler to serve up a home page.

func LoginAsTester

func LoginAsTester(next buffalo.Handler) buffalo.Handler

LoginAsTester is helper middleware for testing (simulate authcallback)

func LoginHandler

func LoginHandler(c buffalo.Context) error

LoginHandler renders login page

func LogoutHandler

func LogoutHandler(c buffalo.Context) error

LogoutHandler clears all session information and redirects user to root.

Types

type AppClient

type AppClient struct {
	*osin.DefaultClient
	// contains filtered or unexported fields
}

AppClient is struct for storing client information It implements osin.Client by osin.DefaultClient and store app additionally.

func (*AppClient) GetApp

func (c *AppClient) GetApp() *models.App

GetApp returns app model of the client.

type AppsResource

type AppsResource struct {
	buffalo.Resource
}

AppsResource is the resource for the app model

func (AppsResource) Create

func (v AppsResource) Create(c buffalo.Context) error

Create adds a App to the DB.

func (AppsResource) Destroy

func (v AppsResource) Destroy(c buffalo.Context) error

Destroy deletes a app from the DB.

func (AppsResource) Edit

func (v AppsResource) Edit(c buffalo.Context) error

Edit renders a edit formular for a app.

func (AppsResource) Grant

func (v AppsResource) Grant(c buffalo.Context) error

Grant adds a grant for the app to current member and set guest role.

func (AppsResource) List

func (v AppsResource) List(c buffalo.Context) error

List gets all Apps.

func (AppsResource) New

func (v AppsResource) New(c buffalo.Context) error

New renders the formular for creating a new App.

func (AppsResource) Revoke

func (v AppsResource) Revoke(c buffalo.Context) error

Revoke serve /revoke/{app_id} to revoke access grant for the current member

func (AppsResource) Show

func (v AppsResource) Show(c buffalo.Context) error

Show gets the data for one App.

func (AppsResource) Update

func (v AppsResource) Update(c buffalo.Context) error

Update changes a app in the DB.

type CredentialsResource

type CredentialsResource struct {
	buffalo.Resource
}

CredentialsResource is the resource for the credential model

func (CredentialsResource) Destroy

Destroy deletes a credential from the DB.

func (CredentialsResource) List

List gets all Credentials. ! ADMIN PROTECTED

type DocsResource

type DocsResource struct {
	buffalo.Resource
}

DocsResource is the resource for the doc model

func (DocsResource) Create

func (v DocsResource) Create(c buffalo.Context) error

Create adds a Doc to the DB. POST /docs ADMIN PROTECTED

func (DocsResource) Destroy

func (v DocsResource) Destroy(c buffalo.Context) error

Destroy deletes a doc from the DB. DELETE /docs/{doc_id} ADMIN PROTECTED

func (DocsResource) Edit

func (v DocsResource) Edit(c buffalo.Context) error

Edit renders a edit formular for a doc. GET /docs/{doc_id}/edit ADMIN PROTECTED

func (DocsResource) List

func (v DocsResource) List(c buffalo.Context) error

List gets all Docs. GET /docs

func (DocsResource) New

func (v DocsResource) New(c buffalo.Context) error

New renders the formular for creating a new Doc. GET /docs/new ADMIN PROTECTED

func (DocsResource) Publish

func (v DocsResource) Publish(c buffalo.Context) error

Publish marks the document as published. GET /docs/{doc_id}/publish

func (DocsResource) Show

func (v DocsResource) Show(c buffalo.Context) error

Show gets the data for one Doc. GET /docs/{doc_id}

func (DocsResource) Update

func (v DocsResource) Update(c buffalo.Context) error

Update changes a doc in the DB. PUT /docs/{doc_id} ADMIN PROTECTED

type Inventory

type Inventory interface {
	String() string
}

Inventory used as template inventory for messaging subsystem

type MembersResource

type MembersResource struct {
	buffalo.Resource
}

MembersResource is the resource for the member model

func (MembersResource) Destroy

func (v MembersResource) Destroy(c buffalo.Context) error

Destroy deletes a member from the DB. ! ADMIN PROTECTED

func (MembersResource) Edit

Edit renders a edit formular for a member. ! ADMIN PROTECTED

func (MembersResource) List

List gets all Members. ! ADMIN PROTECTED

func (MembersResource) Update

func (v MembersResource) Update(c buffalo.Context) error

Update changes a member in the DB. ! ADMIN PROTECTED TODO: update member's permissions immediately

type MessagesResource

type MessagesResource struct {
	buffalo.Resource
}

MessagesResource is the resource for the message model

func (MessagesResource) Destroy

func (v MessagesResource) Destroy(c buffalo.Context) error

Destroy deletes a message from the DB. DELETE /messages/{message_id} ADMIN PROTECTED

func (MessagesResource) Dismiss

func (v MessagesResource) Dismiss(c buffalo.Context) error

Dismiss changes status of message map. GET /messages/{message_id}/dismiss

func (MessagesResource) List

List gets all Messages. GET /messages

func (MessagesResource) Show

Show gets the data for one Message. GET /messages/{message_id}

type MessagingLogsResource

type MessagingLogsResource struct {
	buffalo.Resource
}

MessagingLogsResource is the resource for the messaging_log model

func (MessagingLogsResource) Destroy

Destroy deletes a messaging_log from the DB. DELETE /messaging_logs/{messaging_log_id} ! ADMIN PROTECTED

func (MessagingLogsResource) List

List gets all MessagingLogs. GET /messaging_logs ! ADMIN PROTECTED

type MessengersResource

type MessengersResource struct {
	buffalo.Resource
}

MessengersResource is the resource for the messenger model

func (MessengersResource) Create

Create adds a Messenger to the DB. POST /messengers

func (MessengersResource) Destroy

func (v MessengersResource) Destroy(c buffalo.Context) error

Destroy deletes a messenger from the DB. DELETE /messengers/{messenger_id}

func (MessengersResource) List

List gets all Messengers. GET /messengers ! ADMIN PROTECTED

func (MessengersResource) SetPrimary

func (v MessengersResource) SetPrimary(c buffalo.Context) error

SetPrimary sets the messenger as primary (and unset others)

func (MessengersResource) Update

Update changes a messenger in the DB. PUT /messengers/{messenger_id}

type Provider

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

Provider handles authentication statuses and connections.

func (*Provider) Clone

func (s *Provider) Clone() osin.Storage

Clone just return it self.

func (*Provider) Close

func (s *Provider) Close()

Close does nothing because there is no clone or additional resources.

func (*Provider) GetClient

func (s *Provider) GetClient(clientID string) (osin.Client, error)

GetClient searches and returns osin.Client instance with clientID. Called by HandleAuthorizeRequest, HandleAccessRequest, ...

func (*Provider) LoadAccess

func (s *Provider) LoadAccess(code string) (*osin.AccessData, error)

LoadAccess read and returns access information from provider storage. Called by HandleInfoRequest to validate access token

func (*Provider) LoadAuthorize

func (s *Provider) LoadAuthorize(code string) (*osin.AuthorizeData, error)

LoadAuthorize read and returns authorize information from provider storage. Called by HandleAccessRequest

func (*Provider) LoadRefresh

func (s *Provider) LoadRefresh(code string) (*osin.AccessData, error)

LoadRefresh is not used yet

func (*Provider) RemoveAccess

func (s *Provider) RemoveAccess(code string) error

RemoveAccess is not used yet

func (*Provider) RemoveAuthorize

func (s *Provider) RemoveAuthorize(code string) error

RemoveAuthorize delete authorize information from provider storage. Called by FinishAccessRequest, after call SaveAccess

func (*Provider) RemoveRefresh

func (s *Provider) RemoveRefresh(code string) error

RemoveRefresh is not used yet

func (*Provider) SaveAccess

func (s *Provider) SaveAccess(data *osin.AccessData) error

SaveAccess stores given access data on the provider storage. Called by FinishAccessRequest, before call RemoveAuthorize

func (*Provider) SaveAuthorize

func (s *Provider) SaveAuthorize(data *osin.AuthorizeData) error

SaveAuthorize stores authorization information into provider storage. Called by FinishAuthorizeRequest

type RoleRequestData

type RoleRequestData struct {
	Member *models.Member
	Role   *models.Role
}

RoleRequestData is inventory set for role request message

func (RoleRequestData) String

func (d RoleRequestData) String() string

type RolesResource

type RolesResource struct {
	buffalo.Resource
}

RolesResource is the resource for the role model

func (RolesResource) Accept

func (v RolesResource) Accept(c buffalo.Context) error

Accept changes the status of assigned role as active

func (RolesResource) Create

func (v RolesResource) Create(c buffalo.Context) error

Create adds a Role to the DB.

func (RolesResource) Destroy

func (v RolesResource) Destroy(c buffalo.Context) error

Destroy deletes a role from the DB.

func (RolesResource) Request

func (v RolesResource) Request(c buffalo.Context) error

Request creates role assignments for the member's request.

func (RolesResource) Retire

func (v RolesResource) Retire(c buffalo.Context) error

Retire remove the role of current user

func (RolesResource) Update

func (v RolesResource) Update(c buffalo.Context) error

Update changes a role in the DB.

Jump to

Keyboard shortcuts

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