Documentation
¶
Index ¶
Constants ¶
View Source
const ( HeaderGithubSignature = "x-hub-signature-256" HeaderRunnerSignature = "x-deepsource-signature-256" HeaderRunnerID = "x-deepsource-runner-id" HeaderAppID = "x-deepsource-app-id" HeaderContentType = "Content-Type" )
View Source
const (
HeaderInstallationID = "X-Installation-Id"
)
View Source
const (
HeaderValueGithubAccept = "application/vnd.github+json"
)
Variables ¶
View Source
var ( GithubURLAccessTokenFmt = "/app/installations/%s/access_tokens" ErrAppNotFound = fmt.Errorf("app not found") )
View Source
var ( ErrInvalidSignature = errors.New("invalid signature") ErrMandatoryArgsMissing = errors.New("mandatory args missing") )
View Source
var (
ErrConfigNotFound = errors.New("config not found")
)
Functions ¶
This section is empty.
Types ¶
type APIProxy ¶
type APIProxy struct {
// contains filtered or unexported fields
}
func (*APIProxy) GenerateAccessToken ¶
GenerateAccessToken generates a short lived access token for the Github App using the JWT token.
func (*APIProxy) GenerateJWT ¶
GenerateJWT generates a signed JWT token for the Github App.
func (*APIProxy) InstallationURL ¶
type APIProxyFactory ¶
type APIProxyFactory struct {
// contains filtered or unexported fields
}
func NewAPIProxyFactory ¶
func NewAPIProxyFactory(apps map[string]*App, client *http.Client) *APIProxyFactory
type APIRequest ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(apiF *APIProxyFactory, webhookF *WebhookProxyFactory) (*Handler, error)
func (*Handler) AuthenticatedRemoteURL ¶
func (*Handler) HandleInstallation ¶
HandleInstallation redirects the user to the installation page on Github.
type InstallationRequest ¶
type InstallationRequest struct {
AppID string `param:"app_id"`
}
type WebhookProxy ¶
type WebhookProxy struct {
// contains filtered or unexported fields
}
func NewWebhookProxy ¶
func NewWebhookProxy(app *App, runner *model.Runner, deepsource *model.DeepSource, client *http.Client) (*WebhookProxy, error)
func (*WebhookProxy) VerifySignature ¶
func (p *WebhookProxy) VerifySignature(signature string, body []byte) error
type WebhookProxyFactory ¶
type WebhookProxyFactory struct {
// contains filtered or unexported fields
}
func NewWebhookProxyFactory ¶
func NewWebhookProxyFactory(runner *model.Runner, deepsource *model.DeepSource, apps map[string]*App, client *http.Client) *WebhookProxyFactory
func (*WebhookProxyFactory) New ¶
func (g *WebhookProxyFactory) New(appID string) (*WebhookProxy, error)
type WebhookRequest ¶
type WebhookRequest struct {
AppID string `param:"app_id"`
}
Click to show internal directories.
Click to hide internal directories.