rbac

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

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 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 FistRegister

func FistRegister(auth *restful.WebService)

FistRegister is fist auth controller

func Serve

func Serve(cmd *cobra.Command)

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 DoAuthentication

func DoAuthentication(user, password string) *UserInfo

DoAuthentication is user login access function

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