session

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error_ErrorCode_name = map[int32]string{
		0: "ERROR_SERVER_ERROR",
		1: "ERROR_ROLE_REJECTED",
		2: "ERROR_INVALID_REQUEST",
		3: "ERROR_UNAUTHORIZED",
	}
	Error_ErrorCode_value = map[string]int32{
		"ERROR_SERVER_ERROR":    0,
		"ERROR_ROLE_REJECTED":   1,
		"ERROR_INVALID_REQUEST": 2,
		"ERROR_UNAUTHORIZED":    3,
	}
)

Enum value maps for Error_ErrorCode.

View Source
var File_session_claims_proto protoreflect.FileDescriptor
View Source
var File_session_session_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AddressClaim

type AddressClaim struct {
	Formatted     string `protobuf:"bytes,1,opt,name=formatted,proto3" json:"formatted,omitempty"`
	StreetAddress string `protobuf:"bytes,2,opt,name=street_address,json=streetAddress,proto3" json:"street_address,omitempty"`
	Locality      string `protobuf:"bytes,3,opt,name=locality,proto3" json:"locality,omitempty"`
	Region        string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"`
	PostalCode    string `protobuf:"bytes,5,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"`
	Country       string `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"`
	// contains filtered or unexported fields
}

func (*AddressClaim) Descriptor deprecated

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

Deprecated: Use AddressClaim.ProtoReflect.Descriptor instead.

func (*AddressClaim) GetCountry

func (x *AddressClaim) GetCountry() string

func (*AddressClaim) GetFormatted

func (x *AddressClaim) GetFormatted() string

func (*AddressClaim) GetLocality

func (x *AddressClaim) GetLocality() string

func (*AddressClaim) GetPostalCode

func (x *AddressClaim) GetPostalCode() string

func (*AddressClaim) GetRegion

func (x *AddressClaim) GetRegion() string

func (*AddressClaim) GetStreetAddress

func (x *AddressClaim) GetStreetAddress() string

func (*AddressClaim) ProtoMessage

func (*AddressClaim) ProtoMessage()

func (*AddressClaim) ProtoReflect

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

func (*AddressClaim) Reset

func (x *AddressClaim) Reset()

func (*AddressClaim) String

func (x *AddressClaim) String() string

type CommonError

type CommonError struct {
	ErrorCount int32  `protobuf:"varint,1,opt,name=error_count,json=errorCount,proto3" json:"error_count,omitempty"`
	Errors     []*Err `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"`
	// contains filtered or unexported fields
}

CommonError later replace "Error"

func (*CommonError) Descriptor deprecated

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

Deprecated: Use CommonError.ProtoReflect.Descriptor instead.

func (*CommonError) GetErrorCount

func (x *CommonError) GetErrorCount() int32

func (*CommonError) GetErrors

func (x *CommonError) GetErrors() []*Err

func (*CommonError) ProtoMessage

func (*CommonError) ProtoMessage()

func (*CommonError) ProtoReflect

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

func (*CommonError) Reset

func (x *CommonError) Reset()

func (*CommonError) String

func (x *CommonError) String() string

type CommonRequest

