providers

package
v0.0.0-...-895b022 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: BSD-3-Clause, BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package providers provides functions to configure and use the providers supported out of the box by the enkit oauth library: google and github.

Use the functions in this file to easily bring up a working authentication server or client almost entirely controlled by flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGroupsKeeperFactory

func NewGroupsKeeperFactory(keep, rename string) (oauth.VerifierFactory, error)

func WithFlags

func WithFlags(fl *Flags) oauth.Modifier

Types

type Flags

type Flags struct {
	*oauth.Flags
	Google *ogoogle.Flags

	// The name of the provider to use: google or github.
	Provider string

	// Only groups matching this regex are kept.
	GroupsKeep string
	// Name of the group will be mangled based on this substitution.
	GroupsRename string
}

Flags allows to configure oauth for one of the specific providers supported by the library out of the box.

To pass Flags to one of the constructurs, use `WithFlags`.

func DefaultFlags

func DefaultFlags() *Flags

func (*Flags) Register

func (f *Flags) Register(set kflags.FlagSet, prefix string) *Flags

type GroupsKeeper

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

func (*GroupsKeeper) Scopes

func (gk *GroupsKeeper) Scopes() []string

func (*GroupsKeeper) Verify

func (gk *GroupsKeeper) Verify(log logger.Logger, identity *oauth.Identity, tok *oauth2.Token) (*oauth.Identity, error)

Jump to

Keyboard shortcuts

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