tokens

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRegistrationRecord added in v1.0.0

func CreateRegistrationRecord(ctx context.Context, c registration.RegistrationClient, parentID, spiffeID string) error

func CreateToken added in v1.0.0

func CreateToken(ctx context.Context, c registration.RegistrationClient, ttl int) (string, error)

func CreateWorkloads added in v1.0.0

func CreateWorkloads(ctx context.Context, c registration.RegistrationClient, xname string, workloads []Workload) error

func GenerateToken

func GenerateToken(w http.ResponseWriter, r *http.Request)

GenerateToken - generate new Spire Join token

func IntSliceContains

func IntSliceContains(s []int, e int) bool

IntSliceContains will check for an integer value in a slice

func Logger

func Logger(inner http.Handler, name string) http.Handler

Logger is the general api logger

func NewRegistrationClient

func NewRegistrationClient(socketPath string, ctx context.Context) (registration.RegistrationClient, error)

func NewRouter

func NewRouter() *mux.Router

NewRouter creates a new router

func RootGet

func RootGet(w http.ResponseWriter, r *http.Request)

RootGet - Returns service/api info

Types

type Info

type Info struct {
	Version string `json:"version,omitempty"`
}

Info is the root info representation

type ProblemDetails

type ProblemDetails struct {
	Title  string `json:"title,omitempty"`
	Status int32  `json:"status,omitempty"`
	Detail string `json:"detail,omitempty"`
}

ProblemDetails is a structure for returning an error via the api

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route is an http route

type Routes

type Routes []Route

Routes are a collection of http routes

type Token

type Token struct {
	JoinToken string `json:"join_token,omitempty"`
}

JoinToken is Spire issued join token

type Workload added in v1.0.0

type Workload struct {
	SpiffeID  string             `yaml:"spiffeID"`
	Selectors []WorkloadSelector `yaml:"selectors"`
	Ttl       int32              `yaml:"ttl,omitempty"`
}

func ParseWorkloads added in v1.0.0

func ParseWorkloads(file string) ([]Workload, error)

type WorkloadSelector added in v1.0.0

type WorkloadSelector struct {
	Type  string `yaml:"type"`
	Value string `yaml:"value"`
}

Jump to

Keyboard shortcuts

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