Documentation ¶
Index ¶
- Variables
- func HttpGet(client *http.Client, url string) ([]byte, error)
- func NewOAuthService()
- type BasicUserInfo
- type Error
- type GenericOAuth
- func (s *GenericOAuth) FetchOrganizations(client *http.Client) ([]string, error)
- func (s *GenericOAuth) FetchPrivateEmail(client *http.Client) (string, error)
- func (s *GenericOAuth) FetchTeamMemberships(client *http.Client) ([]int, error)
- func (s *GenericOAuth) IsEmailAllowed(email string) bool
- func (s *GenericOAuth) IsOrganizationMember(client *http.Client) bool
- func (s *GenericOAuth) IsSignupAllowed() bool
- func (s *GenericOAuth) IsTeamMember(client *http.Client) bool
- func (s *GenericOAuth) Type() int
- func (s *GenericOAuth) UserInfo(client *http.Client) (*BasicUserInfo, error)
- type OrgRecord
- type SocialConnector
- type SocialGithub
- func (s *SocialGithub) FetchOrganizations(client *http.Client) ([]string, error)
- func (s *SocialGithub) FetchPrivateEmail(client *http.Client) (string, error)
- func (s *SocialGithub) FetchTeamMemberships(client *http.Client) ([]int, error)
- func (s *SocialGithub) IsEmailAllowed(email string) bool
- func (s *SocialGithub) IsOrganizationMember(client *http.Client) bool
- func (s *SocialGithub) IsSignupAllowed() bool
- func (s *SocialGithub) IsTeamMember(client *http.Client) bool
- func (s *SocialGithub) Type() int
- func (s *SocialGithub) UserInfo(client *http.Client) (*BasicUserInfo, error)
- type SocialGoogle
- type SocialGrafanaCom
- func (s *SocialGrafanaCom) IsEmailAllowed(email string) bool
- func (s *SocialGrafanaCom) IsOrganizationMember(organizations []OrgRecord) bool
- func (s *SocialGrafanaCom) IsSignupAllowed() bool
- func (s *SocialGrafanaCom) Type() int
- func (s *SocialGrafanaCom) UserInfo(client *http.Client) (*BasicUserInfo, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingTeamMembership = &Error{"User not a member of one of the required teams"} ErrMissingOrganizationMembership = &Error{"User not a member of one of the required organizations"} )
View Source
var ( SocialBaseUrl = "/login/" SocialMap = make(map[string]SocialConnector) )
Functions ¶
func NewOAuthService ¶
func NewOAuthService()
Types ¶
type BasicUserInfo ¶
type GenericOAuth ¶
func (*GenericOAuth) FetchOrganizations ¶
func (s *GenericOAuth) FetchOrganizations(client *http.Client) ([]string, error)
func (*GenericOAuth) FetchPrivateEmail ¶
func (s *GenericOAuth) FetchPrivateEmail(client *http.Client) (string, error)
func (*GenericOAuth) FetchTeamMemberships ¶
func (s *GenericOAuth) FetchTeamMemberships(client *http.Client) ([]int, error)
func (*GenericOAuth) IsEmailAllowed ¶
func (s *GenericOAuth) IsEmailAllowed(email string) bool
func (*GenericOAuth) IsOrganizationMember ¶
func (s *GenericOAuth) IsOrganizationMember(client *http.Client) bool
func (*GenericOAuth) IsSignupAllowed ¶
func (s *GenericOAuth) IsSignupAllowed() bool
func (*GenericOAuth) IsTeamMember ¶
func (s *GenericOAuth) IsTeamMember(client *http.Client) bool
func (*GenericOAuth) Type ¶
func (s *GenericOAuth) Type() int
func (*GenericOAuth) UserInfo ¶
func (s *GenericOAuth) UserInfo(client *http.Client) (*BasicUserInfo, error)
type SocialConnector ¶
type SocialConnector interface { Type() int UserInfo(client *http.Client) (*BasicUserInfo, error) IsEmailAllowed(email string) bool IsSignupAllowed() bool AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string Exchange(ctx context.Context, code string) (*oauth2.Token, error) Client(ctx context.Context, t *oauth2.Token) *http.Client }
type SocialGithub ¶
func (*SocialGithub) FetchOrganizations ¶
func (s *SocialGithub) FetchOrganizations(client *http.Client) ([]string, error)
func (*SocialGithub) FetchPrivateEmail ¶
func (s *SocialGithub) FetchPrivateEmail(client *http.Client) (string, error)
func (*SocialGithub) FetchTeamMemberships ¶
func (s *SocialGithub) FetchTeamMemberships(client *http.Client) ([]int, error)
func (*SocialGithub) IsEmailAllowed ¶
func (s *SocialGithub) IsEmailAllowed(email string) bool
func (*SocialGithub) IsOrganizationMember ¶
func (s *SocialGithub) IsOrganizationMember(client *http.Client) bool
func (*SocialGithub) IsSignupAllowed ¶
func (s *SocialGithub) IsSignupAllowed() bool
func (*SocialGithub) IsTeamMember ¶
func (s *SocialGithub) IsTeamMember(client *http.Client) bool
func (*SocialGithub) Type ¶
func (s *SocialGithub) Type() int
func (*SocialGithub) UserInfo ¶
func (s *SocialGithub) UserInfo(client *http.Client) (*BasicUserInfo, error)
type SocialGoogle ¶
func (*SocialGoogle) IsEmailAllowed ¶
func (s *SocialGoogle) IsEmailAllowed(email string) bool
func (*SocialGoogle) IsSignupAllowed ¶
func (s *SocialGoogle) IsSignupAllowed() bool
func (*SocialGoogle) Type ¶
func (s *SocialGoogle) Type() int
func (*SocialGoogle) UserInfo ¶
func (s *SocialGoogle) UserInfo(client *http.Client) (*BasicUserInfo, error)
type SocialGrafanaCom ¶
func (*SocialGrafanaCom) IsEmailAllowed ¶
func (s *SocialGrafanaCom) IsEmailAllowed(email string) bool
func (*SocialGrafanaCom) IsOrganizationMember ¶
func (s *SocialGrafanaCom) IsOrganizationMember(organizations []OrgRecord) bool
func (*SocialGrafanaCom) IsSignupAllowed ¶
func (s *SocialGrafanaCom) IsSignupAllowed() bool
func (*SocialGrafanaCom) Type ¶
func (s *SocialGrafanaCom) Type() int
func (*SocialGrafanaCom) UserInfo ¶
func (s *SocialGrafanaCom) UserInfo(client *http.Client) (*BasicUserInfo, error)
Click to show internal directories.
Click to hide internal directories.