Add token listing at GET /tokens, also add a token-fixing tool at /tokens/fix_privileges.

By the way, 100th commit on the API!
This commit is contained in:
Howl
2016-06-14 11:32:11 +02:00
parent 52d7b65493
commit 4d9ec829a8
3 changed files with 89 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ func Start(conf common.Conf, dbO *sql.DB) *gin.Engine {
gv1.GET("/badges", Method(v1.BadgesGET, common.PrivilegeRead))
gv1.GET("/beatmaps", Method(v1.BeatmapGET, common.PrivilegeRead))
gv1.GET("/leaderboard", Method(v1.LeaderboardGET, common.PrivilegeRead))
gv1.GET("/tokens", Method(v1.TokenGET, common.PrivilegeRead))
// ReadConfidential privilege required
gv1.GET("/friends", Method(v1.FriendsGET, common.PrivilegeReadConfidential))
@@ -70,6 +71,10 @@ func Start(conf common.Conf, dbO *sql.DB) *gin.Engine {
gv1.GET("/meta/kill", Method(v1.MetaKillGET, common.PrivilegeAPIMeta))
gv1.GET("/meta/up_since", Method(v1.MetaUpSinceGET, common.PrivilegeAPIMeta))
gv1.GET("/meta/update", Method(v1.MetaUpdateGET, common.PrivilegeAPIMeta))
// User Managing + meta
gv1.GET("/tokens/fix_privileges", Method(v1.TokenFixPrivilegesGET,
common.PrivilegeManageUser, common.PrivilegeAPIMeta))
}
api.GET("/status", internals.Status)