Documentation ¶
Index ¶
Constants ¶
View Source
const ( COOKIE_CSRF = "seventv-csrf" COOKIE_AUTH = "seventv-auth" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer interface { SignJWT(secret string, claim jwt.Claims) (string, error) VerifyJWT(token []string, out jwt.Claims) (*jwt.Token, error) CreateCSRFToken(targetID primitive.ObjectID) (value, token string, err error) CreateAccessToken(targetID primitive.ObjectID, version float64) (string, time.Time, error) ValidateCSRF(state string, cookieData string) (*fasthttp.Cookie, *JWTClaimOAuth2CSRF, error) Cookie(key, token string, duration time.Duration) *fasthttp.Cookie QueryValues(provider structures.UserConnectionPlatform, csrfToken string) (url.Values, error) ExchangeCode(ctx context.Context, provider structures.UserConnectionPlatform, code string) (OAuth2AuthorizedResponse, error) TwichUserData(grant string) (string, []byte, error) DiscordUserData(grant string) (string, []byte, error) UserData(provider structures.UserConnectionPlatform, token string) (id string, b []byte, err error) LocateIP(ctx context.Context, ip string) (GeoIPResult, error) }
func New ¶
func New(ctx context.Context, opt AuthorizerOptions) Authorizer
type AuthorizerOptions ¶
type GeoIPResult ¶
type JWTClaimOAuth2CSRF ¶
type JWTClaimUser ¶
type KickUserData ¶
type OAuth2AuthorizationParams ¶
type OAuth2AuthorizationParams struct { ClientID string `url:"client_id" json:"client_id"` ClientSecret string `url:"client_secret" json:"client_secret"` RedirectURI string `url:"redirect_uri" json:"redirect_uri"` Code string `url:"code" json:"code"` GrantType string `url:"grant_type" json:"grant_type"` Scope string `url:"scope" json:"scope"` }
Click to show internal directories.
Click to hide internal directories.