casbin-http-role-example

Example of role-based HTTP Authorization with casbin

  • 所有者: zupzup/casbin-http-role-example
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

casbin-http-role-exampe

Simplistic Example of role-based HTTP Authorization with casbin using scs for session handling.

Run with

dep ensure
go run main.go

Which starts a server at http://localhost:8080 with the following routes:

  • POST /login - accessible if not logged in
    • takes name as a form-data parameter - there is no password
    • Valid Users:
      • Admin ID: 1, Role: admin
      • Sabine ID: 2, Role: member
      • Sepp ID: 3, Role: member
  • POST /logout - accessible if logged in
  • GET /member/current - accessible if logged in as a member
  • GET /member/role - accessible if logged in as a member
  • GET /admin/stuff - accessible if logged in as an admin

主要指标

概览
名称与所有者zupzup/casbin-http-role-example
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2018-01-04 19:05:22
推送于2020-08-10 11:11:08
最后一次提交
发布数0
用户参与
星数98
关注者数5
派生数61
提交数3
已启用问题?
问题数4
打开的问题数2
拉请求数0
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?