auth

package
v2.0.0-rc Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoToken   = errors.New("no token")
	ErrNoCookies = errors.New("no cookies")
)

Functions

This section is empty.

Types

type BrowserAuth

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

func NewBrowserAuth

func NewBrowserAuth() (BrowserAuth, error)

func (BrowserAuth) Cookies

func (c BrowserAuth) Cookies() []http.Cookie

func (BrowserAuth) SlackToken

func (c BrowserAuth) SlackToken() string

func (BrowserAuth) Validate

func (c BrowserAuth) Validate() error

type CookieFileAuth

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

func NewCookieFileAuth

func NewCookieFileAuth(token string, cookieFile string) (CookieFileAuth, error)

NewCookieFileAuth creates new auth provider from token and Mozilla cookie file.

func (CookieFileAuth) Cookies

func (c CookieFileAuth) Cookies() []http.Cookie

func (CookieFileAuth) SlackToken

func (c CookieFileAuth) SlackToken() string

func (CookieFileAuth) Validate

func (c CookieFileAuth) Validate() error

type Provider

type Provider interface {
	SlackToken() string
	Cookies() []http.Cookie
	Validate() error
}

type ValueAuth

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

ValueAuth stores Slack credentials.

func NewValueAuth

func NewValueAuth(token string, cookie string) (ValueAuth, error)

func (ValueAuth) Cookies

func (c ValueAuth) Cookies() []http.Cookie

func (ValueAuth) SlackToken

func (c ValueAuth) SlackToken() string

func (ValueAuth) Validate

func (c ValueAuth) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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