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 ¶
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) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type ProtoHeader ¶
type ProtoHeader struct {
// contains filtered or unexported fields
}
ProtoHeader implements auth.Auth.
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.
Click to show internal directories.
Click to hide internal directories.