Documentation ¶
Index ¶
- Constants
- func DOOPS(c buffalo.Context, form string, data ...interface{}) error
- func GenRSAKeyPair() (*rsa.PrivateKey, []byte, error)
- func GetIntParam(c buffalo.Context, key string, min, max int) (i int)
- func GetParam(c buffalo.Context, key string) interface{}
- func GetStringParam(c buffalo.Context, key, failback string) (val string)
- func InvalidAccess(c buffalo.Context, url, form string, data ...interface{}) error
- func NewRS256AccessTokenGen(issuer, key string) osin.AccessTokenGen
- func OOPS(c buffalo.Context, ec int, url, dom, form string, data ...interface{}) error
- func SOOPS(c buffalo.Context, form string, data ...interface{}) error
- func UARTAdmins(tx *pop.Connection) *models.Members
- type RS256AccessTokenGen
Constants ¶
const ( ErrKeyGen = "key generation error" ErrPubKey = "public Key marshalling error" )
constants for error code
Variables ¶
This section is empty.
Functions ¶
func DOOPS ¶
DOOPS make a log for database error and return redirect.
form: format of the log message data...: arguments for log message
func GenRSAKeyPair ¶
func GenRSAKeyPair() (*rsa.PrivateKey, []byte, error)
GenRSAKeyPair generates and returns RSA private key, public pem with error
func GetIntParam ¶
GetIntParam extracts and returns an integer value from request parameter. if the parameter is not exist or smaller than min or larger than max, it returns min value.
func GetStringParam ¶
GetStringParam extracts and returns a string value from request parameter. if the parameter is not exist, it returns failback value.
func InvalidAccess ¶
InvalidAccess make a log for system error and return redirect
url: url redirect to form: format of the log message data...: arguments for log message
func NewRS256AccessTokenGen ¶
func NewRS256AccessTokenGen(issuer, key string) osin.AccessTokenGen
NewRS256AccessTokenGen returns RS256AccessTokenGen as osin.AccessTokenGen
func SOOPS ¶
SOOPS make a log for system error and return redirect
form: format of the log message data...: arguments for log message
func UARTAdmins ¶
func UARTAdmins(tx *pop.Connection) *models.Members
UARTAdmins returns registered administrators of UART app.
Types ¶
type RS256AccessTokenGen ¶
type RS256AccessTokenGen struct { Issuer string PrivateKey *rsa.PrivateKey }
RS256AccessTokenGen is JWT access token generator
func (RS256AccessTokenGen) GenerateAccessToken ¶
func (g RS256AccessTokenGen) GenerateAccessToken(data *osin.AccessData, refresh bool) (string, string, error)
GenerateAccessToken implementation for JWT