mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
857 B
21 lines
857 B
package goth
|
|
|
|
// Params is used to pass data to sessions for authorization. An existing
|
|
// implementation, and the one most likely to be used, is `url.Values`.
|
|
type Params interface {
|
|
Get(string) string
|
|
}
|
|
|
|
// Session needs to be implemented as part of the provider package.
|
|
// It will be marshaled and persisted between requests to "tie"
|
|
// the start and the end of the authorization process with a
|
|
// 3rd party provider.
|
|
type Session interface {
|
|
// GetAuthURL returns the URL for the authentication end-point for the provider.
|
|
GetAuthURL() (string, error)
|
|
// Marshal generates a string representation of the Session for storing between requests.
|
|
Marshal() string
|
|
// Authorize should validate the data from the provider and return an access token
|
|
// that can be stored for later access to the provider.
|
|
Authorize(Provider, Params) (string, error)
|
|
}
|
|
|