Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	State_name = map[int32]string{
		0: "STATE_UNDEFINED",
		1: "STATE_OPEN",
		2: "STATE_CLOSED",
		3: "STATE_REVOKED",
	}
	State_value = map[string]int32{
		"STATE_UNDEFINED": 0,
		"STATE_OPEN":      1,
		"STATE_CLOSED":    2,
		"STATE_REVOKED":   3,
	}
)

Enum value maps for State.

View Source
var File_go_chromium_org_luci_server_encryptedcookies_session_sessionpb_sessions_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Private

type Private struct {
	RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	AccessToken  string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	IdToken      string `protobuf:"bytes,3,opt,name=id_token,json=idToken,proto3" json:"id_token,omitempty"`
	// contains filtered or unexported fields
}

Private contains data that is stored in the encrypted form in the session.

The encryption key is part of the session cookie and not stored in the backend storage.

func (*Private) Descriptor

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

Deprecated: Use Private.ProtoReflect.Descriptor instead.

func (*Private) GetAccessToken

func (x *Private) GetAccessToken() string

func (*Private) GetIdToken

func (x *Private) GetIdToken() string

func (*Private) GetRefreshToken

func (x *Private) GetRefreshToken() string

func (*Private) ProtoMessage

func (*Private) ProtoMessage()

func (*Private) ProtoReflect

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

func (*Private) Reset

func (x *Private) Reset()

func (*Private) String

func (x *Private) String() string

type Session

type Session struct {
	State            State                  `protobuf:"varint,1,opt,name=state,proto3,enum=luci.server.encryptedcookies.session.State" json:"state,omitempty"` // identifies where the session is in its lifecycle
	Generation       int32                  `protobuf:"varint,2,opt,name=generation,proto3" json:"generation,omitempty"`                                       // incremented during each mutation
	Created          *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created,proto3" json:"created,omitempty"`                                              // when the session was created
	LastRefresh      *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_refresh,json=lastRefresh,proto3" json:"last_refresh,omitempty"`                   // last time it was refreshed
	NextRefresh      *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=next_refresh,json=nextRefresh,proto3" json:"next_refresh,omitempty"`                   // next refresh time
	Closed           *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=closed,proto3" json:"closed,omitempty"`                                                // when it was closed/revoked
	Sub              string                 `protobuf:"bytes,7,opt,name=sub,proto3" json:"sub,omitempty"`                                                      // user ID from "sub" ID token claim
	Email            string                 `protobuf:"bytes,8,opt,name=email,proto3" json:"email,omitempty"`                                                  // user email from "email" ID token claim
	Name             string                 `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"`                                                    // user name from "name" ID token claim
	Picture          string                 `protobuf:"bytes,10,opt,name=picture,proto3" json:"picture,omitempty"`                                             // profile picture URL from "picture" ID token claim
	EncryptedPrivate []byte                 `protobuf:"bytes,11,opt,name=encrypted_private,json=encryptedPrivate,proto3" json:"encrypted_private,omitempty"`   // wire-serialized and encrypted Private proto
	// contains filtered or unexported fields
}

Session is what is actually stored in the session storage.

func (*Session) Descriptor

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetClosed

func (x *Session) GetClosed() *timestamppb.Timestamp

func (*Session) GetCreated

func (x *Session) GetCreated() *timestamppb.Timestamp

func (*Session) GetEmail

func (x *Session) GetEmail() string

func (*Session) GetEncryptedPrivate

func (x *Session) GetEncryptedPrivate() []byte

func (*Session) GetGeneration

func (x *Session) GetGeneration() int32

func (*Session) GetLastRefresh

func (x *Session) GetLastRefresh() *timestamppb.Timestamp

func (*Session) GetName

func (x *Session) GetName() string

func (*Session) GetNextRefresh

func (x *Session) GetNextRefresh() *timestamppb.Timestamp

func (*Session) GetPicture

func (x *Session) GetPicture() string

func (*Session) GetState

func (x *Session) GetState() State

func (*Session) GetSub

func (x *Session) GetSub() string

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

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

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

type State

type State int32
const (
	State_STATE_UNDEFINED State = 0
	State_STATE_OPEN      State = 1 // the session is valid and can be used
	State_STATE_CLOSED    State = 2 // the session was explicitly closed (e.g. logout)
	State_STATE_REVOKED   State = 3 // the ID provider refused to refresh tokens
)

func (State) Descriptor

func (State) Descriptor() protoreflect.EnumDescriptor

func (State) Enum

func (x State) Enum() *State

func (State) EnumDescriptor

func (State) EnumDescriptor() ([]byte, []int)

Deprecated: Use State.Descriptor instead.

func (State) Number

func (x State) Number() protoreflect.EnumNumber

func (State) String

func (x State) String() string

func (State) Type

func (State) Type() protoreflect.EnumType