Documentation
¶
Index ¶
- Constants
- type AccessControlManager
- type AclConfig
- type Apple
- func (b Apple) AuthUrl() string
- func (b Apple) ClientId() string
- func (b Apple) ClientSecret() string
- func (b Apple) DisplayName() string
- func (a *Apple) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- func (b Apple) FetchToken(code string) (*oauth2.Token, error)
- func (b Apple) RedirectUrl() string
- func (b Apple) Scopes() []string
- func (b Apple) SetAuthUrl(authUrl string)
- func (b Apple) SetClientId(clientId string)
- func (b Apple) SetClientSecret(clientSecret string)
- func (b Apple) SetDisplayName(displayName string)
- func (b Apple) SetRedirectUrl(redirectUrl string)
- func (b Apple) SetScopes(scopes []string)
- func (b Apple) SetTokenUrl(tokenUrl string)
- func (b Apple) SetUserApiUrl(userApiUrl string)
- func (b Apple) TokenUrl() string
- func (b Apple) UserApiUrl() string
- type AuthUser
- type Facebook
- func (b Facebook) AuthUrl() string
- func (b Facebook) ClientId() string
- func (b Facebook) ClientSecret() string
- func (b Facebook) DisplayName() string
- func (f *Facebook) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- func (b Facebook) FetchToken(code string) (*oauth2.Token, error)
- func (b Facebook) RedirectUrl() string
- func (b Facebook) Scopes() []string
- func (b Facebook) SetAuthUrl(authUrl string)
- func (b Facebook) SetClientId(clientId string)
- func (b Facebook) SetClientSecret(clientSecret string)
- func (b Facebook) SetDisplayName(displayName string)
- func (b Facebook) SetRedirectUrl(redirectUrl string)
- func (b Facebook) SetScopes(scopes []string)
- func (b Facebook) SetTokenUrl(tokenUrl string)
- func (b Facebook) SetUserApiUrl(userApiUrl string)
- func (b Facebook) TokenUrl() string
- func (b Facebook) UserApiUrl() string
- type Google
- func (b Google) AuthUrl() string
- func (b Google) ClientId() string
- func (b Google) ClientSecret() string
- func (b Google) DisplayName() string
- func (g *Google) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- func (b Google) FetchToken(code string) (*oauth2.Token, error)
- func (b Google) RedirectUrl() string
- func (b Google) Scopes() []string
- func (b Google) SetAuthUrl(authUrl string)
- func (b Google) SetClientId(clientId string)
- func (b Google) SetClientSecret(clientSecret string)
- func (b Google) SetDisplayName(displayName string)
- func (b Google) SetRedirectUrl(redirectUrl string)
- func (b Google) SetScopes(scopes []string)
- func (b Google) SetTokenUrl(tokenUrl string)
- func (b Google) SetUserApiUrl(userApiUrl string)
- func (b Google) TokenUrl() string
- func (b Google) UserApiUrl() string
- type Provider
Constants ¶
View Source
const NameApple string = "apple"
View Source
const NameFacebook string = "facebook"
View Source
const NameGoogle string = "google"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControlManager ¶
type AccessControlManager struct {
// contains filtered or unexported fields
}
func NewAccessControlManager ¶
func NewAccessControlManager() *AccessControlManager
func (*AccessControlManager) IsAuthroized ¶
func (a *AccessControlManager) IsAuthroized(role, resource, method string) (bool, error)
func (*AccessControlManager) Register ¶
func (a *AccessControlManager) Register(role, policyPath, confPath string)
func (*AccessControlManager) RegisterAll ¶
func (a *AccessControlManager) RegisterAll(aclConfigs []AclConfig)
type Apple ¶
type Apple struct {
// contains filtered or unexported fields
}
func NewAppleProvider ¶
func NewAppleProvider() *Apple
func (Apple) ClientSecret ¶
func (b Apple) ClientSecret() string
func (Apple) DisplayName ¶
func (b Apple) DisplayName() string
func (Apple) RedirectUrl ¶
func (b Apple) RedirectUrl() string
func (Apple) SetAuthUrl ¶
func (b Apple) SetAuthUrl(authUrl string)
func (Apple) SetClientId ¶
func (b Apple) SetClientId(clientId string)
func (Apple) SetClientSecret ¶
func (b Apple) SetClientSecret(clientSecret string)
func (Apple) SetDisplayName ¶
func (b Apple) SetDisplayName(displayName string)
func (Apple) SetRedirectUrl ¶
func (b Apple) SetRedirectUrl(redirectUrl string)
func (Apple) SetTokenUrl ¶
func (b Apple) SetTokenUrl(tokenUrl string)
func (Apple) SetUserApiUrl ¶
func (b Apple) SetUserApiUrl(userApiUrl string)
func (Apple) UserApiUrl ¶
func (b Apple) UserApiUrl() string
type AuthUser ¶
type AuthUser struct {
Id string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
EmailVerified bool `json:"emailVerified"`
AvatarUrl string `json:"avatarUrl"`
AccessToken string `json:"accessToken"`
RefreshToken string `json:"refreshToken"`
ExpiresAt types.DateTime `json:"expiresAt"`
RawUser map[string]any `json:"rawUser"`
}
func (*AuthUser) ExtractNames ¶
type Facebook ¶
type Facebook struct {
// contains filtered or unexported fields
}
func NewFacebookProvider ¶
func NewFacebookProvider() *Facebook
func (Facebook) ClientSecret ¶
func (b Facebook) ClientSecret() string
func (Facebook) DisplayName ¶
func (b Facebook) DisplayName() string
func (*Facebook) FetchAuthUser ¶
func (Facebook) RedirectUrl ¶
func (b Facebook) RedirectUrl() string
func (Facebook) SetAuthUrl ¶
func (b Facebook) SetAuthUrl(authUrl string)
func (Facebook) SetClientId ¶
func (b Facebook) SetClientId(clientId string)
func (Facebook) SetClientSecret ¶
func (b Facebook) SetClientSecret(clientSecret string)
func (Facebook) SetDisplayName ¶
func (b Facebook) SetDisplayName(displayName string)
func (Facebook) SetRedirectUrl ¶
func (b Facebook) SetRedirectUrl(redirectUrl string)
func (Facebook) SetTokenUrl ¶
func (b Facebook) SetTokenUrl(tokenUrl string)
func (Facebook) SetUserApiUrl ¶
func (b Facebook) SetUserApiUrl(userApiUrl string)
func (Facebook) UserApiUrl ¶
func (b Facebook) UserApiUrl() string
type Google ¶
type Google struct {
// contains filtered or unexported fields
}
func NewGoogleProvider ¶
func NewGoogleProvider() *Google
func (Google) ClientSecret ¶
func (b Google) ClientSecret() string
func (Google) DisplayName ¶
func (b Google) DisplayName() string
func (*Google) FetchAuthUser ¶
func (Google) RedirectUrl ¶
func (b Google) RedirectUrl() string
func (Google) SetAuthUrl ¶
func (b Google) SetAuthUrl(authUrl string)
func (Google) SetClientId ¶
func (b Google) SetClientId(clientId string)
func (Google) SetClientSecret ¶
func (b Google) SetClientSecret(clientSecret string)
func (Google) SetDisplayName ¶
func (b Google) SetDisplayName(displayName string)
func (Google) SetRedirectUrl ¶
func (b Google) SetRedirectUrl(redirectUrl string)
func (Google) SetTokenUrl ¶
func (b Google) SetTokenUrl(tokenUrl string)
func (Google) SetUserApiUrl ¶
func (b Google) SetUserApiUrl(userApiUrl string)
func (Google) UserApiUrl ¶
func (b Google) UserApiUrl() string
type Provider ¶
type Provider interface {
DisplayName() string
SetDisplayName(displayName string)
ClientId() string
SetClientId(clientId string)
ClientSecret() string
SetClientSecret(clientSecret string)
RedirectUrl() string
SetRedirectUrl(redirectUrl string)
Scopes() []string
SetScopes(scopes []string)
AuthUrl() string
SetAuthUrl(authUrl string)
TokenUrl() string
SetTokenUrl(tokenUrl string)
FetchToken(code string) (*oauth2.Token, error)
FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
}
func NewProviderByName ¶
Click to show internal directories.
Click to hide internal directories.