Documentation
¶
Index ¶
- Constants
- func CallbackURL(appID string) string
- type App
- type AuthorizationRequest
- type CallbackRequest
- type Factory
- type Github
- func (g *Github) AuthorizationURL(state string, scopes []string) (string, error)
- 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(_ context.Context, refreshToken string) (*oauth2.Token, error)
- 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" )
View Source
const (
ExpiryAccessToken = 15 * time.Minute
)
Variables ¶
This section is empty.
Functions ¶
func CallbackURL ¶
Types ¶
type AuthorizationRequest ¶
type CallbackRequest ¶
type Github ¶
type Github struct {
// contains filtered or unexported fields
}
func (*Github) AuthorizationURL ¶
type IBackend ¶
type IBackend interface {
AuthorizationURL(state string, scopes []string) (string, error)
GetToken(ctx context.Context, code string) (*oauth2.Token, error)
RefreshToken(ctx context.Context, refreshToken string) (*oauth2.Token, error)
GetUser(ctx context.Context, token *oauth2.Token) (*model.User, error)
}
type RefreshRequest ¶
type SessionRequest ¶
type TokenRequest ¶
type UserRequest ¶
Click to show internal directories.
Click to hide internal directories.