rbac

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: Apache-2.0 Imports: 11 Imported by: 2

README

rbac for palm

Quick start

Using the http server

Install

terminal is sub module of fist, if you already install fist, needn't install this again.

cd rbac/deploy
kubectl create ns sealyun
kubectl create -f secret.yaml
kubectl create -f deploy.yaml

default admin account

username : admin password : 1f2d1e2e67df

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//RbacPort is cmd port
	RbacPort uint16
	//RbacLdapEnable is cmd enable for ldap
	RbacLdapEnable bool
)
View Source
var (
	//RbacLdapPort is config port for ldap . type string
	RbacLdapPort uint16
	//RbacLdapHost is cmd host for ldap
	RbacLdapHost string
	//RbacLdapBindDN is cmd bind-dn for ldap
	RbacLdapBindDN string
	//RbacLdapBindPassword is cmd bind-password for ldap
	RbacLdapBindPassword string
)
View Source
var AdminPassword string

AdminPassword is global vars for admin password

View Source
var AdminUsername string

AdminUsername is global vars for admin username

Functions

func AddUserInfo

func AddUserInfo(userInfo *UserInfo) error

AddUserInfo is add method from server_fist

func DelUserInfo

func DelUserInfo(name string) error

DelUserInfo is del method from server_fist

func FistCookieUpdateUserInfo added in v0.0.1

func FistCookieUpdateUserInfo(response *restful.Response, userInfo *UserInfo)

FistCookieUpdateUserInfo is update fist cookie user info

func FistRegister

func FistRegister(auth *restful.WebService)

FistRegister is fist auth controller

func Serve

func Serve()

Serve start a auth server

func UpdateUserInfo

func UpdateUserInfo(userInfo *UserInfo) error

UpdateUserInfo is update method from server_fist

Types

type Admin

type Admin struct {
	Name   string
	Passwd string
}

Admin is struct of Adminer interface

func (*Admin) IsAdmin

func (admin *Admin) IsAdmin() (bool, error)

IsAdmin is implements for Adminer function

func (*Admin) LoadSecret

func (*Admin) LoadSecret() error

LoadSecret is implements for Adminer function

type AdminAuth

type AdminAuth struct{}

AdminAuth is struct type

func (AdminAuth) Authenticate

func (AdminAuth) Authenticate(user, password string) *UserInfo

Authenticate is interface impl for AdminAuth

type Adminer

type Adminer interface {
	LoadSecret() error
	IsAdmin() (bool, error)
}

Adminer is admin.go interface

func NewAdmin

func NewAdmin(name string, passwd string) Adminer

NewAdmin is Admin struct init function

type KubeSecretAuth

type KubeSecretAuth struct{}

KubeSecretAuth is struct type

func (KubeSecretAuth) Authenticate

func (KubeSecretAuth) Authenticate(user, password string) *UserInfo

Authenticate is interface impl for KubeSecretAuth

type LdapAuth

type LdapAuth struct{}

LdapAuth is struct type

func (LdapAuth) Authenticate

func (LdapAuth) Authenticate(user, password string) *UserInfo

Authenticate is interface impl for LdapAuth

type UserInfo

type UserInfo struct {
	Username string   `json:"username"`
	Nickname string   `json:"nickname"`
	Password string   `json:"password,omitempty"`
	Groups   []string `json:"groups,omitempty"`
}

UserInfo is user info struct for restful http

func DoFactoryAuthentication added in v0.0.1

func DoFactoryAuthentication(user, password string) *UserInfo

DoFactoryAuthentication is user login access function

func DoInterfaceAuthentication added in v0.0.1

func DoInterfaceAuthentication(user, password string) *UserInfo

DoInterfaceAuthentication is user login access function Deprecated

func FistCookieGetUserInfo added in v0.0.1

func FistCookieGetUserInfo(req *restful.Request) *UserInfo

FistCookieGetUserInfo is get fist cookie user info

func GetUserInfo

func GetUserInfo(name string, needPwd bool) *UserInfo

GetUserInfo is add method from server_fist

func ListAllUserInfo

func ListAllUserInfo(needPwd bool) []*UserInfo

ListAllUserInfo is list method from server_fist

func NewAdminUserInfo

func NewAdminUserInfo(username, password string) *UserInfo

NewAdminUserInfo is construction method for admin

func NewDefaultUserInfo

func NewDefaultUserInfo(username, password string, groups []string) *UserInfo

NewDefaultUserInfo is construction method

func NewLdapUserInfo

func NewLdapUserInfo(username, nickname, password string) *UserInfo

NewLdapUserInfo is construction method for ldap

func NewUserInfo

func NewUserInfo(username, nickname, password string, groups []string) *UserInfo

NewUserInfo is construction method

Jump to

Keyboard shortcuts

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