util

package
v0.0.0-...-cabf14c Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfiguration

func BuildConfiguration() (*rest.Config, error)

func FakeJWT

func FakeJWT(issuerURL string) (string, error)

fakeJWT generates a valid JWT using the passed input parameters which is signed by a generated key. This is useful for checking the status of a signer.

func FreePort

func FreePort() (string, error)

func LoadRBACConfig

func LoadRBACConfig(path string) (map[string]RBAC, error)

func ParseTokenFromRequest

func ParseTokenFromRequest(req *http.Request) (string, bool)

Return just the token from the header of the request, without 'bearer'.

func SignalHandler

func SignalHandler() chan struct{}

Types

type ClusterRole

type ClusterRole struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name        string `yaml:"name"`
		ClusterName string `yaml:"clusterName,omitempty"`
	} `yaml:"metadata"`
	Rules []Rules `yaml:"rules"`
}

type ClusterRoleBinding

type ClusterRoleBinding struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name        string `yaml:"name"`
		ClusterName string `yaml:"clusterName,omitempty"`
	} `yaml:"metadata"`
	RoleRef struct {
		APIGroup string `yaml:"apiGroup"`
		Kind     string `yaml:"kind"`
		Name     string `yaml:"name"`
	} `yaml:"roleRef"`
	Subjects []Subject `yaml:"subjects"`
}

type RBAC

type RBAC struct {
	Roles               []*v1.Role
	RoleBindings        []*v1.RoleBinding
	ClusterRoles        []*v1.ClusterRole
	ClusterRoleBindings []*v1.ClusterRoleBinding
}

type Role

type Role struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name        string `yaml:"name"`
		Namespace   string `yaml:"namespace,omitempty"`
		ClusterName string `yaml:"clusterName,omitempty"`
	} `yaml:"metadata"`
	Rules []Rules `yaml:"rules"`
}

type RoleBinding

type RoleBinding struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name        string `yaml:"name"`
		Namespace   string `yaml:"namespace,omitempty"`
		ClusterName string `yaml:"clusterName,omitempty"`
	} `yaml:"metadata"`
	RoleRef struct {
		APIGroup string `yaml:"apiGroup"`
		Kind     string `yaml:"kind"`
		Name     string `yaml:"name"`
	} `yaml:"roleRef"`
	Subjects []Subject `yaml:"subjects"`
}

type Rules

type Rules struct {
	APIGroups []string `yaml:"apiGroups"`
	Resources []string `yaml:"resources"`
	Verbs     []string `yaml:"verbs"`
}

type Subject

type Subject struct {
	Kind      string `yaml:"kind"`
	Name      string `yaml:"name"`
	APIGroup  string `yaml:"apiGroup,omitempty"`
	Namespace string `yaml:"namespace,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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