Documentation ¶
Index ¶
- type GitlabProvider
- func (provider *GitlabProvider) CompleteAuth(data objx.Map) (*common.Credentials, error)
- func (provider *GitlabProvider) DisplayName() string
- func (provider *GitlabProvider) Get(creds *common.Credentials, endpoint string) (objx.Map, error)
- func (provider *GitlabProvider) GetBeginAuthURL(state *common.State, options objx.Map) (string, error)
- func (provider *GitlabProvider) GetClient(creds *common.Credentials) (*http.Client, error)
- func (provider *GitlabProvider) GetUser(creds *common.Credentials) (common.User, error)
- func (provider *GitlabProvider) Name() string
- func (provider *GitlabProvider) PublicData(options map[string]interface{}) (interface{}, error)
- func (provider *GitlabProvider) TripperFactory() common.TripperFactory
- type User
- func (u *User) AuthCode() string
- func (u *User) AvatarURL() string
- func (u *User) Data() objx.Map
- func (u *User) Email() string
- func (u *User) IDForProvider(provider string) string
- func (u *User) Name() string
- func (u *User) Nickname() string
- func (u *User) ProviderCredentials() map[string]*common.Credentials
- func (u *User) PublicData(options map[string]interface{}) (publicData interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitlabProvider ¶
type GitlabProvider struct {
// contains filtered or unexported fields
}
GitlabProvider implements the Provider interface and provides Gitlab OAuth2 communication capabilities.
func New ¶
func New(clientId, clientSecret, redirectUrl string) *GitlabProvider
func (*GitlabProvider) CompleteAuth ¶
func (provider *GitlabProvider) CompleteAuth(data objx.Map) (*common.Credentials, error)
CompleteAuth takes a map of arguments that are used to complete the authorisation process, completes it, and returns the appropriate Credentials.
func (*GitlabProvider) DisplayName ¶
func (provider *GitlabProvider) DisplayName() string
DisplayName is the human readable name for this provider.
func (*GitlabProvider) Get ¶
func (provider *GitlabProvider) Get(creds *common.Credentials, endpoint string) (objx.Map, error)
Get makes an authenticated request and returns the data in the response as a data map.
func (*GitlabProvider) GetBeginAuthURL ¶
func (provider *GitlabProvider) GetBeginAuthURL(state *common.State, options objx.Map) (string, error)
GetBeginAuthURL gets the URL that the client must visit in order to begin the authentication process.
The state argument contains anything you wish to have sent back to your callback endpoint. The options argument takes any options used to configure the auth request sent to the provider. In the case of OAuth2, the options map can contain:
- A "scope" key providing the desired scope(s). It will be merged with the default scope.
func (*GitlabProvider) GetClient ¶
func (provider *GitlabProvider) GetClient(creds *common.Credentials) (*http.Client, error)
GetClient returns an authenticated http.Client that can be used to make requests to protected Github resources
func (*GitlabProvider) GetUser ¶
func (provider *GitlabProvider) GetUser(creds *common.Credentials) (common.User, error)
GetUser uses the specified common.Credentials to access the users profile from the remote provider, and builds the appropriate User object.
func (*GitlabProvider) Name ¶
func (provider *GitlabProvider) Name() string
Name is the unique name for this provider.
func (*GitlabProvider) PublicData ¶
func (provider *GitlabProvider) PublicData(options map[string]interface{}) (interface{}, error)
PublicData gets a public readable view of this provider.
func (*GitlabProvider) TripperFactory ¶
func (provider *GitlabProvider) TripperFactory() common.TripperFactory
TripperFactory gets an OAuth2TripperFactory
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) AuthCode ¶
AuthCode gets this user's globally unique ID (generated by the host program)
func (*User) IDForProvider ¶
IDForProvider gets the ID value for the specified provider name for this user from the ProviderCredentials data.
func (*User) ProviderCredentials ¶
func (u *User) ProviderCredentials() map[string]*common.Credentials
ProviderCredentials gets a map of Credentials (by provider name).