decorators

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiTenantAuthService

type MultiTenantAuthService struct {
	// contains filtered or unexported fields
}

MultiTenantAuthService decorates the core auth service with multi-tenancy capabilities

func NewMultiTenantAuthService

func NewMultiTenantAuthService(authService authsome.AuthService, appService *app.ServiceImpl) *MultiTenantAuthService

NewMultiTenantAuthService creates a new multi-tenant auth service decorator

func (*MultiTenantAuthService) ChangePassword added in v0.0.6

func (s *MultiTenantAuthService) ChangePassword(ctx context.Context, userID xid.ID, oldPassword, newPassword string) error

ChangePassword changes a user's password after verifying the old password

func (*MultiTenantAuthService) CheckCredentials

func (s *MultiTenantAuthService) CheckCredentials(ctx context.Context, email, password string) (*user.User, error)

CheckCredentials validates user credentials within app context

func (*MultiTenantAuthService) ConfirmEmailChange added in v0.0.6

func (s *MultiTenantAuthService) ConfirmEmailChange(ctx context.Context, token string) error

ConfirmEmailChange completes the email change flow

func (*MultiTenantAuthService) CreateSessionForUser

func (s *MultiTenantAuthService) CreateSessionForUser(ctx context.Context, u *user.User, remember bool, ipAddress, userAgent string) (*responses.AuthResponse, error)

CreateSessionForUser creates a session for a user within app context

func (*MultiTenantAuthService) GetSession

GetSession retrieves a session within app context

func (*MultiTenantAuthService) RefreshSession added in v0.0.3

func (s *MultiTenantAuthService) RefreshSession(ctx context.Context, refreshToken string) (*responses.RefreshSessionResponse, error)

RefreshSession refreshes an access token using a refresh token within app context

func (*MultiTenantAuthService) RequestEmailChange added in v0.0.6

func (s *MultiTenantAuthService) RequestEmailChange(ctx context.Context, userID xid.ID, newEmail string) (string, error)

RequestEmailChange initiates an email change flow

func (*MultiTenantAuthService) RequestPasswordReset added in v0.0.6

func (s *MultiTenantAuthService) RequestPasswordReset(ctx context.Context, email string) (string, string, error)

RequestPasswordReset initiates a password reset flow Returns token (for URL links) and code (for mobile entry)

func (*MultiTenantAuthService) ResetPassword added in v0.0.6

func (s *MultiTenantAuthService) ResetPassword(ctx context.Context, token, newPassword string) error

ResetPassword completes the password reset flow

func (*MultiTenantAuthService) ResetPasswordWithCode added in v0.0.8

func (s *MultiTenantAuthService) ResetPasswordWithCode(ctx context.Context, code, newPassword string) error

ResetPasswordWithCode completes the password reset flow using 6-digit code

func (*MultiTenantAuthService) SignIn

SignIn authenticates a user within an app context

func (*MultiTenantAuthService) SignOut

SignOut signs out a user from the current session

func (*MultiTenantAuthService) SignUp

SignUp registers a new user and adds them to the organization

func (*MultiTenantAuthService) UpdateUser

func (s *MultiTenantAuthService) UpdateUser(ctx context.Context, id xid.ID, req *user.UpdateUserRequest) (*user.User, error)

UpdateUser updates a user within app context

func (*MultiTenantAuthService) ValidateEmailChangeToken added in v0.0.6

func (s *MultiTenantAuthService) ValidateEmailChangeToken(ctx context.Context, token string) (bool, error)

ValidateEmailChangeToken checks if an email change token is valid

func (*MultiTenantAuthService) ValidateResetToken added in v0.0.6

func (s *MultiTenantAuthService) ValidateResetToken(ctx context.Context, token string) (bool, error)

ValidateResetToken checks if a reset token is valid

type MultiTenantSessionService

type MultiTenantSessionService struct {
	// contains filtered or unexported fields
}

MultiTenantSessionService decorates the core session service with multi-tenancy capabilities

func NewMultiTenantSessionService

func NewMultiTenantSessionService(sessionService session.ServiceInterface, appService *coreapp.ServiceImpl) *MultiTenantSessionService

NewMultiTenantSessionService creates a new multi-tenant session service

func (*MultiTenantSessionService) Create

Create creates a new session with app context

func (*MultiTenantSessionService) FindByID

