authflow

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package authflow handles the OAuth2.0 flow against Cognito.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doer

type Doer interface {
	Do(req *http.Request) (*http.Response, error)
}

type Opts

type Opts struct {
	// Response is the channel where the auth response will be
	// sent upon successful authentication.
	Response chan Response

	// DashboardURL is the web dashboard URL
	DashboardURL string
}

type Response

type Response struct {
	// Err is set if there was an error which
	// prevented the flow from completing
	Err          error
	Token        *oauth2.Token
	DashboardURL string
}

Response contains authenticated user information after the OAuth2.0 login flow is complete.

type Server

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

func FromDashboardURL

func FromDashboardURL(ctx context.Context, opts Opts) (*Server, error)

FromDashboardURL builds a local server for an OAuth2.0 login flow looking up the CLI Client ID from the deployment public exports endpoint.

func NewServer

func NewServer(userInfo chan Response) *Server

func (*Server) Handler

func (s *Server) Handler() http.Handler

Jump to

Keyboard shortcuts

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