func (r *Realm) Register() error {
	return nil
}
Register does nothing.
package github
import (
	"context"
	"crypto/rand"
	"encoding/hex"
	"encoding/json"
	"io/ioutil"
	"net/http"
	"net/url"
	"github.com/google/go-github/github"
	"github.com/matrix-org/go-neb/database"
	"github.com/matrix-org/go-neb/services/github/client"
	"github.com/matrix-org/go-neb/types"
	log "github.com/sirupsen/logrus"
	"maunium.net/go/mautrix/id"
)
const RealmType = "github"
type Realm struct {
	id          string
	redirectURL string
	ClientSecret string
	ClientID string
	StarterLink string
}
type Session struct {
	id      string
	userID  id.UserID
	realmID string
	AccessToken string
	Scopes string
	ClientsRedirectURL string
}
type AuthRequest struct {
	RedirectURL string
}
type AuthResponse struct {
	URL string
}
func (s *Session) Authenticated() bool {
	return s.AccessToken != ""
}
func (s *Session) Info() interface{} {
	logger := log.WithFields(log.Fields{
		"user_id":  s.userID,
		"realm_id": s.realmID,
	})
	cli := client.New(s.AccessToken)
	var repos []client.TrimmedRepository
	opts := &github.RepositoryListOptions{
		Type: "all",
		ListOptions: github.ListOptions{
			PerPage: 100,
		},
	}
	for {
		rs, resp, err := cli.Repositories.List(context.Background(), "", opts)
		if err != nil {
			logger.WithError(err).Print("Failed to query github projects on github.com")
			return nil
		}
		for _, r := range rs {
			repos = append(repos, client.TrimRepository(r))
		}
		if resp.NextPage == 0 {
			break
		}
		opts.ListOptions.Page = resp.NextPage
		logger.Print("Session.Info() Next => ", resp.NextPage)
	}
	logger.Print("Session.Info() Returning ", len(repos), " repos")
	return struct {
		Repos []client.TrimmedRepository
	}{repos}
}
func (s *Session) UserID() id.UserID {
	return s.userID
}
func (s *Session) RealmID() string {
	return s.realmID
}
func (s *Session) ID() string {
	return s.id
}
func (r *Realm) ID() string {
	return r.id
}
func (r *Realm) Type() string {
	return RealmType
}
func (r *Realm) Init() error {
	return nil
}