api

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: Apache-2.0 Imports: 34 Imported by: 17

Documentation

Index

Constants

View Source
const (
	PEMCertificateChain         = "application/pem-certificate-chain"
	SCTMetadataKey              = "x-sct"
	HTTPResponseCodeMetadataKey = "x-http-code"
)
View Source
const (
	MetadataOIDCTokenKey = "oidcidentitytoken"
)
View Source
const SigstorePublicServerURL = "https://fulcio.sigstore.dev"

SigstorePublicServerURL is the URL of Sigstore's public Fulcio service.

Variables

View Source
var (
	MetricLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name: "fulcio_api_latency",
		Help: "API Latency on calls",
	}, []string{"code", "method"})

	RequestsCount = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "http_requests_total",
		Help: "Count all HTTP requests",
	}, []string{"code", "method"})
)

Functions

func NewGRPCCAServer added in v0.4.0

func NewLegacyGRPCCAServer added in v0.4.0

func NewLegacyGRPCCAServer(v2Server fulciogrpc.CAServer) legacy.CAServer

func WithMaxBytes added in v0.2.0

func WithMaxBytes(next http.Handler, n int64) http.Handler

WithMaxBytes sets the max request size on a handler to n bytes.

Types

type CertificateRequest added in v0.2.0

type CertificateRequest struct {
	// +optional
	PublicKey Key `json:"publicKey"`

	// +optional
	SignedEmailAddress []byte `json:"signedEmailAddress"`

	// +optional
	CertificateSigningRequest []byte `json:"certificateSigningRequest"`
}

type CertificateResponse added in v0.2.0

type CertificateResponse struct {
	CertPEM  []byte
	ChainPEM []byte
	SCT      []byte
}

type ClientOption added in v0.2.0

type ClientOption func(*clientOptions)

ClientOption is a functional option for customizing static signatures.

func WithTimeout added in v0.2.0

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout sets the request timeout for the client

func WithUserAgent added in v0.2.0

func WithUserAgent(userAgent string) ClientOption

WithUserAgent sets the media type of the signature.

type Info added in v0.4.0

type Info struct {
	GitVersion   string
	GitCommit    string
	GitTreeState string
	BuildDate    string
	GoVersion    string
	Compiler     string
	Platform     string
}

func VersionInfo added in v0.4.0

func VersionInfo() Info

func (*Info) JSONString added in v0.4.0

func (i *Info) JSONString() (string, error)

JSONString returns the JSON representation of the version info

func (*Info) String added in v0.4.0

func (i *Info) String() string

String returns the string representation of the version info

type Key added in v0.2.0

type Key struct {
	// +required
	Content   []byte `json:"content"`
	Algorithm string `json:"algorithm,omitempty"`
}

type LegacyClient added in v0.4.0

type LegacyClient interface {
	// SigningCert sends the provided CertificateRequest to the /api/v1/signingCert
	// endpoint of a Fulcio API, authenticated with the provided bearer token.
	SigningCert(cr CertificateRequest, token string) (*CertificateResponse, error)
	// RootCert sends a request to get the current CA used by Fulcio.
	RootCert() (*RootResponse, error)
}

LegacyClient is the interface for accessing the Fulcio API.

func NewClient added in v0.2.0

func NewClient(url *url.URL, opts ...ClientOption) LegacyClient

NewClient creates a new Fulcio API client talking to the provided URL.

type RootResponse added in v0.2.0

type RootResponse struct {
	ChainPEM []byte
}

Jump to

Keyboard shortcuts

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