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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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