Documentation ¶
Index ¶
- Constants
- Variables
- func CallbackURL(appID string) string
- type App
- type AuthorizationRequest
- type CallbackRequest
- type Factory
- type Github
- func (g *Github) AuthorizationURL(state string, scopes []string) string
- func (g *Github) GetToken(ctx context.Context, code string) (*oauth2.Token, error)
- func (g *Github) GetUser(ctx context.Context, token *oauth2.Token) (*model.User, error)
- func (g *Github) RefreshToken(ctx context.Context, refreshToken string) (*oauth2.Token, error)
- type GithubEmail
- type GithubEmails
- type GithubUserResponse
- type Handler
- func (h *Handler) HandleAuthorize(c echo.Context) error
- func (h *Handler) HandleCallback(c echo.Context) error
- func (h *Handler) HandleRefresh(c echo.Context) error
- func (h *Handler) HandleSession(c echo.Context) error
- func (h *Handler) HandleToken(c echo.Context) error
- func (h *Handler) HandleUser(c echo.Context) error
- type IBackend
- type RefreshRequest
- type SessionRequest
- type TokenRequest
- type UserRequest
- type UserResponse
Constants ¶
View Source
const ( ProviderGithub = "github" // Github API endpoints GithubURLAuthorize = "/login/oauth/authorize" GithubURLToken = "/login/oauth/access_token" GithubURLUser = "/user" GithubURLEmails = "/user/emails" )
Variables ¶
View Source
var ErrInvalidClientCredentials = errors.New("invalid client credentials")
Functions ¶
func CallbackURL ¶
Types ¶
type AuthorizationRequest ¶
type CallbackRequest ¶
type Github ¶
type Github struct {
// contains filtered or unexported fields
}
func (*Github) AuthorizationURL ¶
type GithubEmail ¶
type GithubEmails ¶
type GithubEmails []GithubEmail
func (GithubEmails) PrimaryEmail ¶
func (r GithubEmails) PrimaryEmail() (string, error)
type GithubUserResponse ¶
type GithubUserResponse struct { ID int `json:"id"` Email string `json:"email"` Login string `json:"login"` Name string `json:"name"` }
func (*GithubUserResponse) ToModel ¶
func (r *GithubUserResponse) ToModel() *model.User
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) HandleAuthorize ¶
func (*Handler) HandleCallback ¶
func (*Handler) HandleRefresh ¶
func (*Handler) HandleSession ¶
func (*Handler) HandleToken ¶
func (*Handler) HandleUser ¶
type IBackend ¶
type RefreshRequest ¶
type SessionRequest ¶
type TokenRequest ¶
type UserRequest ¶
func (*UserRequest) Parse ¶
func (r *UserRequest) Parse(c echo.Context) error
Click to show internal directories.
Click to hide internal directories.