environ

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const V1 = "application/vnd.drone.env.v1+json"

V1 is version 1 of the env API

View Source
const V2 = "application/vnd.drone.env.v2+json"

V2 is version 2 of the env API

Variables

This section is empty.

Functions

func Handler

func Handler(secret string, plugin Plugin, logs logger.Logger) http.Handler

Handler returns a http.Handler that accepts JSON-encoded HTTP requests for environment variables, invokes the underlying plugin, and writes the JSON-encoded secret to the HTTP response.

The handler verifies the authenticity of the HTTP request using the http-signature, and returns a 400 Bad Request if the signature is missing or invalid.

The handler can optionally encrypt the response body using aesgcm if the HTTP request includes the Accept-Encoding header set to aesgcm.

Types

type Plugin

type Plugin interface {
	List(context.Context, *Request) ([]*Variable, error)
}

Plugin responds to a registry request.

func Client

func Client(endpoint, secret string, skipverify bool) Plugin

Client returns a new plugin client.

type Request

type Request struct {
	Repo  drone.Repo  `json:"repo,omitempty"`
	Build drone.Build `json:"build,omitempty"`
}

Request defines a environment request.

type Variable

type Variable struct {
	Name string `json:"name,omitempty"`
	Data string `json:"data,omitempty"`
	Mask bool   `json:"mask,omitempty"`
}

Variable defines an environment variable.

Jump to

Keyboard shortcuts

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