scopedauth

package
v0.0.0-...-f248f4a Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package scopedauth defines a LUCI Server module used to configure how LUCI Analysis authenticates to buildbucket, resultdb and gerrit. It is defined because dev instances of LUCI Analysis may read from production buildbucket/ResultDB and there are special authentication requirements when this occurs.

Index

Constants

This section is empty.

Variables

View Source
var ModuleName = module.RegisterName("go.chromium.org/luci/analysis/internal/scopedauth")

ModuleName can be used to refer to this module when declaring dependencies.

Functions

func GetRPCTransport

func GetRPCTransport(ctx context.Context, project string, opts ...auth.RPCOption) (http.RoundTripper, error)

GetRPCTransport returns returns http.RoundTripper to use for outbound HTTP RPC requests to buildbucket, resultdb and gerrit. Project is name of the LUCI Project which the request should be performed as (if project-scoped authentication is enabled).

func NewModule

func NewModule(opts *ModuleOptions) module.Module

NewModule returns a server module that adds authentication settings to the context.

func NewModuleFromFlags

func NewModuleFromFlags() module.Module

NewModuleFromFlags is a variant of NewModule that initializes options through command line flags.

Calling this function registers flags in flag.CommandLine. They are usually parsed in server.Main(...).

func UseProjectScopedAuthSetting

func UseProjectScopedAuthSetting(ctx context.Context, useProjectScopedAuth bool) context.Context

UseProjectScopedAuthSetting installs the setting to use (or not use) project-scoped authentication into the context.

Types

type ModuleOptions

type ModuleOptions struct {
	DisableProjectScopedAuth bool // disable project-scoped auth for buildbucket, resultdb, gerrit.
}

ModuleOptions contain configuration of the Cloud Spanner server module.

func (*ModuleOptions) Register

func (o *ModuleOptions) Register(f *flag.FlagSet)

Register registers the command line flags.

Jump to

Keyboard shortcuts

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