database

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAuthenticator

func AddAuthenticator(
	projectId string,
	name string,
	authenticatorType string,
	ipv4 string,
	fqdn string,
	note string,
	authenticatorId string,
) error

func AddCredential

func AddCredential(
	authenticatorId string,
	userName string,
	value string,
	authenticatorType string,
	authenticatorFormat string,
	authenticatorEncoding string,
	note string,
	cleartextId string,
) error

func AddFlag

func AddFlag(
	authenticatorId string,
	name string,
	value string,
	note string,
) error

func AddNote

func AddNote(
	projectId string,
	name string,
	value string,
) error

func AddNoteFromFilepath

func AddNoteFromFilepath(projectId string, filepath string) error

func AddProject

func AddProject(name string, note string) error

func AddUser

func AddUser(
	email string,
	username string,
	password string,
	ssh_public_key string,

) error

func CredentialFormEvilWinRM

func CredentialFormEvilWinRM(authenticator Authenticator, credential Credential) []string

func CredentialFormImpacket

func CredentialFormImpacket(authenticator Authenticator, credential Credential) []string

func CredentialFormNetExec

func CredentialFormNetExec(authenticator Authenticator, credential Credential) []string

func DoesUserValueExist

func DoesUserValueExist(column string, value string) error

func GetAuthenticatorCopyList

func GetAuthenticatorCopyList(id string) ([]string, error)

func GetCredentialById

func GetCredentialById(id string) (Authenticator, Credential, error)

func GetCredentialCopyList

func GetCredentialCopyList(id string) ([]string, error)

func GetDatabaseInstance

func GetDatabaseInstance() (dbx.Builder, error)

func GetNotesAsMarkdown

func GetNotesAsMarkdown(projectId string) (string, error)

func GetProjectTitle

func GetProjectTitle(id string) (string, error)

func IsUserVerified

func IsUserVerified(username string) (bool, error)

func RemoveAuthenticator

func RemoveAuthenticator(id string) error

func RemoveCredential

func RemoveCredential(id string) error

func RemoveFlag

func RemoveFlag(id string) error

func RemoveNote

func RemoveNote(id string) error

func RemoveProject

func RemoveProject(id string) error

func RemoveUser

func RemoveUser(id string) error

func SetDatabaseInstance

func SetDatabaseInstance(db *dbx.Builder) error

func UpdateAuthenticator

func UpdateAuthenticator(
	projectId string,
	updateAuthenticatorId string,
	name string,
	authenticatorType string,
	ipv4 string,
	fqdn string,
	note string,
	authenticatorId string,
) error

func UpdateCredential

func UpdateCredential(
	credentialId string,
	authenticatorId string,
	userName string,
	value string,
	authenticatorType string,
	authenticatorFormat string,
	authenticatorEncoding string,
	note string,
	cleartextId string,
) error

func UpdateFlag

func UpdateFlag(
	flagId string,
	authenticatorId string,
	name string,
	value string,
	note string,
) error

func UpdateNote

func UpdateNote(
	noteId string,
	projectId string,
	name string,
	value string,
) error

func UpdateProject

func UpdateProject(
	projectId string,
	name string,
	note string,
) error

func VerifyUser added in v0.3.0

func VerifyUser(id string) error

Types

type Authenticator

type Authenticator struct {
	Id              string         `db:"id" json:"id"`
	Name            string         `db:"name" json:"name"`
	Type            string         `db:"type" json:"type"`
	IPv4            string         `db:"ipv4" json:"ipv4"`
	FQDN            string         `db:"fqdn" json:"fqdn"`
	Note            string         `db:"note" json:"note"`
	ProjectId       string         `db:"link_project" json:"link_project"`
	AuthenticatorId string         `db:"link_authenticator" json:"link_authenticator"`
	Created         types.DateTime `db:"created" json:"created"`
	Updated         types.DateTime `db:"updated" json:"updated"`
}

func GetAuthenticatorById

func GetAuthenticatorById(id string) (Authenticator, error)

func GetAuthenticatorList

func GetAuthenticatorList(projectId string) ([]Authenticator, error)

func GetLinkedAuthenticatorRootByAuthenticatorId

