service

package
v0.0.0-...-9d17cb2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRefreshTokenFromData

func CreateRefreshTokenFromData(guid string, id string, t int64) []byte

guid 32 32 id/link 28 60 time 12 72 , the bcrypts maximum db033ddc20214537a63686fb3bcdeab0 db033ddc20214537a63686fb3b tttttttttttt

Types

type AuthService

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

func NewAuthService

func NewAuthService(repo repository.Authorization) *AuthService

func (*AuthService) Access

func (authService *AuthService) Access(guid string, clientIP string) (string, string, time.Time, time.Time, error)

usr token is jwt, db token is "custom" and bcrypted access is jwt, only on user

func (*AuthService) CreateUser

func (authService *AuthService) CreateUser(user goproj.User) (string, error)

func (*AuthService) GetUserRTokensByGUID

func (authService *AuthService) GetUserRTokensByGUID(guid string) ([]string, error)

func (*AuthService) Refresh

func (authService *AuthService) Refresh(usrRefreshToken string, AccessToken string, clientIP string) (string, time.Time, error)

func (*AuthService) UpdateUserRefreshTokens

func (authService *AuthService) UpdateUserRefreshTokens(guid string, rTokens []string) error

type Authorization

type Authorization interface {
	CreateUser(user goproj.User) (string, error)
	Access(guid string, clientIP string) (string, string, time.Time, time.Time, error)
	Refresh(usrRToken string, aToken string, clientIP string) (string, time.Time, error)
}

type Service

type Service struct {
	Authorization
}

func NewService

func NewService(repo *repository.Repository) *Service

Jump to

Keyboard shortcuts

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