kubeconfig

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AccountIDAttrCN is accountID attribute key of CN
	AccountIDAttrCN = "a"
	// PartnerIDAttrCN is partnerID attribute key of CN
	PartnerIDAttrCN = "p"
	// OrganizationIDAttrCN is organizationID attribute key of CN
	OrganizationIDAttrCN = "o"
	// IsSSOAttrCN is accountID isSSO attribute key of CN
	IsSSOAttrCN = "is"
	// EnforceSessionAttrCN is enforeSession attribute key of CN
	EnforceSessionAttrCN = "es"
	// UsernameAttrCN is username attribute key of CN
	UsernameAttrCN = "u"
	// SessionTypeCN type of kubcel session cli/web/system
	SessionTypeCN = "st"
	// SystemUserCN is system user attribute key of CN
	SystemUserCN = "su"

	// TerminalShell is the session originated for a terminal based kubectl cli
	TerminalShell = "ts"
	// WebShell is the session originated for browser based kubectl
	WebShell = "ws"
	// ParalusSystem is the session originated for paralus system controller purpose e.g. native helm
	ParalusSystem = "rs"
	// RelayNetwork is the session originated for custom relay network (non-core-relay)
	RelayNetworkCN = "rn"
)

Variables

This section is empty.

Functions

func GetBoolFromString

func GetBoolFromString(s string) bool

GetBoolFromString returns bool values of string

func GetConfigForCluster

GetConfigForCluster returns YAML encoded kubeconfig

func GetSessionTypeString

func GetSessionTypeString(t string) string

GetSessionTypeString get type description

func GetStringFromBool

func GetStringFromBool(val bool) string

GetStringFromBool returns string value of bool

func GetUserAttrs

func GetUserAttrs(cn string) map[string]string

GetUserAttrs returns attrs from cn

func GetUserCN

func GetUserCN(attrs map[string]string) string

GetUserCN returns user cn from attrs

Types

type CNAttributes

type CNAttributes struct {
	AccountID      string
	PartnerID      string
	OrganizationID string
	Username       string
	IsSSO          bool
	EnforceSession bool
	SessionType    string
	SystemUser     bool
	RelayNetwork   bool
}

CNAttributes are the attributes encoded in CommonName of kubeconfig cert

func GetCNAttributes

func GetCNAttributes(cn string) (cnAttr CNAttributes)

GetCNAttributes gets attributes from CN

func (*CNAttributes) GetCN

func (cn *CNAttributes) GetCN() string

GetCN returns CommonName using CNAttributes

Jump to

Keyboard shortcuts

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