semihbkgr / gin-auth

Http server sample with authentication and authorization written using Gin framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gin Auth

Implementation of authentication and authorization by middleware functions in Gin server

e.PUT("/post/:id",
    handle.JwtAuthenticationRequiredMw(jwtService),
    handle.UpdatePost(postRepo),
)

e.PUT("/post/force/:id",
    handle.JwtAuthenticationRequiredMw(jwtService),
    handle.JwtAuthorizationHasAnyRoleMv(auth.RoleAdmin, auth.RoleManager),
    handle.UpdatePostForcibly(postRepo),
)

About

Http server sample with authentication and authorization written using Gin framework.


Languages

Language:Go 100.0%