browsersession

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 7 Imported by: 0 modules, 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

Package browsersession signs in with a session a browser already holds.

It exists for the sites a token cannot be got from any other way: single sign-on, two-factor, a captcha — anything where the login happens in a browser and there is no password this tool could send. The browser has already done the hard part; this turns what it holds into an ordinary web service token, once, and then no longer needs it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Method

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

Method exchanges a browser session for a token.

func New

func New(newClient func(site.Site) *moodle.Client, readHidden func() (string, error)) *Method

New builds the method. New builds the method. readHidden reads a line from the terminal without echoing it; nil leaves the method unable to prompt, which is what a caller with no terminal wants.

func (*Method) Authenticate

func (m *Method) Authenticate(ctx context.Context, req auth.Request) (auth.Credential, error)

func (*Method) Describe

func (*Method) Describe() string

func (*Method) Name

func (*Method) Name() string

func (*Method) Probe

Probe reports whether the exchange could work.

It is never chosen automatically: the caller has to hand over a session cookie, and a credential that powerful is not something to go looking for on someone's behalf.

Jump to

Keyboard shortcuts

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