Versions in this module Expand all Collapse all v0 v0.1.4 Jan 13, 2022 v0.1.3 Jan 10, 2022 Changes in this version + var ConnectorMap = make(map[string]Connector) + var ErrMissingGroupMembership = &Error + var ErrMissingOrganizationMembership = &Error + var ErrMissingTeamMembership = &Error + var OauthStateCookieName = "oauth_state" + func GenStateString() (string, error) + func HashStateCode(secretKey, code, seed string) string + func NewOAuthService(appURL, baseURL string, auths []OAuthInfo) + func ParseAppAndSubURL(rootURL string) (string, string, error) + type Base struct + func (s *Base) IsEmailAllowed(email string) bool + func (s *Base) IsSignupAllowed() bool + type BasicUserInfo struct + Company string + Email string + Groups []string + Id string + Login string + Name string + Role string + type Connector interface + AuthCodeURL func(state string, opts ...oauth2.AuthCodeOption) string + Client func(ctx context.Context, token *oauth2.Token) *http.Client + Exchange func(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + IsEmailAllowed func(email string) bool + IsSignupAllowed func() bool + TokenSource func(ctx context.Context, token *oauth2.Token) oauth2.TokenSource + Type func() int + UserInfo func(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error) + type Error struct + func (e *Error) Error() string + type GithubTeam struct + Id int + Organization struct{ ... } + Slug string + URL string + func (t *GithubTeam) GetShorthand() (string, error) + type HttpGetResponse struct + Body []byte + Headers http.Header + func HttpGet(client *http.Client, url string) (response HttpGetResponse, err error) + type OAuthInfo struct + AllowSignup bool + AllowedDomains []string + AllowedGroups []string + AllowedOrganizations []string + ApiUrl string + AuthUrl string + ClientId string + ClientSecret string + EmailAttributeName string + EmailAttributePath string + Enable bool + HostedDomain string + Name string + RoleAttributePath string + Scopes []string + TeamIds []interface{} + TlsClientCa string + TlsClientCert string + TlsClientKey string + TlsSkipVerify bool + TokenUrl string + Typ string + type OAuthType int + const GENERIC + const GITHUB + const GITLAB + const GOOGLE + const GRAFANA + type OAuths struct + OAuthInfos map[string]*OAuthInfo + var OAuthService *OAuths + type OrgRecord struct + Login string + type SocialGenericOAuth struct + func (s *SocialGenericOAuth) FetchOrganizations(client *http.Client) ([]string, bool) + func (s *SocialGenericOAuth) FetchPrivateEmail(client *http.Client) (string, error) + func (s *SocialGenericOAuth) FetchTeamMemberships(client *http.Client) ([]int, bool) + func (s *SocialGenericOAuth) IsOrganizationMember(client *http.Client) bool + func (s *SocialGenericOAuth) IsTeamMember(client *http.Client) bool + func (s *SocialGenericOAuth) Type() int + func (s *SocialGenericOAuth) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error) + type SocialGithub struct + func (s *SocialGithub) FetchOrganizations(client *http.Client, organizationsUrl string) ([]string, error) + func (s *SocialGithub) FetchPrivateEmail(client *http.Client) (string, error) + func (s *SocialGithub) FetchTeamMemberships(client *http.Client) ([]GithubTeam, error) + func (s *SocialGithub) HasMoreRecords(headers http.Header) (string, bool) + func (s *SocialGithub) IsOrganizationMember(client *http.Client, organizationsUrl string) bool + func (s *SocialGithub) IsTeamMember(client *http.Client) bool + func (s *SocialGithub) Type() int + func (s *SocialGithub) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error) + type SocialGitlab struct + func (s *SocialGitlab) GetGroups(client *http.Client) []string + func (s *SocialGitlab) GetGroupsPage(client *http.Client, url string) ([]string, string) + func (s *SocialGitlab) IsGroupMember(groups []string) bool + func (s *SocialGitlab) Type() int + func (s *SocialGitlab) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error) + type SocialGoogle struct + func (s *SocialGoogle) Type() int + func (s *SocialGoogle) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error) + type SocialGrafanaCom struct + func (s *SocialGrafanaCom) IsEmailAllowed(email string) bool + func (s *SocialGrafanaCom) IsOrganizationMember(organizations []OrgRecord) bool + func (s *SocialGrafanaCom) Type() int + func (s *SocialGrafanaCom) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error) + type UserInfoJson struct + Attributes map[string][]string + DisplayName string + Email string + Login string + Name string + Upn string + Username string + func (info *UserInfoJson) String() string