httpapi

package
v0.0.0-...-e3fd340 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSecretRef = types.NamespacedName{
	Name:      "pipelines-app-gitops",
	Namespace: "pipelines-app-delivery",
}

DefaultSecretRef is the name looked up if none is provided in the URL.

Functions

func AuthToken

func AuthToken(ctx context.Context) string

AuthToken gets the auth token from the context.

func AuthenticationMiddleware

func AuthenticationMiddleware(next http.Handler) http.Handler

AuthenticationMiddleware wraps an http.Handler and checks for the presence of an 'Authorization' header with a bearer token.

This token is placed into the context, and is accessible via the AuthToken function.

No attempt to validate the actual token is made.

func WithAuthToken

func WithAuthToken(ctx context.Context, t string) context.Context

WithAuthToken sets the auth token into the context.

Types

type APIRouter

type APIRouter struct {
	*httprouter.Router
	// contains filtered or unexported fields
}

APIRouter is an HTTP API for accessing app configurations.

func NewRouter

NewRouter creates and returns a new APIRouter.

func (*APIRouter) GetApplication

func (a *APIRouter) GetApplication(w http.ResponseWriter, r *http.Request)

GetApplication fetches an application within a specific environment.

Expects the

func (*APIRouter) GetPipelines

func (a *APIRouter) GetPipelines(w http.ResponseWriter, r *http.Request)

GetPipelines fetches and returns the pipeline body.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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