This commit is contained in:
Alex Shevchuk
2025-08-18 17:12:04 +03:00
commit d84487d238
157 changed files with 160686 additions and 0 deletions

View 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
}
}