security

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationContext

type AuthenticationContext struct {
	TenantID string `json:"tenantId"`
	UserID   string `json:"userId"`
}

AuthenticationContext is the external user struct

func GetAuthenticationContext

func GetAuthenticationContext(ctx context.Context) *AuthenticationContext

GetAuthenticationContext return the authentication context inside the context

func NewAuthenticationContext

func NewAuthenticationContext(tenantID, userID string) *AuthenticationContext

NewAuthenticationContext returns a pointer of authentication context

func (*AuthenticationContext) GetTenantID

func (a *AuthenticationContext) GetTenantID() string

GetTenantID returns the tenant id

func (*AuthenticationContext) GetUserID

func (a *AuthenticationContext) GetUserID() string

GetUserID returns the user id

func (*AuthenticationContext) SetInContext

func (a *AuthenticationContext) SetInContext(ctx context.Context) context.Context

SetInContext returns a context with authentication inside

func (*AuthenticationContext) String

func (a *AuthenticationContext) String() string

String returns the details of auth context

func (*AuthenticationContext) Valid

func (a *AuthenticationContext) Valid() bool

Valid returns a boolean if the context is valid

type IAuthenticationContext

type IAuthenticationContext interface {
	GetUserID() string
	GetTenantID() string
}

IAuthenticationContext is the external user contract

type User

type User struct {
	ID       string
	Email    string
	Phone    string
	Name     string
	TenantID string
	Profile  string
	Profiles []string
	PhotoURL string
}

type UserCreate

type UserCreate struct {
	ID       string
	Email    string
	Phone    string
	Password string
	Name     string
	TenantID string
	Profile  string
	Profiles []string
	PhotoURL string
}

type UserUpdate

type UserUpdate struct {
	Email    string
	Phone    string
	Password string
	Name     string
	TenantID string
	Profile  string
	Profiles []string
	PhotoURL string
}

Jump to

Keyboard shortcuts

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