proto

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_login_proto_captive_proto protoreflect.FileDescriptor
View Source
var File_login_proto_login_proto protoreflect.FileDescriptor
View Source
var File_login_proto_session_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Auth

type Auth struct {

	// Opaque user identifier.
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// Display user name.
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// Sticky session ID, used for keystore Open/Close. This is
	// actually the device ID, which we pass between login and logout
	// here (to decouple the decision that this is the device ID).
	SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// Session deadline, used by the server logic to limit the validity
	// of signed tokens. Yes, the securecookie package already has its
	// own deadline, but it's part of the framing layer and we don't
	// have access to it.
	Deadline int64 `protobuf:"varint,4,opt,name=deadline,proto3" json:"deadline,omitempty"`
	// Captive workflow status.
	Captive *CaptiveStatus `protobuf:"bytes,5,opt,name=captive,proto3" json:"captive,omitempty"`
	// contains filtered or unexported fields
}

Long-term authenticated session. Holds the authenticated user data, attesting that the user is logged in. Stored in the long-term session authentication cookie.

func (*Auth) Descriptor deprecated

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

Deprecated: Use Auth.ProtoReflect.Descriptor instead.

func (*Auth) GetCaptive

func (x *Auth) GetCaptive() *CaptiveStatus

func (*Auth) GetDeadline

func (x *Auth) GetDeadline() int64

func (*Auth) GetSessionId

func (x *Auth) GetSessionId() string

func (*Auth) GetUserId

func (x *Auth) GetUserId() string

func (*Auth) GetUsername

func (x *Auth) GetUsername() string

func (*Auth) IsCaptured

func (a *Auth) IsCaptured() bool

func (*Auth) MakeAuthLog

func (a *Auth) MakeAuthLog() *authpb.Log

func (*Auth) ProtoMessage

func (*Auth) ProtoMessage()

func (*Auth) ProtoReflect

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

func (*Auth) Reset

func (x *Auth) Reset()

func (*Auth) String

func (x *Auth) String() string

func (*Auth) Valid

func (a *Auth) Valid() bool

type CaptiveStatus

type CaptiveStatus struct {
	Workflows []string `protobuf:"bytes,1,rep,name=workflows,proto3" json:"workflows,omitempty"`
	Exit      string   `protobuf:"bytes,2,opt,name=exit,proto3" json:"exit,omitempty"`
	// contains filtered or unexported fields
}

func (*CaptiveStatus) Current

func (s *CaptiveStatus) Current() string

func (*CaptiveStatus) Descriptor deprecated

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

Deprecated: Use CaptiveStatus.ProtoReflect.Descriptor instead.

func (*CaptiveStatus) Done

func (s *CaptiveStatus) Done() *CaptiveStatus

func (*CaptiveStatus) Empty

func (s *CaptiveStatus) Empty() bool

func (*CaptiveStatus) GetExit

func (x *CaptiveStatus) GetExit() string

func (*CaptiveStatus) GetWorkflows

func (x *CaptiveStatus) GetWorkflows() []string

func (*CaptiveStatus) ProtoMessage

func (*CaptiveStatus) ProtoMessage()

func (*CaptiveStatus) ProtoReflect

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

func (*CaptiveStatus) Reset

func (x *CaptiveStatus) Reset()

func (*CaptiveStatus) String

func (x *CaptiveStatus) String() string

type LoginState

type LoginState struct {
	RequestParams *RequestParams `protobuf:"bytes,1,opt,name=request_params,json=requestParams,proto3" json:"request_params,omitempty"`
	SessionParams *SessionParams `protobuf:"bytes,2,opt,name=session_params,json=sessionParams,proto3" json:"session_params,omitempty"`
	// contains filtered or unexported fields
}

func LoginStateFromRequest

func LoginStateFromRequest(req *http.Request, store *sessionstore.Store) (*LoginState, error)

Read an existing login state from the request.

func NewLoginState

func NewLoginState(req *http.Request) (*LoginState, error)

NewLoginState creates a new LoginState using parameters of the HTTP request.

func (*LoginState) Clear

func (s *LoginState) Clear() *LoginState

func (*LoginState) Descriptor deprecated

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

Deprecated: Use LoginState.ProtoReflect.Descriptor instead.

func (*LoginState) Error

func (s *LoginState) Error(errmsg string) *LoginState

func (*LoginState) GetRequestParams

