humcommon

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 15 Imported by: 0

README

Linux HTTPS User Management

PAM and NSS modules to allow for remote login and remote user management against an HTTPS server using mTLS.

Documentation

Index

Constants

View Source
const GroupID = 100 // users

Variables

View Source
var ConfigError bool

Functions

func GetHTTPClient

func GetHTTPClient() *http.Client

func InitTLS added in v0.1.10

func InitTLS() error

func Log

func Log() *logrus.Logger

Types

type Config

type Config struct {
	TLS struct {
		CA   string
		Key  string
		Cert string
	}
	Debug     bool
	URL       string
	TokenFile string
	UserFile  string
}
var AppConfig *Config

func NewConfig

func NewConfig(configPath string) (*Config, error)

type TokenUser

type TokenUser struct {
	Token string `json:"token"`
	User  User   `json:"user"`
}

func Authenticate

func Authenticate(user, password string) (*TokenUser, error)

func (TokenUser) WriteTokenFile added in v0.1.9

func (t TokenUser) WriteTokenFile() error

type User

type User struct {
	Admin    bool   `json:"is_staff"`
	Email    string `json:"email"`
	ID       uint   `json:"id"`
	UID      uint   `json:"uid"`
	Username string `json:"username"`
}

func (User) GetPasswdLine

func (u User) GetPasswdLine() []byte

func (*User) ReadUserFile added in v0.1.9

func (u *User) ReadUserFile() error

func (User) WriteUserFile added in v0.1.9

func (u User) WriteUserFile() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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