auth

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Hostname of the redirect URL.
	RedirectURLHostname string

	// Candidates of hostname and port which the local server binds to.
	// You can set port number to 0 to allocate a free port.
	// If multiple addresses are given, it will try the ports in order.
	// If nil or an empty slice is given, it defaults to "127.0.0.1:0" i.e. a free port.
	LocalServerBindAddress []string

	// Response HTML body on authorization completed.
	// Default to DefaultLocalServerSuccessHTML.
	LocalServerSuccessHTML string

	// A channel to send its URL when the local server is ready. Default to none.
	LocalServerReadyChan chan<- string
}

type Server

type Server struct {
	RedirectURI string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(c *Config) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) ReceiveCodeViaLocalServer

func (s *Server) ReceiveCodeViaLocalServer(ctx context.Context, authCodeURL, state string) (string, error)

Jump to

Keyboard shortcuts

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