type CommonRequest struct {
	Metadata map[string]*anypb.Any `` /* 143-byte string literal not displayed */
	Data     *anypb.Any            `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CommonRequest) Descriptor deprecated

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

Deprecated: Use CommonRequest.ProtoReflect.Descriptor instead.

func (*CommonRequest) GetData

func (x *CommonRequest) GetData() *anypb.Any

func (*CommonRequest) GetMetadata

func (x *CommonRequest) GetMetadata() map[string]*anypb.Any

func (*CommonRequest) ProtoMessage

func (*CommonRequest) ProtoMessage()

func (*CommonRequest) ProtoReflect

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

func (*CommonRequest) Reset

func (x *CommonRequest) Reset()

func (*CommonRequest) String

func (x *CommonRequest) String() string

type CommonResponse

type CommonResponse struct {
	Error   *CommonError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	Success *Success     `protobuf:"bytes,2,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*CommonResponse) Descriptor deprecated

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

Deprecated: Use CommonResponse.ProtoReflect.Descriptor instead.

func (*CommonResponse) GetError

func (x *CommonResponse) GetError() *CommonError

func (*CommonResponse) GetSuccess

func (x *CommonResponse) GetSuccess() *Success

func (*CommonResponse) ProtoMessage

func (*CommonResponse) ProtoMessage()

func (*CommonResponse) ProtoReflect

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

func (*CommonResponse) Reset

func (x *CommonResponse) Reset()

func (*CommonResponse) String

func (x *CommonResponse) String() string

type Credential

type Credential struct {
	Email    string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*Credential) Descriptor deprecated

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

Deprecated: Use Credential.ProtoReflect.Descriptor instead.

func (*Credential) GetEmail

func (x *Credential) GetEmail() string

func (*Credential) GetPassword

func (x *Credential) GetPassword() string

func (*Credential) ProtoMessage

func (*Credential) ProtoMessage()

func (*Credential) ProtoReflect

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

func (*Credential) Reset

func (x *Credential) Reset()

func (*Credential) String

func (x *Credential) String() string

type Err

type Err struct {

	// For if logic in front end
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// User friendly messages
	// Please no internal detail (eg. panic at line...)
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// URL for help / next action items
	Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
	// Helpful icon
	IconUrl string `protobuf:"bytes,4,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"`
	// Helpful images
	ImageUrl string `protobuf:"bytes,5,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"`
	// ERROR, WARN, INFO, etc.
	Severity int32 `protobuf:"varint,6,opt,name=severity,proto3" json:"severity,omitempty"`
	HttpCode int32 `protobuf:"varint,7,opt,name=http_code,json=httpCode,proto3" json:"http_code,omitempty"`
	// contains filtered or unexported fields
}

func (*Err) Descriptor deprecated

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

Deprecated: Use Err.ProtoReflect.Descriptor instead.

func (*Err) GetCode

func (x *Err) GetCode() string

func (*Err) GetHttpCode

func (x *Err) GetHttpCode() int32

func (*Err) GetIconUrl

func (x *Err) GetIconUrl() string

func (*Err) GetImageUrl

func (x *Err) GetImageUrl() string

func (*Err) GetMessage

func (x *Err) GetMessage() string

func (*Err) GetSeverity

func (x *Err) GetSeverity() int32

func (*Err) GetUrl

func (x *Err) GetUrl() string

func (*Err) ProtoMessage

func (*Err) ProtoMessage()

func (*Err) ProtoReflect

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

func (*Err) Reset

func (x *Err) Reset()

func (*Err) String

func (x *Err) String() string

type Error

type Error struct {
	Code    Error_ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=session.Error_ErrorCode" json:"code,omitempty"`
	Message string          `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

Error is the common error format Should be on different file TO DO

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() Error_ErrorCode

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type Error_ErrorCode

type Error_ErrorCode int32
const (
	Error_ERROR_SERVER_ERROR    Error_ErrorCode = 0
	Error_ERROR_ROLE_REJECTED   Error_ErrorCode = 1
	Error_ERROR_INVALID_REQUEST Error_ErrorCode = 2
	Error_ERROR_UNAUTHORIZED    Error_ErrorCode = 3
)

func (Error_ErrorCode) Descriptor

func (Error_ErrorCode) Enum

func (x Error_ErrorCode) Enum() *Error_ErrorCode

func (Error_ErrorCode) EnumDescriptor deprecated

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

Deprecated: Use Error_ErrorCode.Descriptor instead.

func (Error_ErrorCode) Number

func (Error_ErrorCode) String

func (x Error_ErrorCode) String() string

func (Error_ErrorCode) Type

type GenericToken

type GenericToken struct {
	Token  string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

GenericToken is the payload for for generic token

func (*GenericToken) Descriptor deprecated

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

Deprecated: Use GenericToken.ProtoReflect.Descriptor instead.

func (*GenericToken) GetToken

func (x *GenericToken) GetToken() string

func (*GenericToken) GetUserId

func (x *GenericToken) GetUserId() string

func (*GenericToken) ProtoMessage

func (*GenericToken) ProtoMessage()

func (*GenericToken) ProtoReflect

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

func (*GenericToken) Reset

func (x *GenericToken) Reset()

func (*GenericToken) String

func (x *GenericToken) String() string

type Grant

type Grant struct {
	UserId             string          `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	GroupId            string          `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	Name               string          `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	UiAndApiPermission map[string]bool `` /* 194-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Grant) Descriptor deprecated

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

Deprecated: Use Grant.ProtoReflect.Descriptor instead.

func (*Grant) GetGroupId

func (x *Grant) GetGroupId() string

func (*Grant) GetName

func (x *Grant) GetName() string

func (*Grant) GetUiAndApiPermission

func (x *Grant) GetUiAndApiPermission() map[string]bool

func (*Grant) GetUserId

func (x *Grant) GetUserId() string

func (*Grant) ProtoMessage

func (*Grant) ProtoMessage()

func (*Grant) ProtoReflect

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

func (*Grant) Reset

func (x *Grant) Reset()

func (*Grant) String

func (x *Grant) String() string

type OIDCClaim

type OIDCClaim struct {
	Iss                 string        `protobuf:"bytes,1,opt,name=iss,proto3" json:"iss,omitempty"` // issuer
	Sub                 string        `protobuf:"bytes,2,opt,name=sub,proto3" json:"sub,omitempty"` // the ID
	Name                string        `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	GivenName           string        `protobuf:"bytes,4,opt,name=given_name,json=givenName,proto3" json:"given_name,omitempty"`
	FamilyName          string        `protobuf:"bytes,5,opt,name=family_name,json=familyName,proto3" json:"family_name,omitempty"`
	MidleName           string        `protobuf:"bytes,6,opt,name=midle_name,json=midleName,proto3" json:"midle_name,omitempty"`
	Nickname            string        `protobuf:"bytes,7,opt,name=nickname,proto3" json:"nickname,omitempty"`
	PreferredUsername   string        `protobuf:"bytes,8,opt,name=preferred_username,json=preferredUsername,proto3" json:"preferred_username,omitempty"`
	Profile             string        `protobuf:"bytes,9,opt,name=profile,proto3" json:"profile,omitempty"`
	Picture             string        `protobuf:"bytes,10,opt,name=picture,proto3" json:"picture,omitempty"`
	Website             string        `protobuf:"bytes,11,opt,name=website,proto3" json:"website,omitempty"`
	Email               string        `protobuf:"bytes,12,opt,name=email,proto3" json:"email,omitempty"`
	EmailVerified       bool          `protobuf:"varint,13,opt,name=email_verified,json=emailVerified,proto3" json:"email_verified,omitempty"`
	Gender              string        `protobuf:"bytes,14,opt,name=gender,proto3" json:"gender,omitempty"`
	Birthdate           string        `protobuf:"bytes,15,opt,name=birthdate,proto3" json:"birthdate,omitempty"`
	Zoneinfo            string        `protobuf:"bytes,16,opt,name=zoneinfo,proto3" json:"zoneinfo,omitempty"`
	Locale              string        `protobuf:"bytes,17,opt,name=locale,proto3" json:"locale,omitempty"`
	PhoneNumber         string        `protobuf:"bytes,18,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"`
	PhoneNumberVerified bool          `protobuf:"varint,19,opt,name=phone_number_verified,json=phoneNumberVerified,proto3" json:"phone_number_verified,omitempty"`
	Address             *AddressClaim `protobuf:"bytes,20,opt,name=address,proto3" json:"address,omitempty"`
	UpdatedAt           int64         `protobuf:"varint,21,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

OIDC claim UserID https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims Important is the iss, sub, email verified, phone verified, Other optional.

func (*OIDCClaim) Descriptor deprecated

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

Deprecated: Use OIDCClaim.ProtoReflect.Descriptor instead.

func (*OIDCClaim) GetAddress

func (x *OIDCClaim) GetAddress() *AddressClaim

func (*OIDCClaim) GetBirthdate

func (x *OIDCClaim) GetBirthdate() string

func (*OIDCClaim) GetEmail

func (x *OIDCClaim) GetEmail() string

func (*OIDCClaim) GetEmailVerified

func (x *OIDCClaim) GetEmailVerified() bool

func (*OIDCClaim) GetFamilyName

func (x *OIDCClaim) GetFamilyName() string

func (*OIDCClaim) GetGender

func (x *OIDCClaim) GetGender() string

func (*OIDCClaim) GetGivenName

func (x *OIDCClaim) GetGivenName() string

func (*OIDCClaim) GetIss

func (x *OIDCClaim) GetIss() string

func (*OIDCClaim) GetLocale

func (x *OIDCClaim) GetLocale() string

func (*OIDCClaim) GetMidleName

func (x *OIDCClaim) GetMidleName() string

func (*OIDCClaim) GetName

func (x *OIDCClaim) GetName() string

func (*OIDCClaim) GetNickname

func (x *OIDCClaim) GetNickname() string

func (*OIDCClaim) GetPhoneNumber

func (x *OIDCClaim) GetPhoneNumber() string

func (*OIDCClaim) GetPhoneNumberVerified

func (x *OIDCClaim) GetPhoneNumberVerified() bool

func (*OIDCClaim) GetPicture

func (x *OIDCClaim) GetPicture() string

func (*OIDCClaim) GetPreferredUsername

func (x *OIDCClaim) GetPreferredUsername() string

func (*OIDCClaim) GetProfile

func (x *OIDCClaim) GetProfile() string

func (*OIDCClaim) GetSub

func (x *OIDCClaim) GetSub() string

func (*OIDCClaim) GetUpdatedAt

func (x *OIDCClaim) GetUpdatedAt() int64

func (*OIDCClaim) GetWebsite

func (x *OIDCClaim) GetWebsite() string

func (*OIDCClaim) GetZoneinfo

func (x *OIDCClaim) GetZoneinfo() string

func (*OIDCClaim) ProtoMessage

func (*OIDCClaim) ProtoMessage()

func (*OIDCClaim) ProtoReflect

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

func (*OIDCClaim) Reset

func (x *OIDCClaim) Reset()

func (*OIDCClaim) String

func (x *OIDCClaim) String() string

type Profile

type Profile struct {
	Id           string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Url          string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	DisplayName  string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	ImageDataUrl string `protobuf:"bytes,4,opt,name=image_data_url,json=imageDataUrl,proto3" json:"image_data_url,omitempty"`
	ImageUrl     string `protobuf:"bytes,5,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"`
	UserId       string `protobuf:"bytes,6,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

Profile for summary

func (*Profile) Descriptor deprecated

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

Deprecated: Use Profile.ProtoReflect.Descriptor instead.

func (*Profile) GetDisplayName

func (x *Profile) GetDisplayName() string

func (*Profile) GetId

func (x *Profile) GetId() string

func (*Profile) GetImageDataUrl

func (x *Profile) GetImageDataUrl() string

func (*Profile) GetImageUrl

func (x *Profile) GetImageUrl() string

func (*Profile) GetUrl

func (x *Profile) GetUrl() string

func (*Profile) GetUserId

func (x *Profile) GetUserId() string

func (*Profile) ProtoMessage

func (*Profile) ProtoMessage()

func (*Profile) ProtoReflect

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

func (*Profile) Reset

func (x *Profile) Reset()

func (*Profile) String

func (x *Profile) String() string

type Session

type Session struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // JWT (contain custom claim and other standard claims), and auth grant
	// contains filtered or unexported fields
}

Session contains authorization information about a session

func (*Session) Descriptor deprecated

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetId

func (x *Session) GetId() 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 SessionData

type SessionData struct {
	NonRegisteredId *OIDCClaim        `protobuf:"bytes,1,opt,name=non_registered_id,json=nonRegisteredId,proto3" json:"non_registered_id,omitempty"` // User ID provided by identity provider
	Token           string            `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`                                              // random string
	Grants          map[string]*Grant ``                                                                                                             // access to an organization (represented by URL)
	/* 139-byte string literal not displayed */
	SignInMethod string `protobuf:"bytes,4,opt,name=sign_in_method,json=signInMethod,proto3" json:"sign_in_method,omitempty"`
	SignInEmail  string `protobuf:"bytes,5,opt,name=sign_in_email,json=signInEmail,proto3" json:"sign_in_email,omitempty"`
	Expiry       string `protobuf:"bytes,6,opt,name=expiry,proto3" json:"expiry,omitempty"`
	IsSuperAdmin bool   `protobuf:"varint,7,opt,name=is_super_admin,json=isSuperAdmin,proto3" json:"is_super_admin,omitempty"` // superadmin, the API administator
	// contains filtered or unexported fields
}

Contain arbitrary session data for our application to use

func (*SessionData) Descriptor deprecated

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

Deprecated: Use SessionData.ProtoReflect.Descriptor instead.

func (*SessionData) GetExpiry

func (x *SessionData) GetExpiry() string

func (*SessionData) GetGrants

func (x *SessionData) GetGrants() map[string]*Grant

func (*SessionData) GetIsSuperAdmin

func (x *SessionData) GetIsSuperAdmin() bool

func (*SessionData) GetNonRegisteredId

func (x *SessionData) GetNonRegisteredId() *OIDCClaim

func (*SessionData) GetSignInEmail

func (x *SessionData) GetSignInEmail() string

func (*SessionData) GetSignInMethod

func (x *SessionData) GetSignInMethod() string

func (*SessionData) GetToken

func (x *SessionData) GetToken() string

func (*SessionData) ProtoMessage

func (*SessionData) ProtoMessage()

func (*SessionData) ProtoReflect

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

func (*SessionData) Reset

func (x *SessionData) Reset()

func (*SessionData) String

func (x *SessionData) String() string

type Success

type Success struct {
	Metadata map[string]*anypb.Any `` /* 143-byte string literal not displayed */
	Data     *anypb.Any            `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Success) Descriptor deprecated

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

Deprecated: Use Success.ProtoReflect.Descriptor instead.

func (*Success) GetData

func (x *Success) GetData() *anypb.Any

func (*Success) GetMetadata

func (x *Success) GetMetadata() map[string]*anypb.Any

func (*Success) ProtoMessage

func (*Success) ProtoMessage()

func (*Success) ProtoReflect

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

func (*Success) Reset

func (x *Success) Reset()

func (*Success) String

func (x *Success) String() string

Jump to

Keyboard shortcuts

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