authprovider

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

TODO: This package should be abstracted out to projectdiscovery/utils so it can be shared between httpx, nuclei, and other tools.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSecrets = fmt.Errorf("no secrets in given provider")
)

Functions

This section is empty.

Types

type AuthProvider

type AuthProvider interface {
	// LookupAddr looks up a given domain/address and returns appropriate auth strategy
	// for it (accepted inputs are scanme.sh or scanme.sh:443)
	LookupAddr(string) []authx.AuthStrategy
	// LookupURL looks up a given URL and returns appropriate auth strategy
	// it accepts a valid url struct and returns the auth strategy
	LookupURL(*url.URL) []authx.AuthStrategy
	// LookupURLX looks up a given URL and returns appropriate auth strategy
	// it accepts pd url struct (i.e urlutil.URL) and returns the auth strategy
	LookupURLX(*urlutil.URL) []authx.AuthStrategy
}

AuthProvider is an interface for auth providers It implements a data structure suitable for quick lookup and retrieval of auth strategies

func NewAuthProvider

func NewAuthProvider(options *AuthProviderOptions) (AuthProvider, error)

NewAuthProvider creates a new auth provider from the given options

func NewFileAuthProvider

func NewFileAuthProvider(path string) (AuthProvider, error)

NewFileAuthProvider creates a new file based auth provider

func NewMultiAuthProvider

func NewMultiAuthProvider(providers ...AuthProvider) AuthProvider

NewMultiAuthProvider creates a new multi auth provider

type AuthProviderOptions

type AuthProviderOptions struct {
	// File based auth provider options
	SecretsFiles []string
}

AuthProviderOptions contains options for the auth provider

type FileAuthProvider

type FileAuthProvider struct {
	Path string
	// contains filtered or unexported fields
}

FileAuthProvider is an auth provider for file based auth it accepts a secrets file and returns its provider

func (*FileAuthProvider) LookupAddr

func (f *FileAuthProvider) LookupAddr(addr string) []authx.AuthStrategy

LookupAddr looks up a given domain/address and returns appropriate auth strategy

func (*FileAuthProvider) LookupURL

func (f *FileAuthProvider) LookupURL(u *url.URL) []authx.AuthStrategy

LookupURL looks up a given URL and returns appropriate auth strategy

func (*FileAuthProvider) LookupURLX

func (f *FileAuthProvider) LookupURLX(u *urlutil.URL) []authx.AuthStrategy

LookupURLX looks up a given URL and returns appropriate auth strategy

type MultiAuthProvider

type MultiAuthProvider struct {
	Providers []AuthProvider
}

MultiAuthProvider is a convenience wrapper for multiple auth providers it returns the first matching auth strategy for a given domain if there are multiple auth strategies for a given domain, it returns the first one

func (*MultiAuthProvider) LookupAddr

func (m *MultiAuthProvider) LookupAddr(host string) []authx.AuthStrategy

func (*MultiAuthProvider) LookupURL

func (m *MultiAuthProvider) LookupURL(u *url.URL) []authx.AuthStrategy

func (*MultiAuthProvider) LookupURLX

func (m *MultiAuthProvider) LookupURLX(u *urlutil.URL) []authx.AuthStrategy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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