pusher / pusher/docs

Pusher Channels Docs | How to authorize userspage

Open Beginner friendly
#223 0 comments 0 reactions 0 assignees View on GitHub

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
Bonus issues
  • The Go snippet in this section has a small bug with the pusher.MemberData line.
presenceData := pusher.MemberData{
  UserId: "1",  //should be UserID
  UserInfo: map[string]string{
    "twitter": "pusher",
  },
}
  • In the same snippet referenced above, the fmt.Fprintf line 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.