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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?