Documentation
¶
Index ¶
- func CheckJWT(reciebedToken string) (string, error)
- func ComparePasw(hashedPassword, password string) error
- func EncriptPasw(password string) (string, error)
- func ExtractToken(r *http.Request) (string, error)
- func GenerateHttpError(w http.ResponseWriter, status int, err error, msg string) types.HttpError
- func GenerateJWT(username string) (*string, error)
- func JwtMidleware(next http.Handler) http.Handler
- func SearchForNewSheets()
- func WriteJsonResponse(w http.ResponseWriter, status int, msg interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckJWT ¶
Comprobar el jwt, parsearlo, revisar la firma y la validez del token. Retorna el nombre de usuario contenido dentro del token
func ComparePasw ¶
CompareBcryptHash compares a bcrypt hash with the given password string
func EncriptPasw ¶
GenerateBcryptHash generates a bcrypt hash of the given password string
func ExtractToken ¶
Funcion para extraer el token de una llamada http con Authorization Bearer como header. Retorna el token aislado
func GenerateHttpError ¶
To generate a new http error and a new log message
func GenerateJWT ¶
generar un nuevo jwt para la autenticacion del usuario
func JwtMidleware ¶
jwt midleware to protect authentication
func SearchForNewSheets ¶
func SearchForNewSheets()
Funcion que orquesta la busqueda, la descarga y posterior parseo y cargado en la base de datos de los archivos excel disponibles en le pagina de la POlitecnica
func WriteJsonResponse ¶
func WriteJsonResponse(w http.ResponseWriter, status int, msg interface{})
small function to boilerplate json response
Types ¶
This section is empty.