Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateSignature ¶
CalculateSignature calculates a signature based on a (repository's) secret.
func CompareSignatures ¶
CompareSignatures does a constant time comparison of two signatures.
Types ¶
type Method ¶
type Method interface { RequestToken(repoFullName string) *oauth2.Token RequestSecret(repoFullName string) []byte }
Method is a simple interface every authentication method has to implement. This might change in the future.
type Repository ¶
type Repository struct {
Token, Secret string
}
Repository is used to store tokens and secrets per repository. Tokens are used for downloading private repositories, setting statuses, etc. Secret are used to verify clients.
type SimpleAuth ¶
type SimpleAuth struct {
Store map[string]Repository
}
SimpleAuth is a map from strings representing repository names to its token and/or secret.
func (SimpleAuth) RequestSecret ¶
func (auth SimpleAuth) RequestSecret(repoFullName string) []byte
RequestSecret returns the secret that belongs to a specific repository.
func (SimpleAuth) RequestToken ¶
func (auth SimpleAuth) RequestToken(repoFullName string) *oauth2.Token
RequestToken the token that belongs to a specific repository.