Documentation
¶
Index ¶
- Variables
- func CleanString(in string) string
- func GetCommonMiddleware() *negroni.Negroni
- func GetJWTMiddleware() *jwtmiddleware.JWTMiddleware
- func GetProtectionMiddleware() *negroni.Negroni
- func GetUserScopes(user string) (scopes []string)
- func LoadConfig()
- func PrepareMiddleware()
- func PrintErrors(errMsg string, errs []error) bool
- func ProfileFromToken(r *http.Request) map[string]interface{}
- func RespondWithError(rw http.ResponseWriter, err bst_models.Error)
- func UserHasScopes(user string, scopes []string) bool
- func ValidateFiltering(i interface{}, filterRequest []string) (filtering string)
- func ValidateOrdering(i interface{}, orderRequest []string) (ordering string)
- type JSONWebKeys
- type Jwks
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ServeHost string ServePort string ApiBase string DbMigration bool )
Functions ¶
func CleanString ¶
func GetCommonMiddleware ¶
func GetJWTMiddleware ¶
func GetJWTMiddleware() *jwtmiddleware.JWTMiddleware
func GetProtectionMiddleware ¶
func GetUserScopes ¶
func LoadConfig ¶
func LoadConfig()
func PrepareMiddleware ¶
func PrepareMiddleware()
func PrintErrors ¶
func ProfileFromToken ¶
profileFromToken will extract the user profile from the request JWT token. This contains data used to validate the user against an eagate account.
func RespondWithError ¶
func RespondWithError(rw http.ResponseWriter, err bst_models.Error)
func UserHasScopes ¶
func ValidateFiltering ¶
ValidateFiltering will ensure filtered select statements will only use valid rows from the interface. TODO: Do validation on clauses.
func ValidateOrdering ¶
ValidateOrdering will ensure columns in orderRequest are correct for the provided interfae. Additionally, it will only allow ASC and DESC. TODO: support fields such as LENGTH(id)
Types ¶
type JSONWebKeys ¶
type Jwks ¶
type Jwks struct {
Keys []JSONWebKeys `json:"keys"`
}
Click to show internal directories.
Click to hide internal directories.