utils

package module
v0.0.0-...-c55d645 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

README

OpenUEM - Utils

Repository containing shared functionality for the OpenUEM project

This repository is used as a git submodule from other OpenUEM's repositories

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNetBirdOneOffSetupKeyAPI

func CreateNetBirdOneOffSetupKeyAPI(managementURL string, agentID string, groups string, allowExtraDNSLabels bool, token string) (string, string, error)

func CreatePostgresDatabaseURL

func CreatePostgresDatabaseURL() (string, error)

func DeleteNetBirdOneOffSetupKeyAPI

func DeleteNetBirdOneOffSetupKeyAPI(managementURL string, key string, token string) error

func DeleteNetBirdPeer

func DeleteNetBirdPeer(peerID string, managementURL string, token string) error

func DownloadFile

func DownloadFile(url, filepath string, expectedHash string) error

func GenerateSerialNumber

func GenerateSerialNumber() (*big.Int, error)

func GetAgentConfigFile

func GetAgentConfigFile() string

func GetConfigFile

func GetConfigFile() string

func GetJWTKey

func GetJWTKey() (string, error)

func GetMyNetBirdPeerID

func GetMyNetBirdPeerID(ip string, managementURL string, token string) (string, error)

func GetSHA256Sum

func GetSHA256Sum(filepath string) ([]byte, error)

func GetWd

func GetWd() (string, error)

func NetBirdPeerExists

func NetBirdPeerExists(name string, managementURL string, token string) (bool, error)

func NewAuthLogger

func NewAuthLogger() *log.Logger

func QueryReleasesEndpoint

func QueryReleasesEndpoint(url string) ([]byte, error)

func ReadPEMCertificate

func ReadPEMCertificate(path string) (*x509.Certificate, error)

func ReadPEMPrivateKey

func ReadPEMPrivateKey(path string) (*rsa.PrivateKey, error)

func SaveCertificate

func SaveCertificate(certBytes []byte, path string) error

func SavePFX

func SavePFX(b []byte, path string) error

func SavePrivateKey

func SavePrivateKey(certPrivKey *rsa.PrivateKey, path string) error

func UTF16BytesToString

func UTF16BytesToString(b []byte, o binary.ByteOrder) string

Types

type NetBirdCreateSetupKeyResponse

type NetBirdCreateSetupKeyResponse struct {
	ID                  string   `json:"id"`
	Name                string   `json:"name"`
	Expires             string   `json:"expires"`
	Type                string   `json:"type"`
	Valid               bool     `json:"valid"`
	Revoked             bool     `json:"revoked"`
	UsedTimes           int      `json:"used_times"`
	LastUsed            string   `json:"last_used"`
	State               string   `json:"state"`
	AutoGroups          []string `json:"auto_groups"`
	UpdateAt            string   `json:"updated_at"`
	UsageLimit          int      `json:"usage_limit"`
	Ephemeral           bool     `json:"ephemeral"`
	AllowExtraDNSLabels bool     `json:"allow_extra_dns_labels"`
	Key                 string   `json:"key"`
}

type NetBirdPeer

type NetBirdPeer struct {
	ID string `json:"id"`
}

type OpenUEMLogger

type OpenUEMLogger struct {
	LogFile *os.File
}

func NewLogger

func NewLogger(logFilename string) *OpenUEMLogger

func (*OpenUEMLogger) Close

func (l *OpenUEMLogger) Close()

Jump to

Keyboard shortcuts

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