func GetLinkedAuthenticatorRootByAuthenticatorId(authenticator_id string) (Authenticator, error)

func (Authenticator) DomainName

func (authenticator Authenticator) DomainName() string

func (Authenticator) ListTitle

func (authenticator Authenticator) ListTitle() string

type Credential

type Credential struct {
	Id              string         `db:"id" json:"id"`
	UserName        string         `db:"username" json:"username"`
	Value           string         `db:"value" json:"value"`
	Type            string         `db:"type" json:"type"`
	Format          string         `db:"format" json:"format"`
	Encoding        string         `db:"encoding" json:"encoding"`
	Note            string         `db:"note" json:"note"`
	AuthenticatorId string         `db:"link_authenticator" json:"link_authenticator"`
	CleartextId     string         `db:"cleartext_id" json:"cleartext_id"`
	Created         types.DateTime `db:"created" json:"created"`
	Updated         types.DateTime `db:"updated" json:"updated"`
}

func GetAuthenticatorCredentialList

func GetAuthenticatorCredentialList(authenticatorId string, onlyCleartext bool) ([]Credential, error)

func GetProjectCredentialList

func GetProjectCredentialList(projectId string, onlyCleartext bool) ([]Credential, error)

func (Credential) Description

func (credential Credential) Description() string

func (Credential) ListTitle

func (credential Credential) ListTitle() string

type Flag

type Flag struct {
	Id              string         `db:"id" json:"id"`
	Name            string         `db:"name" json:"name"`
	Value           string         `db:"value" json:"value"`
	Note            string         `db:"note" json:"note"`
	AuthenticatorId string         `db:"link_authenticator" json:"link_authenticator"`
	Created         types.DateTime `db:"created" json:"created"`
	Updated         types.DateTime `db:"updated" json:"updated"`
}

func GetAuthenticatorFlagList

func GetAuthenticatorFlagList(authenticatorId string) ([]Flag, error)

func GetFlagById

func GetFlagById(id string) (Flag, error)

func GetProjectFlagList

func GetProjectFlagList(projectId string) ([]Flag, error)

func (Flag) ListDescription

func (flag Flag) ListDescription() string

func (Flag) ListTitle

func (flag Flag) ListTitle() string

type Note

type Note struct {
	Id        string         `db:"id" json:"id"`
	Name      string         `db:"name" json:"name"`
	Value     string         `db:"value" json:"value"`
	ProjectId string         `db:"link_project" json:"link_project"`
	Created   types.DateTime `db:"created" json:"created"`
	Updated   types.DateTime `db:"updated" json:"updated"`
}

func GetNoteById

func GetNoteById(id string) (Note, error)

func GetProjectNoteList

func GetProjectNoteList(projectId string) ([]Note, error)

func (Note) ListDescription

func (note Note) ListDescription() string

func (Note) ListTitle

func (note Note) ListTitle() string

type Project

type Project struct {
	Id      string         `db:"id" json:"id"`
	Name    string         `db:"name" json:"name"`
	Note    string         `db:"note" json:"note"`
	Created types.DateTime `db:"created" json:"created"`
	Updated types.DateTime `db:"updated" json:"updated"`
}

func GetProjectById

func GetProjectById(id string) (Project, error)

func GetProjectList

func GetProjectList() ([]Project, error)

func (Project) ListTitle

func (project Project) ListTitle() string

type User

type User struct {
	Id           string         `db:"id" json:"id"`
	EMail        string         `db:"email" json:"email"`
	Name         string         `db:"name" json:"name"`
	Verified     bool           `db:"verified" json:"verified"`
	Password     string         `db:"password" json:"password"`
	SSHPublicKey string         `db:"ssh_public_key" json:"ssh_public_key"`
	Created      types.DateTime `db:"created" json:"created"`
	Updated      types.DateTime `db:"updated" json:"updated"`
	TokenKey     string         `db:"tokenKey" json:"tokenKey"`
}

func GetNewUsers added in v0.3.0

func GetNewUsers() ([]User, error)

func GetUserById

func GetUserById(id string) (User, error)

func GetUsers

func GetUsers() ([]User, error)

func GetUsersByName

func GetUsersByName(username string) ([]User, error)

Jump to

Keyboard shortcuts

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