Documentation
¶
Index ¶
- Constants
- Variables
- func App() *buffalo.App
- func AuthCallback(c buffalo.Context) error
- func AuthenticateHandler(next buffalo.Handler) buffalo.Handler
- func HomeHandler(c buffalo.Context) error
- func LoginAsTester(next buffalo.Handler) buffalo.Handler
- func LoginHandler(c buffalo.Context) error
- func LogoutHandler(c buffalo.Context) error
- type AppClient
- type AppsResource
- func (v AppsResource) Create(c buffalo.Context) error
- func (v AppsResource) Destroy(c buffalo.Context) error
- func (v AppsResource) Edit(c buffalo.Context) error
- func (v AppsResource) Grant(c buffalo.Context) error
- func (v AppsResource) List(c buffalo.Context) error
- func (v AppsResource) New(c buffalo.Context) error
- func (v AppsResource) Revoke(c buffalo.Context) error
- func (v AppsResource) Show(c buffalo.Context) error
- func (v AppsResource) Update(c buffalo.Context) error
- type CredentialsResource
- type DocsResource
- func (v DocsResource) Create(c buffalo.Context) error
- func (v DocsResource) Destroy(c buffalo.Context) error
- func (v DocsResource) Edit(c buffalo.Context) error
- func (v DocsResource) List(c buffalo.Context) error
- func (v DocsResource) New(c buffalo.Context) error
- func (v DocsResource) Publish(c buffalo.Context) error
- func (v DocsResource) Show(c buffalo.Context) error
- func (v DocsResource) Update(c buffalo.Context) error
- type Inventory
- type MembersResource
- type MessagesResource
- type MessagingLogsResource
- type MessengersResource
- func (v MessengersResource) Create(c buffalo.Context) error
- func (v MessengersResource) Destroy(c buffalo.Context) error
- func (v MessengersResource) List(c buffalo.Context) error
- func (v MessengersResource) SetPrimary(c buffalo.Context) error
- func (v MessengersResource) Update(c buffalo.Context) error
- type Provider
- func (s *Provider) Clone() osin.Storage
- func (s *Provider) Close()
- func (s *Provider) GetClient(clientID string) (osin.Client, error)
- func (s *Provider) LoadAccess(code string) (*osin.AccessData, error)
- func (s *Provider) LoadAuthorize(code string) (*osin.AuthorizeData, error)
- func (s *Provider) LoadRefresh(code string) (*osin.AccessData, error)
- func (s *Provider) RemoveAccess(code string) error
- func (s *Provider) RemoveAuthorize(code string) error
- func (s *Provider) RemoveRefresh(code string) error
- func (s *Provider) SaveAccess(data *osin.AccessData) error
- func (s *Provider) SaveAuthorize(data *osin.AuthorizeData) error
- type RoleRequestData
- type RolesResource
- func (v RolesResource) Accept(c buffalo.Context) error
- func (v RolesResource) Create(c buffalo.Context) error
- func (v RolesResource) Destroy(c buffalo.Context) error
- func (v RolesResource) Request(c buffalo.Context) error
- func (v RolesResource) Retire(c buffalo.Context) error
- func (v RolesResource) Update(c buffalo.Context) error
Constants ¶
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 ¶
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 ¶
App is where all routes and middleware for buffalo should be defined. This is the nerve center of your application.
func AuthCallback ¶
AuthCallback is a callback handler for oauth2 authentication
func AuthenticateHandler ¶
AuthenticateHandler protect all application pages from unauthorized access.
func HomeHandler ¶
HomeHandler is a default handler to serve up a home page.
func LoginAsTester ¶
LoginAsTester is helper middleware for testing (simulate authcallback)
func LogoutHandler ¶
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.
type AppsResource ¶
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) 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
type CredentialsResource ¶
CredentialsResource is the resource for the credential model
type DocsResource ¶
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
type Inventory ¶
type Inventory interface {
String() string
}
Inventory used as template inventory for messaging subsystem
type MembersResource ¶
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 ¶
func (v MembersResource) Edit(c buffalo.Context) error
Edit renders a edit formular for a member. ! ADMIN PROTECTED
type MessagesResource ¶
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
type MessagingLogsResource ¶
MessagingLogsResource is the resource for the messaging_log model
type MessengersResource ¶
MessengersResource is the resource for the messenger model
func (MessengersResource) Create ¶
func (v MessengersResource) Create(c buffalo.Context) error
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 ¶
func (v MessengersResource) List(c buffalo.Context) error
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)
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider handles authentication statuses and connections.
func (*Provider) Close ¶
func (s *Provider) Close()
Close does nothing because there is no clone or additional resources.
func (*Provider) GetClient ¶
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 ¶
RemoveAccess is not used yet
func (*Provider) RemoveAuthorize ¶
RemoveAuthorize delete authorize information from provider storage. Called by FinishAccessRequest, after call SaveAccess
func (*Provider) RemoveRefresh ¶
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 ¶
RoleRequestData is inventory set for role request message
func (RoleRequestData) String ¶
func (d RoleRequestData) String() string
type RolesResource ¶
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.