1
This commit is contained in:
24
internal/services/auth_infrastructure/client.go
Normal file
24
internal/services/auth_infrastructure/client.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package authinfra
|
||||
|
||||
import "context"
|
||||
|
||||
type AuthInfrastructureService interface {
|
||||
CreatePasswordResetOTP(ctx context.Context, request *PasswordResetOTPCreateRequest) (*PasswordResetOTPCreateResponse, error)
|
||||
ValidatePasswordResetOTP(ctx context.Context, request *ValidatePasswordResetOTPRequest) (*ValidatePasswordResetOTPResponse, error)
|
||||
ValidatePasswordResetToken(ctx context.Context, request *ValidatePasswordResetTokenRequest) (*ValidatePasswordResetTokenResponse, error)
|
||||
}
|
||||
|
||||
func New(typ Type, cfg Config) (AuthInfrastructureService, error) {
|
||||
switch typ {
|
||||
case CacheAuthInfrastructureServiceType:
|
||||
config, ok := cfg.(CacheAuthInfraServiceConfig)
|
||||
if !ok {
|
||||
return nil, ErrInvalidConfig
|
||||
}
|
||||
|
||||
return newCacheAuthInfraService(config), nil
|
||||
|
||||
default:
|
||||
return nil, ErrUnknownAuthInfrastructureServiceType
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user