security

package
v0.0.0-...-b8e807e Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialManager

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

CredentialManager handles encryption and storage of tenant credentials

func NewCredentialManager

func NewCredentialManager(db *sqlx.DB, masterKey []byte) *CredentialManager

NewCredentialManager creates a new credential manager masterKey must be exactly 32 bytes for AES-256

func (*CredentialManager) DeleteCredentials

func (cm *CredentialManager) DeleteCredentials(ctx context.Context, tenantID uuid.UUID, sourceID string) error

DeleteCredentials removes all credentials for a source

func (*CredentialManager) GetAllCredentials

func (cm *CredentialManager) GetAllCredentials(ctx context.Context, tenantID uuid.UUID, sourceID string) (map[string]string, error)

GetAllCredentials retrieves and decrypts all credentials for a source

func (*CredentialManager) GetCredential

func (cm *CredentialManager) GetCredential(ctx context.Context, tenantID uuid.UUID, sourceID string, credType string) (string, error)

GetCredential retrieves and decrypts a specific credential

func (*CredentialManager) StoreCredential

func (cm *CredentialManager) StoreCredential(ctx context.Context, tenantID uuid.UUID, sourceID string, credType string, value string) error

StoreCredential encrypts and stores a credential for a tenant/source

Jump to

Keyboard shortcuts

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