summaryrefslogtreecommitdiffstats
path: root/model/authorize_test.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 /model/authorize_test.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 'model/authorize_test.go')
-rw-r--r--model/authorize_test.go11
1 files changed, 11 insertions, 0 deletions
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) {