Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App represents the configuration of the Github OAuth application used to authenticate users.
func NewApp ¶
func NewApp(id, secret string, client utils.HTTPClient) *App
NewApp configures a new GithubApp struct
func (*App) OAuthClient ¶
func (ga *App) OAuthClient(code, state string) (*OAuthClient, error)
OAuthClient swaps a code token for a OAuthClient to make subsequent authenticated requests to the API
type ClientState ¶
type ClientState struct {
Redirect string
}
ClientState represents the state passed in by a client auth request, including a random State string, and the Redirect URI callback
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config contains all the values required to support the auth package
func New ¶
func New(jwtConfig *jwtprovider.Config, db *hnysqlx.DB, client *redis.Client, githubApp *App) *Config
New build a new Config struct
func TestConfig ¶
func TestConfig(jwtConfig *jwtprovider.Config, store auth.UserStore, stateStore cache.StateStore, githubApp *App, now time.Time) *Config
TestConfig builds a config used for testing
func (*Config) SetupHandlers ¶
SetupHandlers mounts the auth HTTP handlers on the given router
type OAuthClient ¶
type OAuthClient struct { Token string HTTPClient utils.HTTPClient Base string }
OAuthClient is a http client that automatically adds the required Authorization headers when called
func (*OAuthClient) User ¶
func (c *OAuthClient) User() (*auth.CreateUser, error)
User fetches the currently authenticated user from and returns the struct to be passed to create the user.