avdu

package module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

README

avdu

Aegis Vault Desktop Utility is a Go module and basic command line interface for generating one-time passwords from an Aegis Authenticator vault backup or export file.

The desktop app version can be found at https://github.com/Sammy-T/avda.

[!NOTE] HOTP is not implemented due to syncing concerns.

CLI

avdu -h

Import the module

Import into go file(s)

import "github.com/sammy-t/avdu"

Update modules

go mod tidy

Development

Run the CLI
# Run in the current directory.
go run ./cmd/avdu

# Run using the plaintext test file.
go run ./cmd/avdu -p test/data/aegis_plain.json

# Run using the encrypted test file. (Enter password "test" when prompted.)
go run ./cmd/avdu -p test/data/aegis_encrypted.json -e
Build the CLI
go build -C ./cmd/avdu

The binary will output to the cmd/avdu/ directory.

Install the CLI
go install ./cmd/avdu

Documentation

Overview

Package avdu provides functionality for reading Aegis Authenticator vault files and outputting One-Time Passwords.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindVaultPath

func FindVaultPath(vaultDir string) (string, error)

FindVaultPath returns the most recently modified vault's filepath.

func GetOTP

func GetOTP(entry vault.Entry) (otp.OTP, error)

GetOTP generates an OTP from the provided entry data.

func GetOTPs

func GetOTPs(vaultData *vault.Vault) (map[string]otp.OTP, error)

GetOTPs generates OTPs for the entries in the vault and returns a map matching each entry's uuid and OTP.

If there's an error, the successfully generated OTPs will be returned along with the error.

func GetTTN

func GetTTN() int64

GetTTN calculates the time in millis until the next OTP refresh using the default period.

func GetTTNPer

func GetTTNPer(period int64) int64

GetTTNPer calculates the time in millis until the next OTP refresh using the provided period.

func LastModified

func LastModified(files []fs.DirEntry) (fs.DirEntry, error)

LastModified finds the most recent vault file.

func ReadAndDecryptVaultFile

func ReadAndDecryptVaultFile(filePath string, pwd string) (*vault.Vault, error)

ReadAndDecryptVaultFile parses the json file at the path, decrypts the vault content, and returns a plaintext vault.

func ReadVaultFile

func ReadVaultFile(filePath string) (*vault.Vault, error)

ReadVaultFile parses the json file at the path and returns a plaintext vault.

func ReadVaultFileEnc

func ReadVaultFileEnc(filePath string) (*vault.VaultEncrypted, error)

ReadVaultFileEnc parses the json file at the path and returns an encrypted vault.

Types

This section is empty.

Directories

Path Synopsis
cmd
Package otp provides functionality for generating and reading One-Time Passwords.
Package otp provides functionality for generating and reading One-Time Passwords.
Package vault provides functionality for interacting with Aegis Authenticator vault data.
Package vault provides functionality for interacting with Aegis Authenticator vault data.

Jump to

Keyboard shortcuts

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