Pusher Channels Docs | How to authorize userspage
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
Hello there, I spotted an issue on https://pusher.com/docs/channels/server_api/authorizing-users/
The Go code snippet for Implementing the authorization endpoint for a private channel should —
- I think it's a good idea to show the relevant imports and any assumed global variables like so (also applies to all code snippets)
import (
"fmt"
"io/ioutil"
"net/http"
"github.com/pusher/pusher-http-go"
)
var pusherClient = pusher.Client{
AppID: "",
Key: "",
Secret: "",
Cluster: "",
}
... rest of code snippet
io/ioutilis now deprecated and should be replaced with justio. Accordingly,ioutil.ReadAllshould beio.ReadAll
Bonus issues
- The Go snippet in this section has a small bug with the
pusher.MemberDataline.
presenceData := pusher.MemberData{
UserId: "1", //should be UserID
UserInfo: map[string]string{
"twitter": "pusher",
},
}
- In the same snippet referenced above, the
fmt.Fprintfline also has a tiny bug
fmt.Fprintf(res, response) // should be fmt.Fprintf(res, string(response))
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the linked Channels authorizing-users page and locate the Go snippets for private- and presence-channel authorization. Update the examples with the requested imports and client context, replace deprecated ioutil usage, correct MemberData.UserID, and fix the response formatting; done means the snippets are complete and valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100