Documentation
¶
Index ¶
Constants ¶
View Source
const HMAC_SAMPLE_SECRET = "hmacsamplesecret"
View Source
const TOKEN_DURATION = time.Hour
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRepository ¶
type AuthRepositoryDb ¶
type AuthRepositoryDb struct {
// contains filtered or unexported fields
}
func NewAuthRepositoryDb ¶
func NewAuthRepositoryDb(client *sqlx.DB) AuthRepositoryDb
type Claims ¶
type Claims struct { CustomerId string `json:"customer_id"` Accounts []string `json:"accounts"` Username string `json:"username"` //Expiry int64 `json:"exp"` Role string `json:"role"` jwt.StandardClaims }
func (Claims) IsRequestVerifiedWithTokenClaims ¶
func (Claims) IsUserRole ¶
type Login ¶
type Login struct { Username string `db:"username"` CustomerId sql.NullString `db:"customer_id"` Accounts sql.NullString `db:"account_numbers"` Role string `db:"role"` }
type RolePermissions ¶
type RolePermissions struct {
// contains filtered or unexported fields
}
func GetRolePermissions ¶
func GetRolePermissions() RolePermissions
func (RolePermissions) IsAuthorizedFor ¶
func (p RolePermissions) IsAuthorizedFor(role string, routeName string) bool
Click to show internal directories.
Click to hide internal directories.