kfam

package
v0.0.0-...-7092541 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

README

Go API Server for swagger

Access Management API.

Overview

This server was generated by the [swagger-codegen] (https://github.com/swagger-api/swagger-codegen) project.
By using the OpenAPI-Spec from a remote server, you can easily generate a server stub.

To see how to make this your own, look here:

README

  • API version: 0.1.0
  • Build date: 2019-05-23T21:27:35.769Z
Running the server

To run the server, follow these simple steps:

go run main.go

Documentation

Index

Constants

View Source
const ACTION = "action"
View Source
const AuthorizationPolicy = "authorizationpolicies"
View Source
const COMPONENT = "component"
View Source
const KFAM = "kfam"
View Source
const KIND = "kind"
View Source
const MAX_TAG_LEN = 30
View Source
const PATH = "path"
View Source
const Profiles = "profiles"
View Source
const REQUSER = "user"

User that make the request

View Source
const ROLE = "role"
View Source
const SEVERITY = "severity"
View Source
const SEVERITY_CRITICAL = "critical"
View Source
const SEVERITY_MAJOR = "major"
View Source
const SEVERITY_MINOR = "minor"
View Source
const USER = "user"

Variables

This section is empty.

Functions

func GetEnvDefault

func GetEnvDefault(variable string, defaultVal string) string

func IncRequestCounter

func IncRequestCounter(kind string, user string, action string, path string)

func IncRequestErrorCounter

func IncRequestErrorCounter(kind string, user string, action string, path string, severity string)

func Index

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

func Logger

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

func NewRouter

func NewRouter(kfamV1Alpha1 KfamV1Alpha1Interface) *mux.Router

Types

type Binding

type Binding struct {
	User *rbacv1.Subject `json:"user,omitempty"`

	ReferredNamespace string `json:"referredNamespace,omitempty"`

	RoleRef *rbacv1.RoleRef `json:"RoleRef,omitempty"`

	// Status of the profile, one of Succeeded, Failed, Unknown.
	Status string `json:"status,omitempty"`
}

Binding will give user edit access to referredNamespace

type BindingClient

type BindingClient struct {
	// contains filtered or unexported fields
}

func (*BindingClient) Create

func (c *BindingClient) Create(binding *Binding, userIdHeader string, userIdPrefix string) error

func (*BindingClient) Delete

func (c *BindingClient) Delete(binding *Binding) error

func (*BindingClient) List

func (c *BindingClient) List(user string, namespaces []string, role string) (*BindingEntries, error)

type BindingEntries

type BindingEntries struct {
	Bindings []Binding `json:"bindings,omitempty"`
}

type BindingInterface

type BindingInterface interface {
	Create(binding *Binding, userIdHeader string, userIdPrefix string) error
	Delete(binding *Binding) error
	List(user string, namespaces []string, role string) (*BindingEntries, error)
}

type KfamV1Alpha1Client

type KfamV1Alpha1Client struct {
	// contains filtered or unexported fields
}

func NewKfamClient

func NewKfamClient(userIdHeader string, userIdPrefix string, clusterAdmin string) (*KfamV1Alpha1Client, error)

func (*KfamV1Alpha1Client) CreateBinding

func (c *KfamV1Alpha1Client) CreateBinding(w http.ResponseWriter, r *http.Request)

func (*KfamV1Alpha1Client) CreateProfile

func (c *KfamV1Alpha1Client) CreateProfile(w http.ResponseWriter, r *http.Request)

func (*KfamV1Alpha1Client) DeleteBinding

func (c *KfamV1Alpha1Client) DeleteBinding(w http.ResponseWriter, r *http.Request)

func (*KfamV1Alpha1Client) DeleteProfile

func (c *KfamV1Alpha1Client) DeleteProfile(w http.ResponseWriter, r *http.Request)

func (*KfamV1Alpha1Client) QueryClusterAdmin

func (c *KfamV1Alpha1Client) QueryClusterAdmin(w http.ResponseWriter, r *http.Request)

func (*KfamV1Alpha1Client) ReadBinding

func (c *KfamV1Alpha1Client) ReadBinding(w http.ResponseWriter, r *http.Request)

type KfamV1Alpha1Interface

type KfamV1Alpha1Interface interface {
	CreateBinding(w http.ResponseWriter, r *http.Request)
	CreateProfile(w http.ResponseWriter, r *http.Request)
	DeleteBinding(w http.ResponseWriter, r *http.Request)
	DeleteProfile(w http.ResponseWriter, r *http.Request)
	ReadBinding(w http.ResponseWriter, r *http.Request)
	QueryClusterAdmin(w http.ResponseWriter, r *http.Request)
}

type ProfileClient

type ProfileClient struct {
	// contains filtered or unexported fields
}

func (*ProfileClient) Create

func (c *ProfileClient) Create(profile *v1beta1.Profile) (*v1beta1.Profile, error)

func (*ProfileClient) Delete

func (c *ProfileClient) Delete(name string, opts *metav1.DeleteOptions) error

func (*ProfileClient) Get

func (c *ProfileClient) Get(name string, opts metav1.GetOptions) (*v1beta1.Profile, error)

func (*ProfileClient) List

func (*ProfileClient) Update

func (c *ProfileClient) Update(profile *v1beta1.Profile) (*v1beta1.Profile, error)

type ProfileInterface

type ProfileInterface interface {
	Create(profile *v1beta1.Profile) (*v1beta1.Profile, error)
	Delete(name string, opts *metav1.DeleteOptions) error
	Get(name string, opts metav1.GetOptions) (*v1beta1.Profile, error)
	List(opts metav1.ListOptions) (*v1beta1.ProfileList, error)
	Update(profile *v1beta1.Profile) (*v1beta1.Profile, error)
}

type Route

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

type Routes

type Routes []Route

Jump to

Keyboard shortcuts

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