sec

package
v0.0.0-...-5c67b0e Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSecurityProvider

func LoadSecurityProvider(args ...interface{}) (ifs.ISecurityProvider, error)

LoadSecurityProvider loads the security provider plugin from /var/loader.so. This function uses Go's plugin system to dynamically load the security implementation.

func SeekResource

func SeekResource(path string, filename string) string

Types

type ShallowSecurityProvider

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

ShallowSecurityProvider implements ISecurityProvider with basic AES encryption. Uses a hardcoded secret for key derivation - suitable for testing only.

func NewShallowSecurityProvider

func NewShallowSecurityProvider() *ShallowSecurityProvider

NewShallowSecurityProvider creates a new provider with a hardcoded secret.

func (*ShallowSecurityProvider) Authenticate

func (this *ShallowSecurityProvider) Authenticate(user string, pass string) (string, bool, bool, error)

Authenticate always succeeds with a dummy bearer token (testing only).

func (*ShallowSecurityProvider) CanAccept

func (this *ShallowSecurityProvider) CanAccept(conn net.Conn) error

CanAccept always allows incoming connections (permissive).

func (*ShallowSecurityProvider) CanDial

func (this *ShallowSecurityProvider) CanDial(host string, port uint32) (net.Conn, error)

CanDial establishes a TCP connection to the specified host and port.

func (*ShallowSecurityProvider) CanDoAction

func (this *ShallowSecurityProvider) CanDoAction(action ifs.Action, o ifs.IElements, uuid string, token string, salts ...string) error

CanDoAction always permits any action (permissive authorization).

func (*ShallowSecurityProvider) Captcha

func (this *ShallowSecurityProvider) Captcha() []byte

func (*ShallowSecurityProvider) Credential

func (this *ShallowSecurityProvider) Credential(crId, cId string, r ifs.IResources) (string, string, string, string, error)

func (*ShallowSecurityProvider) Decrypt

func (this *ShallowSecurityProvider) Decrypt(data string) ([]byte, error)

Decrypt decrypts AES-encrypted data using the derived key.

func (*ShallowSecurityProvider) Encrypt

func (this *ShallowSecurityProvider) Encrypt(data []byte) (string, error)

Encrypt encrypts data using AES with the derived key.

func (*ShallowSecurityProvider) Message

func (this *ShallowSecurityProvider) Message(string) (*ifs.Message, error)

func (*ShallowSecurityProvider) Register

func (this *ShallowSecurityProvider) Register(userId, password, captcha string, vnic ifs.IVNic) error

func (*ShallowSecurityProvider) ScopeView

func (this *ShallowSecurityProvider) ScopeView(o ifs.IElements, uuid string, token string, salts ...string) ifs.IElements

ScopeView returns the original elements without filtering (permissive).

func (*ShallowSecurityProvider) TFASetup

func (this *ShallowSecurityProvider) TFASetup(userid string, nic ifs.IVNic) (string, []byte, error)

func (*ShallowSecurityProvider) TFAVerify

func (this *ShallowSecurityProvider) TFAVerify(userid string, code string, bearer string, nic ifs.IVNic) error

func (*ShallowSecurityProvider) ValidateConnection

func (this *ShallowSecurityProvider) ValidateConnection(conn net.Conn, config *l8sysconfig.L8SysConfig) error

ValidateConnection verifies the connection by exchanging encrypted secrets.

func (*ShallowSecurityProvider) ValidateToken

func (this *ShallowSecurityProvider) ValidateToken(token string) (string, bool)

ValidateToken always validates tokens successfully (permissive).

Jump to

Keyboard shortcuts

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