README.md in faye-authentication-0.2.0 vs README.md in faye-authentication-0.3.0
- old
+ new
@@ -16,10 +16,11 @@
## Current support
Currently Implemented :
- Javascript Client Extention (JQuery needed)
- Ruby Faye Server Extension
+ - Ruby Faye Client Extension
- Ruby utils to signing messages in your webapp
- **Want another one ? Pull requests are welcome.**
## Installation
@@ -90,24 +91,33 @@
If you wish to change the endpoint, you can supply it as the second argument of the extension constructor, the first one being the client :
client.addExtension(new FayeAuthentication(client, '/my_custom_auth_endpoint'));
-### Faye server extension
+### Ruby Faye server extension
Instanciate the extension with your secret key and add it to the server :
````ruby
server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 15)
-server.add_extension Faye::Authentication::Extension.new('your shared secret key')
+server.add_extension Faye::Authentication::ServerExtension.new('your shared secret key')
````
-Faye::Authentication::Extension expect that :
+Faye::Authentication::ServerExtension expect that :
- a ``signature`` is present in the message for publish/subscribe request
- this signature is a valid JWT token
- the JWT payload contains "channel", "clientId" and a expiration timestamp "exp" that is not in the past.
Otherwise Faye Server will refuse the message.
+
+### Ruby Faye client extension
+
+This extension allows the ruby ``Faye::Client`` to auto-sign its messages before sending them to the server.
+
+````ruby
+client = Faye::Client.new('http://localhost:9292/faye')
+client.add_extension Faye::Authentication::ClientExtension.new('your shared secret key')
+````
## Contributing
1. Fork it ( https://github.com/dimelo/faye-authentication/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)