package ipauth

import "github.com/google/martian/v3/ipauth"

Package ipauth provides a martian.Modifier that sets auth based on IP.

Index

Types

type Modifier

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

Modifier is the IP authentication modifier.

func NewModifier

func NewModifier() *Modifier

NewModifier returns a new IP authentication modifier.

func (*Modifier) ModifyRequest

func (m *Modifier) ModifyRequest(req *http.Request) error

ModifyRequest sets the auth ID in the context from the request iff it has not already been set and runs reqmod.ModifyRequest. If the underlying modifier has indicated via auth error that no valid auth credentials have been found we set ctx.SkipRoundTrip.

func (*Modifier) ModifyResponse

func (m *Modifier) ModifyResponse(res *http.Response) error

ModifyResponse runs resmod.ModifyResponse.

If an error is returned from resmod.ModifyResponse it is returned.

func (*Modifier) SetRequestModifier

func (m *Modifier) SetRequestModifier(reqmod martian.RequestModifier)

SetRequestModifier sets the request modifier.

func (*Modifier) SetResponseModifier

func (m *Modifier) SetResponseModifier(resmod martian.ResponseModifier)

SetResponseModifier sets the response modifier.

Source Files

ipauth.go

Version
v3.3.3 (latest)
Published
Aug 16, 2022
Platform
linux/amd64
Imports
4 packages
Last checked
6 hours ago

Tools for package owners.