joshk / pusher

Pusher server in Go
37 stars 15 forks source link

add support for authenticating users #7

Open agerlic opened 10 years ago

agerlic commented 10 years ago

Proposition to add user authentication based on http://pusher.com/docs/auth_signatures for issue #2

Maybe AuthenticateUser method could be added to Channel instead of Client like the pusher ruby gem (https://github.com/pusher/pusher-gem/blob/master/lib/pusher/channel.rb#L139).

jnunemaker commented 10 years ago

I would rename AuthenticateUser to Authenticate and add it to channel. Since it requires channel name as the first arg, it makes more sense on channel to me. I also would like to see this library line up closely with the pusher ruby gem as I have found it to be pleasant to work with in the past.

jnunemaker commented 10 years ago

We will probably have to pass an instance of the client to the channel then, so we have the key/secret and a way to make other client requests, but that seems fine.

agerlic commented 10 years ago

I've renamed and added the Authenticate method to Channel.

I've created a new example file channelAuthenticate, which loads pusher package locally instead of git repo, I guess it could help to fix examples.