auth

package
v0.0.0-...-58340d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMAC

func CheckMAC(message, messageMAC, key []byte) bool

CheckMAC verifies hash checksum

func GetSignedJwtToken

func GetSignedJwtToken(appID, keyPath string) (string, error)

GetSignedJwtToken get a tokens signed with private key

func IsCustomer

func IsCustomer(repo types.Repository) (bool, error)

func MakeAccessTokenForInstallation

func MakeAccessTokenForInstallation(appID string, installation int, privateKeyPath string) (string, error)

MakeAccessTokenForInstallation makes an access token for an installation / private key

func MakeClient

func MakeClient(ctx context.Context, accessToken string) *github.Client

MakeClient make a HTTP client with a signed access token

func ValidateHMAC

func ValidateHMAC(bytesIn []byte, xHubSignature string, secretKey string) error

ValidateHMAC validate a digest from Github via xHubSignature

Types

type JwtAuth

type JwtAuth struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
}

JwtAuth token issued by Github in response to signed JWT Token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL