protoheader

package
v0.0.0-...-65468f9 Latest Latest
Warning

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

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

Documentation

Overview

Package header supports extracting the email of an authorized user from a protobuf in an HTTP Header.

Index

Constants

View Source
const (
	// HeaderSecretName is the name of the GCP secret for login.
	HeaderSecretName = "authproxy-protoheader-name"

	// LoginURNSecretName is the name of the GCP secret for the login URL.
	LoginURNSecretName = "authproxy-loginurl"

	// Project is the project where the above secrets are stored in.
	Project = "skia-infra-public"
)

Variables

View Source
var File_header_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Header struct {

	// email address of the logged in user.
	Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

Authorized users may be passed to the server via protobuf serialized into a header. We use this proto to extract the email address of the authorized user.

func (*Header) Descriptor deprecated

func (*Header) Descriptor() ([]byte, []int)

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetEmail

func (x *Header) GetEmail() string

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

func (x *Header) ProtoReflect() protoreflect.Message

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

type ProtoHeader

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

ProtoHeader implements auth.Auth.

func New

func New(ctx context.Context, secretClient secret.Client) (ProtoHeader, error)

New creates a ProtoHeader.

func (ProtoHeader) Init

func (p ProtoHeader) Init(ctx context.Context) error

Init implements auth.Auth.

func (ProtoHeader) LoggedInAs

func (p ProtoHeader) LoggedInAs(r *http.Request) (string, error)

LoggedInAs implements auth.Auth.

func (ProtoHeader) LoginURL

func (p ProtoHeader) LoginURL(w http.ResponseWriter, r *http.Request) string

LoginURL implements auth.Auth.

Jump to

Keyboard shortcuts

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