remote

package
v0.0.0-...-05145c8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package remote defines a remote audit log processor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Processor) error

Option is the option to set up a remote audit log processor.

func WithDefaultAuth

func WithDefaultAuth() Option

WithDefaultAuth sets up the processor to connect to remote with the default auth setting.

func WithGRPCDialOptions

func WithGRPCDialOptions(opts ...grpc.DialOption) Option

WithGRPCDialOptions allows provide raw grpc.DialOption for the underlying connection.

func WithIDTokenAuth

func WithIDTokenAuth(ctx context.Context) Option

WithIDTokenAuth sets up the processor to do auth with ID token. TODO(b/201541513): It's not clear how to unit test this functionality. We can at least cover it in the integration test.

func WithImpersonatedIDTokenAuth

func WithImpersonatedIDTokenAuth(ctx context.Context, targetPrincipal string) Option

WithImpersonatedIDTokenAuth sets up the processor to do auth with impersonated service account ID token.

type Processor

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

Processor is the remote audit log processor.

func NewProcessor

func NewProcessor(address string, opts ...Option) (*Processor, error)

NewProcessor creates a new remote audit log processor.

E.g.

p, err := NewProcessor("localhost:8080", WithDefaultAuth())
if err != nil { ... }
defer p.Close()

func (*Processor) Process

func (p *Processor) Process(ctx context.Context, logReq *api.AuditLogRequest) error

Process processes the audit log request by calling a remote service.

func (*Processor) Stop

func (p *Processor) Stop() error

Stop stops the processor.

Jump to

Keyboard shortcuts

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