Browse files

fix readme

  • Loading branch information...
1 parent f713f55 commit 52f291794468f8caad80e597b20d7eab8d8af537 @twilson63 committed Nov 13, 2011
View
BIN .DS_Store
Binary file not shown.
View
3 app.coffee
@@ -33,8 +33,9 @@ app.post '/admins', (req, resp) ->
#
# Register Application
app.put '/applications/:name', express.basicAuth(auth), (req, resp) ->
- applications.register req.params.name, 'Admin', (err) ->
+ applications.register req.params.name, express.basicAuth(auth), (err) ->
resp.json { success: (if err? then false else true) }
+
# Get all apps by owner
app.get '/applications', express.basicAuth(auth), (req, resp) ->
applications.all req.remoteUser.username, (err, applications) ->
View
35 readme.md
@@ -22,15 +22,10 @@ can associate a user and an application.
### Applications
-``` sh
-# list applications
-curl http://[admin]:[pass]@authur.wilbur.io/applications
-```
-
### Register Application
``` sh
-curl -XPUT http://[admin]:[pass]@authur.wilbur.io/applications -d '{ "name": "awesome_sauce" }'
+curl -XPUT http://[admin]:[pass]@authur.wilbur.io/applications -d '{ "name": "app1" }'
#=> { "success": "true" }
```
@@ -41,38 +36,16 @@ curl -XPUT http://[admin]:[pass]@authur.wilbur.io/users -d '{ "username": "foo",
#=> { "success": "true" }
```
-### List users for an application
-
-``` sh
-curl http://[admin]:[pass]@authur.wilbur.io/applications/[app]/users
-#=> { "users": ["foo", "bar"]}
-```
-
### Attach User to Application
``` sh
-curl -XPUT http://[admin]:[pass]@authur.wilbur.io/applications/[app]/users -d '{"username": "foo"}'
+curl -XPOST http://[admin]:[pass]@authur.wilbur.io/users/[user]/apps/[app]
#=> { "success": "true"}
```
### Authenticate User
``` sh
-curl -XPOST http://[admin]:[pass]@authur.wilbur.io/applications/[app]/users/[user] -d ' {"password": "bar"}'
+curl -XPOST http://[admin]:[pass]@authur.wilbur.io/auth/[app] -d ' {"username": "foo", password": "bar"}'
#=> { "success": "true"}
-```
-
-### User Applications
-
-``` sh
-curl http://[admin]:[pass]@authur.wilbur.io/users/[user]/applications
-#=> { "applications": ["app1","app2"]}
-```
-
-### User Test Authentication
-
-``` sh
-curl -XPOST http://[admin]:[pass]@authur.wilbur.io/users/[user] -d '{"password": "bar"}'
-#=> { "success": "true" }
-```
-
+```
View
BIN spec/.DS_Store
Binary file not shown.
View
6 spec/applications/registerSpec.coffee
@@ -1,12 +1,14 @@
require '../../app'
request = require 'request'
-good_url = 'http://admin:thomas@localhost:3000'
+#good_url = 'http://admin:thomas@localhost:3000'
+good_url = 'http://jackadmin:thomas63@authur.wilbur.io'
+
describe 'Applications#register', ->
it 'success is true', ->
request.put
- uri: [good_url, 'applications', 'foo'].join('/')
+ uri: [good_url, 'applications', 'app1'].join('/')
json: true
(err, resp, body) ->
expect(body.success).toEqual(true)
View
6 spec/authSpec.coffee
@@ -1,13 +1,15 @@
require '../app'
request = require 'request'
-good_url = 'http://admin:thomas@localhost:3000'
+good_url = 'http://jackadmin:thomas63@authur.wilbur.io'
+
+#good_url = 'http://admin:thomas@localhost:3000'
describe 'app#auth', ->
it 'success is true', ->
request.post
uri: [good_url, 'auth', 'app1'].join('/')
- json: { username: 'jackhq', password: 'disel10' }
+ json: { username: 'user', password: 'disel10' }
(err, resp, body) ->
expect(body.success).toEqual(true)
asyncSpecDone()
View
4 spec/users/attachAppSpec.coffee
@@ -1,7 +1,9 @@
require '../../app'
request = require 'request'
-good_url = 'http://admin:thomas@localhost:3000'
+good_url = 'http://jackadmin:thomas63@authur.wilbur.io'
+
+#good_url = 'http://admin:thomas@localhost:3000'
describe 'Users#attachApp', ->
it 'success is true', ->
View
4 spec/users/registerSpec.coffee
@@ -1,7 +1,9 @@
require '../../app'
request = require 'request'
-good_url = 'http://admin:thomas@localhost:3000'
+good_url = 'http://jackadmin:thomas63@authur.wilbur.io'
+
+#good_url = 'http://admin:thomas@localhost:3000'
describe 'Users#register', ->
it 'success is true', ->

0 comments on commit 52f2917

Please sign in to comment.