auth

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 12 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, privateKey string) (string, error)

GetSignedJwtToken get a tokens signed with private key

func MakeAccessTokenForInstallation

func MakeAccessTokenForInstallation(appID, privateKey string, installation int) (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(secret string, bytesIn []byte, xHubSignature 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