oauth

package
v0.0.0-...-aa453fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Providers = map[string]*Config{

	"discord": {
		Name:         "Discord",
		UserEndpoint: discordgo.EndpointUser("@me"),
		Config: oauth2.Config{
			Scopes: []string{"identify"},
			Endpoint: oauth2.Endpoint{
				AuthStyle: oauth2.AuthStyleInParams,
				AuthURL:   discordgo.EndpointOauth2 + "authorize",
				TokenURL:  discordgo.EndpointOauth2 + "token",
			},
		},
	},

	"github": {
		Name:   "GitHub",
		Config: oauth2.Config{Endpoint: github.Endpoint},
	},

	"gitlab": {
		Name:         "GitLab",
		UserEndpoint: "https://gitlab.com/oauth/userinfo",
		Config: oauth2.Config{
			Endpoint: gitlab.Endpoint,
			Scopes:   []string{"openid"},
		},
	},

	"stack-overflow": {
		Name:         "Stack Overflow",
		Config:       oauth2.Config{Endpoint: stackoverflow.Endpoint},
		UserEndpoint: "https://api.stackexchange.com/me?site=stackoverflow",
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	oauth2.Config
	Name, UserEndpoint string
}

type Connection

type Connection struct {
	Connection, Username string
	Discriminator        null.Int
	ID                   int
	Public               bool
}

func GetConnections

func GetConnections(db db.Queryable, golferID int, onlyPublic bool) (c []Connection)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL