oauth2

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package oauth2 implements OAuth2 Device Flow to authenticate machine config download.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	Audience     string
	Scopes       []string

	ExtraVariables []string

	DeviceAuthURL string
	TokenURL      string
	// contains filtered or unexported fields
}

Config represents the OAuth2 configuration.

func NewConfig

func NewConfig(cmdline *procfs.Cmdline, downloadURL string) (*Config, error)

NewConfig returns a new Config from cmdline.

If OAuth2 is not configured, it returns os.ErrNotExist.

func (*Config) DeviceAuthFlow

func (c *Config) DeviceAuthFlow(ctx context.Context, st state.State) error

DeviceAuthFlow represents the device auth flow response.

func (*Config) ExtraHeaders

func (c *Config) ExtraHeaders() map[string]string

ExtraHeaders returns the extra headers to include in the download request.

Jump to

Keyboard shortcuts

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