cmds

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package cmds provides the implementation backing token-forge's cli. This section of the cmds package holds implementation agnostic things used in other sections of the cmds package.

Package cmds provides the implementation backing token-forge's cli. This section of the cmds package holds the implementation for the disect command.

Package cmds provides the implementation backing token-forge's cli. This section of the cmds package hold the implementation for the generate command.

Package cmds provides the implementation backing token-forge's cli. This section of the cmds package holds the implementation for the login command.

Package cmds provides the implementation backing token-forge's cli. This section of the cmds package hold the implementation for the generate command.

Package cmds provides the implementation backing token-forge's cli. This section of the cmds package holds the implementation for the login command.

Package cmds provides the implementation backing token-forge's cli. This section of the cmds package holds the implementation for the login command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenGhTokenFunc

func GenGhTokenFunc(prefix string) func() *ghtoken.GhToken

GenGhTokenFunc returns a token generation function based on the provided token prefix; if an empty string is provided, the returned function will generate tokens with a randomly selected prefix; if a non-empty string is provided, then the returned function will generate all tokens w/ the given prefix. This does not check the validity of the provided token prefix.

Types

type DisectCmd

type DisectCmd struct {
	Globals
	TokenSourceArgs
	TokenParams
}

DisectCmd represents the disect tokens cli command.

func (*DisectCmd) Run

func (d *DisectCmd) Run() error

Run the disect tokens command to inspect GitHub tokens.

type GenCmd

type GenCmd struct {
	Globals
	TokenParams
}

GenCmd represents the generate tokens cli command.

func (*GenCmd) Run

func (d *GenCmd) Run() error

Run the generate tokens command to generate GitHub-like tokens.

type GhUserInfo

type GhUserInfo struct {
	Token *ghtoken.GhToken `json:"token"`
	Info  *github.User     `json:"info"`
}

GhUserInfo holds GitHub user information along with the token used to get the information.

type Globals

type Globals struct {
	Debug bool `help:"Enable debug mode"`
}

Globals represents globally shared flags for cli commands.

type IPCmd

type IPCmd struct {
	Globals
	ProxyConfig
}

IPCmd represents the ip check cli command.

func (*IPCmd) Run

func (p *IPCmd) Run() error

Run the ip check based on the parameters of the IpCmd.

type LocalCmd

type LocalCmd struct {
	Globals
	TokenParams
	NumTests uint64 `short:"t" default:"1" help:"Number of tokens to load into the test token database."`
}

LocalCmd represents the local collision test cli command.

func (*LocalCmd) Run

func (d *LocalCmd) Run() error

Run the generate tokens command to generate GitHub-like tokens.

type LoginCmd

type LoginCmd struct {
	Globals
	TokenSourceArgs
	TokenParams
	ProxyConfig
	ForceCheck bool   `short:"c" help:"Force a check of the logged in user so the rate limit is decremented."`
	Host       string `help:"The GitHub Enterprise hostname to interact with; if not specified, github.com is assumed."`
}

LoginCmd represents the login w/ token(s) cli command.

func (*LoginCmd) Run

func (l *LoginCmd) Run() error

Run the login test based on the parameters of the LoginCmd.

type ProxyConfig

type ProxyConfig struct {
	Proxy string `help:"Proxy to use for outbound connections." group:"Proxy Config"`
}

ProxyConfig represents parameters for setting a proxy.

type TokenParams

type TokenParams struct {
	BatchSize int    `short:"b" default:"1000" help:"When testing for collisions, the number of tokens to test concurrently." group:"Token Params"`
	NumTokens uint64 `short:"n" default:"1" help:"Number of tokens to test." group:"Token Params"` // max = 18446744073709551615`
	Prefix    string ``                                                                            /* 178-byte string literal not displayed */
}

TokenParams represents parameters for token generation.

type TokenSourceArgs

type TokenSourceArgs struct {
	Token     string `short:"t" help:"Token to use." required:"" xor:"source" group:"Source"`
	File      string `short:"f" help:"Path to file with tokens." type:"existingfile" required:"" xor:"source" group:"Source"`
	Generated bool   `short:"g" help:"Use one or more generated tokens." required:"" xor:"source" group:"Source"`
	NoAuth    bool   `` /* 126-byte string literal not displayed */
}

TokenSourceArgs represents a source of tokens.

Jump to

Keyboard shortcuts

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