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 ¶
- Variables
- func GetRPCTransport(ctx context.Context, project string, opts ...auth.RPCOption) (http.RoundTripper, error)
- func NewModule(opts *ModuleOptions) module.Module
- func NewModuleFromFlags() module.Module
- func UseProjectScopedAuthSetting(ctx context.Context, useProjectScopedAuth bool) context.Context
- type ModuleOptions
Constants ¶
This section is empty.
Variables ¶
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 ¶
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(...).
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.