armory

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: GPL-3.0 Imports: 37 Imported by: 1

README

client/command/armory

Overview

Implements the 'armory' command group for the Sliver client console. Handlers map Cobra invocations to armory workflows such as install, manage, parsers, and search.

Go Files

  • armory.go – Maintains the armory cache lifecycle, fetching package metadata, verifying signatures, and presenting bundle listings.
  • armory_test.go (tests) – Placeholder for armory command tests; currently used to keep the package's test harness wired up.
  • commands.go – Declares the Cobra command hierarchy for armory actions and binds shared flag/completion plumbing.
  • install.go – Resolves dependencies and installs aliases or extensions from cached metadata, prompting when overwriting existing packages.
  • manage.go – Implements management helpers for viewing, adding, verifying, and persisting armory configurations.
  • parsers.go – Provides parsers and HTTP helpers for retrieving armory indexes and packages, including Minisign verification.
  • search.go – Implements the regex-driven search command that filters cached armory packages.
  • update.go – Calculates available package updates, presents options to the user, and orchestrates update installation.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPackageAlreadyInstalled = errors.New("package is already installed")
View Source
var ErrPackageNotFound = errors.New("package not found")

ErrPackageNotFound - The package was not found

Functions

func AddArmoryCmd added in v1.6.0

func AddArmoryCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

func AliasExtensionOrBundleCompleter

func AliasExtensionOrBundleCompleter() carapace.Action

AliasExtensionOrBundleCompleter - Completer for alias, extension, and bundle names

func ArmoryCmd

func ArmoryCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

ArmoryCmd - The main armory command

func ArmoryInfoCommand added in v1.6.0

func ArmoryInfoCommand(cmd *cobra.Command, con *console.SliverClient, args []string)

func ArmoryInstallCmd

func ArmoryInstallCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

ArmoryInstallCmd - The armory install command

func ArmorySearchCmd

func ArmorySearchCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

ArmorySearchCmd - Search for packages by name

func ArmoryUpdateCmd

func ArmoryUpdateCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

ArmoryUpdateCmd - Update all installed extensions/aliases

func ChangeArmoryEnabledState added in v1.6.0

func ChangeArmoryEnabledState(cmd *cobra.Command, con *console.SliverClient, args []string, enabled bool)

func Commands added in v1.6.0

func Commands(con *console.SliverClient) []*cobra.Command

Commands returns the `armory` command and its subcommands.

func DefaultArmoryPkgParser

func DefaultArmoryPkgParser(armoryConfig *assets.ArmoryConfig, armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error)

DefaultArmoryPkgParser - Parse the armory package manifest directly from the url

func GithubAPIArmoryPackageParser

func GithubAPIArmoryPackageParser(armoryConfig *assets.ArmoryConfig, armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error)

GithubAPIArmoryPackageParser - Retrieve the minisig and tar.gz for an armory package from a GitHub release

func GithubArmoryPackageParser

func GithubArmoryPackageParser(_ *assets.ArmoryConfig, armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error)

GithubArmoryPackageParser - Uses github.com instead of api.github.com to download packages

func ModifyArmoryCmd added in v1.6.0

func ModifyArmoryCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

func PrintArmoryBundles

func PrintArmoryBundles(bundles []*ArmoryBundle, con *console.SliverClient)

PrintArmoryBundles - Prints the armory bundles

func PrintArmoryPackages

func PrintArmoryPackages(aliases []*alias.AliasManifest, exts []*extensions.ExtensionManifest, con *console.SliverClient)

PrintArmoryPackages - Prints the armory packages

func RefreshArmories added in v1.6.0

func RefreshArmories(cmd *cobra.Command, con *console.SliverClient)

func RemoveArmoryCmd added in v1.6.0

func RemoveArmoryCmd(cmd *cobra.Command, con *console.SliverClient, args []string)

func ResetArmoryConfig added in v1.6.0

func ResetArmoryConfig(cmd *cobra.Command, con *console.SliverClient)

func SaveArmories added in v1.6.0

func SaveArmories(con *console.SliverClient)

Types

type ArmoryBundle

type ArmoryBundle struct {
	Name       string   `json:"name"`
	Packages   []string `json:"packages"`
	ArmoryName string   `json:"-"`
}

ArmoryBundle - A list of packages

type ArmoryHTTPConfig

type ArmoryHTTPConfig struct {
	ArmoryConfig         *assets.ArmoryConfig
	IgnoreCache          bool
	ProxyURL             *url.URL
	Timeout              time.Duration
	DisableTLSValidation bool
}

ArmoryHTTPConfig - Configuration for armory HTTP client

type ArmoryIndex

type ArmoryIndex struct {
	ArmoryConfig *assets.ArmoryConfig `json:"-"`
	Aliases      []*ArmoryPackage     `json:"aliases"`
	Extensions   []*ArmoryPackage     `json:"extensions"`
	Bundles      []*ArmoryBundle      `json:"bundles"`
}

ArmoryIndex - Index JSON containing alias/extension/bundle information

func DefaultArmoryIndexParser

func DefaultArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig) (*ArmoryIndex, error)

DefaultArmoryParser - Parse the armory index directly from the url

func GithubAPIArmoryIndexParser

func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig) (*ArmoryIndex, error)

GithubAPIArmoryIndexParser - Parse the armory index from a GitHub release

type ArmoryIndexParser

type ArmoryIndexParser func(*assets.ArmoryConfig, ArmoryHTTPConfig) (*ArmoryIndex, error)

ArmoryIndexParser - Generic interface to fetch armory indexes

type ArmoryPackage

type ArmoryPackage struct {
	Name        string `json:"name"`
	CommandName string `json:"command_name"`
	RepoURL     string `json:"repo_url"`
	PublicKey   string `json:"public_key"`

	IsAlias    bool   `json:"-"`
	ArmoryName string `json:"-"`
	/*
		With support for multiple armories, the command name of a package
		is not unique anymore, so we need something that is unique
		to be able to keep track of packages.

		This ID will be a hash calculated from properties of the package.
	*/
	ID       string `json:"-"`
	ArmoryPK string `json:"-"`
}

ArmoryPackage - JSON metadata for alias or extension

type ArmoryPackageParser

type ArmoryPackageParser func(*assets.ArmoryConfig, *ArmoryPackage, bool, ArmoryHTTPConfig) (*minisign.Signature, []byte, error)

ArmoryPackageParser - Generic interface to fetch armory package manifests

type GithubAsset

type GithubAsset struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	URL  string `json:"url"`
	Size int    `json:"size"`

	BrowserDownloadURL string `json:"browser_download_url"`
}

type GithubRelease

type GithubRelease struct {
	ID          int           `json:"id"`
	Name        string        `json:"name"`
	URL         string        `json:"url"`
	HTMLURL     string        `json:"html_url"`
	TagName     string        `json:"tag_name"`
	Body        string        `json:"body"`
	Prerelease  bool          `json:"prerelease"`
	TarballURL  string        `json:"tarball_url"`
	ZipballURL  string        `json:"zipball_url"`
	CreatedAt   string        `json:"created_at"`
	PublishedAt string        `json:"published_at"`
	Assets      []GithubAsset `json:"assets"`
}

type PackageType added in v1.6.0

type PackageType uint
const (
	AliasPackage PackageType = iota
	ExtensionPackage
)

type UpdateIdentifier added in v1.6.0

type UpdateIdentifier struct {
	Type PackageType
	Name string
}

type VersionInformation added in v1.6.0

type VersionInformation struct {
	OldVersion string
	NewVersion string
	ArmoryName string
}

Jump to

Keyboard shortcuts

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