func (x *LoginState) GetRequestParams() *RequestParams

func (*LoginState) GetSessionParams

func (x *LoginState) GetSessionParams() *SessionParams

func (*LoginState) ProtoMessage

func (*LoginState) ProtoMessage()

func (*LoginState) ProtoReflect

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

func (*LoginState) Reset

func (x *LoginState) Reset()

func (*LoginState) String

func (x *LoginState) String() string

type RequestParams

type RequestParams struct {

	// string auth_request_id = 1;
	Redirect string `protobuf:"bytes,2,opt,name=redirect,proto3" json:"redirect,omitempty"`
	// contains filtered or unexported fields
}

Request parameters must "stick" to the request, and passed along either via URL query args or POST form parameters, so it supports a quick encoding to safe string.

func NewRequestParamsFromRequest

func NewRequestParamsFromRequest(req *http.Request) (*RequestParams, error)

NewRequestParamsFromRequest creates RequestParams out of query arguments, in particular 'redir'. This is the other half of the logic in LoginApp.WithAuth() that builds the original request that starts the login process.

func (*RequestParams) AddToURL

func (p *RequestParams) AddToURL(uriStr string) string

func (*RequestParams) Descriptor deprecated

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

Deprecated: Use RequestParams.ProtoReflect.Descriptor instead.

func (*RequestParams) Encode

func (p *RequestParams) Encode() string

func (*RequestParams) FieldName

func (p *RequestParams) FieldName() string

func (*RequestParams) GetRedirect

func (x *RequestParams) GetRedirect() string

func (*RequestParams) InputField

func (p *RequestParams) InputField() template.HTML

func (*RequestParams) ProtoMessage

func (*RequestParams) ProtoMessage()

func (*RequestParams) ProtoReflect

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

func (*RequestParams) Reset

func (x *RequestParams) Reset()

func (*RequestParams) String

func (x *RequestParams) String() string

type SessionParams

type SessionParams struct {

	// This is just set to ensure the proto is not completely empty.
	Valid                  bool              `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"`
	Username               string            `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"`
	Password               string            `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
	AvailableTfaMechanisms []proto.Mechanism `` /* 158-byte string literal not displayed */
	WebauthnSessionId      string            `protobuf:"bytes,7,opt,name=webauthn_session_id,json=webauthnSessionId,proto3" json:"webauthn_session_id,omitempty"`
	WebauthnChallenge      string            `protobuf:"bytes,8,opt,name=webauthn_challenge,json=webauthnChallenge,proto3" json:"webauthn_challenge,omitempty"`
	// This is used as a simpler "flash".
	ErrorMessage string `protobuf:"bytes,9,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
	// contains filtered or unexported fields
}

Session parameters are shared with all clients in the same browser. They hold temporary information that needs to be passed between different stages of the login workflow.

func (*SessionParams) Descriptor deprecated

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

Deprecated: Use SessionParams.ProtoReflect.Descriptor instead.

func (*SessionParams) GetAvailableTfaMechanisms

func (x *SessionParams) GetAvailableTfaMechanisms() []proto.Mechanism

func (*SessionParams) GetErrorMessage

func (x *SessionParams) GetErrorMessage() string

func (*SessionParams) GetPassword

func (x *SessionParams) GetPassword() string

func (*SessionParams) GetUsername

func (x *SessionParams) GetUsername() string

func (*SessionParams) GetValid

func (x *SessionParams) GetValid() bool

func (*SessionParams) GetWebauthnChallenge

func (x *SessionParams) GetWebauthnChallenge() string

func (*SessionParams) GetWebauthnSessionId

func (x *SessionParams) GetWebauthnSessionId() string

func (*SessionParams) HasOTP

func (p *SessionParams) HasOTP() bool

func (*SessionParams) HasWebAuthn

func (p *SessionParams) HasWebAuthn() bool

func (*SessionParams) PopError

func (p *SessionParams) PopError() string

func (*SessionParams) ProtoMessage

func (*SessionParams) ProtoMessage()

func (*SessionParams) ProtoReflect

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

func (*SessionParams) Reset

func (x *SessionParams) Reset()

func (*SessionParams) SetPartial

func (p *SessionParams) SetPartial(authReq *authpb.Request, authResp *authpb.Response)

func (*SessionParams) String

func (x *SessionParams) String() string

Jump to

Keyboard shortcuts

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