This repository has been archived by the owner on Dec 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: verify minSize, minDigit, minSpecialChars and noRepeted
- Loading branch information
1 parent
f4a9293
commit 16e3028
Showing
10 changed files
with
61 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
package graph | ||
|
||
import "github.com/brandaogabriel7/studio-sol-back-end-test/src/services/password_validation" | ||
|
||
// This file will not be regenerated automatically. | ||
// | ||
// It serves as dependency injection for your app, add any dependencies you require here. | ||
|
||
type Resolver struct{} | ||
type Resolver struct{ | ||
PasswordValidationService password_validation.PasswordValidationService | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ type Verify { | |
|
||
input Rule { | ||
rule: String! | ||
value: Int | ||
value: Int! | ||
} | ||
|
||
type Query { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package factories | ||
|
||
import ( | ||
"github.com/brandaogabriel7/studio-sol-back-end-test/src/services/password_validation" | ||
"github.com/brandaogabriel7/studio-sol-back-end-test/src/strategies/validation" | ||
) | ||
|
||
func GetDefaultPasswordValidationService() password_validation.PasswordValidationService { | ||
validationStrategies := map[string]validation.ValidationStrategy{ | ||
string(validation.MIN_SIZE): validation.MinSizeValidationStrategy{}, | ||
string(validation.MIN_DIGIT): validation.NewMinDigitValidationStrategy(), | ||
string(validation.MIN_SPECIAL_CHARS): validation.NewMinSpecialCharsValidationStrategy(), | ||
string(validation.NO_REPETED): validation.NoRepetedStrategy{}, | ||
} | ||
|
||
return *password_validation.NewPasswordValidationService(validationStrategies) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package validation | ||
|
||
type ValidationType string | ||
|
||
const MIN_SIZE ValidationType = "minSize" | ||
const MIN_DIGIT ValidationType = "minDigit" | ||
const MIN_SPECIAL_CHARS ValidationType = "minSpecialChars" | ||
const NO_REPETED ValidationType = "noRepeted" |