summaryrefslogtreecommitdiffstats
path: root/api4/api.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-04-20 09:55:02 -0400
committerGitHub <noreply@github.com>2017-04-20 09:55:02 -0400
commitbe9624e2adce7c95039e62fc4ee22538d7fa2d2f (patch)
tree318179b4d3a4cb5114f887797a5a4c836e5255d7 /api4/api.go
parent1a0f8d1b3c7451eac43bfdc5971de060caabf441 (diff)
downloadchat-be9624e2adce7c95039e62fc4ee22538d7fa2d2f.tar.gz
chat-be9624e2adce7c95039e62fc4ee22538d7fa2d2f.tar.bz2
chat-be9624e2adce7c95039e62fc4ee22538d7fa2d2f.zip
Implement v4 endpoints for OAuth (#6040)
* Implement POST /oauth/apps endpoint for APIv4 * Implement GET /oauth/apps endpoint for APIv4 * Implement GET /oauth/apps/{app_id} and /oauth/apps/{app_id}/info endpoints for APIv4 * Refactor API version independent oauth endpoints * Implement DELETE /oauth/apps/{app_id} endpoint for APIv4 * Implement /oauth/apps/{app_id}/regen_secret endpoint for APIv4 * Implement GET /user/{user_id}/oauth/apps/authorized endpoint for APIv4 * Implement POST /oauth/deauthorize endpoint
Diffstat (limited to 'api4/api.go')
-rw-r--r--api4/api.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/api4/api.go b/api4/api.go
index 8d03d91d1..fd9b679d2 100644
--- a/api4/api.go
+++ b/api4/api.go
@@ -64,8 +64,10 @@ type Routes struct {
OutgoingHooks *mux.Router // 'api/v4/hooks/outgoing'
OutgoingHook *mux.Router // 'api/v4/hooks/outgoing/{hook_id:[A-Za-z0-9]+}'
- Admin *mux.Router // 'api/v4/admin'
- OAuth *mux.Router // 'api/v4/oauth'
+ OAuth *mux.Router // 'api/v4/oauth'
+ OAuthApps *mux.Router // 'api/v4/oauth/apps'
+ OAuthApp *mux.Router // 'api/v4/oauth/apps/{app_id:[A-Za-z0-9]+}'
+
SAML *mux.Router // 'api/v4/saml'
Compliance *mux.Router // 'api/v4/compliance'
Cluster *mux.Router // 'api/v4/cluster'
@@ -146,8 +148,11 @@ func InitApi(full bool) {
BaseRoutes.OutgoingHook = BaseRoutes.OutgoingHooks.PathPrefix("/{hook_id:[A-Za-z0-9]+}").Subrouter()
BaseRoutes.SAML = BaseRoutes.ApiRoot.PathPrefix("/saml").Subrouter()
+
BaseRoutes.OAuth = BaseRoutes.ApiRoot.PathPrefix("/oauth").Subrouter()
- BaseRoutes.Admin = BaseRoutes.ApiRoot.PathPrefix("/admin").Subrouter()
+ BaseRoutes.OAuthApps = BaseRoutes.OAuth.PathPrefix("/apps").Subrouter()
+ BaseRoutes.OAuthApp = BaseRoutes.OAuthApps.PathPrefix("/{app_id:[A-Za-z0-9]+}").Subrouter()
+
BaseRoutes.Compliance = BaseRoutes.ApiRoot.PathPrefix("/compliance").Subrouter()
BaseRoutes.Cluster = BaseRoutes.ApiRoot.PathPrefix("/cluster").Subrouter()
BaseRoutes.LDAP = BaseRoutes.ApiRoot.PathPrefix("/ldap").Subrouter()
@@ -180,6 +185,7 @@ func InitApi(full bool) {
InitStatus()
InitWebSocket()
InitEmoji()
+ InitOAuth()
InitReaction()
InitWebrtc()