FindByID retrieves a session by ID with app context

func (*MultiTenantSessionService) FindByToken

func (s *MultiTenantSessionService) FindByToken(ctx context.Context, token string) (*session.Session, error)

FindByToken retrieves a session by token with app context

func (*MultiTenantSessionService) ListSessions

ListSessions lists sessions with filtering within app context

func (*MultiTenantSessionService) RefreshSession added in v0.0.3

func (s *MultiTenantSessionService) RefreshSession(ctx context.Context, refreshToken string) (*session.RefreshResponse, error)

RefreshSession refreshes an access token using a refresh token within app context

func (*MultiTenantSessionService) Revoke

func (s *MultiTenantSessionService) Revoke(ctx context.Context, token string) error

Revoke revokes a session with app context

func (*MultiTenantSessionService) RevokeByID

func (s *MultiTenantSessionService) RevokeByID(ctx context.Context, id xid.ID) error

RevokeByID revokes a session by ID with app context

func (*MultiTenantSessionService) TouchSession added in v0.0.3

TouchSession extends the session expiry time if sliding window is enabled

type MultiTenantUserService

type MultiTenantUserService struct {
	// contains filtered or unexported fields
}

MultiTenantUserService decorates the user service with multi-tenancy support

func NewMultiTenantUserService

func NewMultiTenantUserService(userService user.ServiceInterface, appService *coreapp.ServiceImpl) *MultiTenantUserService

NewMultiTenantUserService creates a new multi-tenant user service decorator

func (*MultiTenantUserService) CountUsers

func (s *MultiTenantUserService) CountUsers(ctx context.Context, filter *user.CountUsersFilter) (int, error)

CountUsers counts users in the specified app

func (*MultiTenantUserService) Create

Create creates a new user within an app context

func (*MultiTenantUserService) Delete

func (s *MultiTenantUserService) Delete(ctx context.Context, id xid.ID) error

Delete deletes a user within app context

func (*MultiTenantUserService) FindByAppAndEmail

func (s *MultiTenantUserService) FindByAppAndEmail(ctx context.Context, appID xid.ID, email string) (*user.User, error)

FindByAppAndEmail finds a user by app and email

func (*MultiTenantUserService) FindByEmail

func (s *MultiTenantUserService) FindByEmail(ctx context.Context, email string) (*user.User, error)

FindByEmail finds a user by email within app context

func (*MultiTenantUserService) FindByID

func (s *MultiTenantUserService) FindByID(ctx context.Context, id xid.ID) (*user.User, error)

FindByID finds a user by ID within app context

func (*MultiTenantUserService) FindByUsername

func (s *MultiTenantUserService) FindByUsername(ctx context.Context, username string) (*user.User, error)

FindByUsername finds a user by username within app context

func (*MultiTenantUserService) GetAppContext

func (s *MultiTenantUserService) GetAppContext(ctx context.Context) xid.ID

GetAppContext gets the organization ID from context

func (*MultiTenantUserService) GetHookRegistry added in v0.0.6

func (s *MultiTenantUserService) GetHookRegistry() interface{}

GetHookRegistry returns the hook registry

func (*MultiTenantUserService) GetVerificationRepo added in v0.0.6

func (s *MultiTenantUserService) GetVerificationRepo() interface{}

GetVerificationRepo returns the verification repository

func (*MultiTenantUserService) ListUsers

ListUsers lists users within app context with search support

func (*MultiTenantUserService) SetHookRegistry added in v0.0.6

func (s *MultiTenantUserService) SetHookRegistry(registry interface{})

SetHookRegistry sets the hook registry for lifecycle events

func (*MultiTenantUserService) SetOrganizationContext

func (s *MultiTenantUserService) SetOrganizationContext(ctx context.Context, appID string) context.Context

SetOrganizationContext sets the organization ID in context

func (*MultiTenantUserService) SetVerificationRepo added in v0.0.6

func (s *MultiTenantUserService) SetVerificationRepo(repo interface{})

SetVerificationRepo sets the verification repository for password resets

func (*MultiTenantUserService) Update

Update updates a user within app context

func (*MultiTenantUserService) UpdatePassword added in v0.0.6

func (s *MultiTenantUserService) UpdatePassword(ctx context.Context, userID xid.ID, hashedPassword string) error

UpdatePassword updates a user's password directly

Jump to

Keyboard shortcuts

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