From be9624e2adce7c95039e62fc4ee22538d7fa2d2f Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 20 Apr 2017 09:55:02 -0400 Subject: 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 --- model/authorize_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'model/authorize_test.go') diff --git a/model/authorize_test.go b/model/authorize_test.go index cbb57d54c..3f43a4fc3 100644 --- a/model/authorize_test.go +++ b/model/authorize_test.go @@ -20,6 +20,17 @@ func TestAuthJson(t *testing.T) { if a1.Code != ra1.Code { t.Fatal("codes didn't match") } + + a2 := AuthorizeRequest{} + a2.ClientId = NewId() + a2.Scope = NewId() + + json = a2.ToJson() + ra2 := AuthorizeRequestFromJson(strings.NewReader(json)) + + if a2.ClientId != ra2.ClientId { + t.Fatal("client ids didn't match") + } } func TestAuthPreSave(t *testing.T) { -- cgit v1.2.3-1-g7c22