Help us shape the future of Go! Take the 2026 Go Developer Survey

oauth

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package oauth is the scriptling.oauth library: OAuth 2.0 and OpenID Connect for scripts, against any identity provider that publishes discovery metadata. A script signs a person in with device sign-in (RFC 8628, waiting in the CLI or polling from a web page), gets a token for itself with client credentials, keeps tokens fresh with refresh tokens, and verifies the access tokens sent to an API it serves. It uses Go's standard library only.

Index

Constants

View Source
const (
	LibraryName = "scriptling.oauth"
	LibraryDesc = "OAuth 2.0 and OpenID Connect: device sign-in, client credentials, refresh and token verification"
)

Variables

This section is empty.

Functions

func Register

func Register(registrar interface{ RegisterLibrary(*object.Library) }, cfg ...*netsecurity.Config)

Register registers scriptling.oauth, under the network policy cfg when one is given. A CA bundle a script names with verify="path" may be any file: use RegisterConfigured to confine it.

func RegisterConfigured

func RegisterConfigured(registrar interface{ RegisterLibrary(*object.Library) }, paths fssecurity.Config, policy *netsecurity.Config)

RegisterConfigured registers scriptling.oauth with a filesystem allow-path policy and a network policy, as the CLI's --allowed-paths and --network-policy give them: every request to an IdP passes the network policy, and a CA bundle named with verify="path" must lie within the allowed paths. A zero fssecurity.Config and a nil policy register it unrestricted.

Types

This section is empty.

Jump to

Keyboard shortcuts

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