Skip to content

Commit 247419b

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 3022427 + 759066a commit 247419b

File tree

7 files changed

+83
-39
lines changed

7 files changed

+83
-39
lines changed

Gemfile.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GEM
1414
execjs
1515
coffee-script-source (1.11.1)
1616
colorator (1.1.0)
17-
commonmarker (0.23.4)
17+
commonmarker (0.23.6)
1818
concurrent-ruby (1.1.9)
1919
dnsruby (1.61.9)
2020
simpleidn (~> 0.1)
@@ -232,7 +232,7 @@ GEM
232232
jekyll-seo-tag (~> 2.1)
233233
minitest (5.15.0)
234234
multipart-post (2.1.1)
235-
nokogiri (1.13.6)
235+
nokogiri (1.13.10)
236236
mini_portile2 (~> 2.8.0)
237237
racc (~> 1.4)
238238
octokit (4.22.0)
@@ -241,7 +241,7 @@ GEM
241241
pathutil (0.16.2)
242242
forwardable-extended (~> 2.6)
243243
public_suffix (4.0.6)
244-
racc (1.6.0)
244+
racc (1.6.1)
245245
rb-fsevent (0.11.1)
246246
rb-inotify (0.10.1)
247247
ffi (~> 1.0)

_includes/footer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ul class="menu">
66
<li>&copy; juhara.com. All rights reserved.</li>
77
<li><a class="icon fa-github" href="https://github.com/fanoframework/fanoframework.github.io"> Edit Documentation</a></li>
8-
<li><a class="icon fa-youtube-play" href="https://www.youtube.com/channel/UCaPzzTCYRDs7pH9k-FtUHBQ"> Fano Framework video tutorials</a></li>
8+
<li><a class="icon fa-youtube-play" href="https://www.youtube.com/@fanoframework"> Fano Framework video tutorials</a></li>
99
<li>Template based on <a href="https://html5up.net/hyperspace">Hyperspace</a></li>
1010
</ul>
1111
</div>

deployment/scgi/index.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Fedora, Red Hat Enterprise Linux and Centos come with SELinux enabled and with v
196196
2019/10/17 15:17:58 [crit] 1022#0: *6 connect() to 127.0.0.1:20477 failed (13: Permission denied) while connecting to upstream, client: 192.168.0.79, server: example.fano, request: "GET / HTTP/1.1", upstream: "scgi://127.0.0.1:20477", host: "example.fano"
197197
```
198198

199-
Simple solution is to run SELinux with `permissive` mode. In permissive mode, SELinux permits all operations but log operations that would have breached in `enforcing` mode.
199+
For development, simple solution is to run SELinux with `permissive` mode. In permissive mode, SELinux permits all operations but log operations that would have breached in `enforcing` mode.
200200

201201
Web server such Apache or Nginx is listed in SELinux under `httpd_t` context. Run following command as root to add `httpd_t` to permissive mode.
202202

@@ -232,7 +232,10 @@ Take a note of value `policycoreutils-python-utils-2.8-16.1.el8.noarch` and run
232232
```
233233
# yum install policycoreutils-python-utils-2.8-16.1.el8.noarch
234234
```
235-
235+
### Setup SELinux policy for custom application
236+
237+
For setting up proper SELinux policy please consult [Writing a custom SELinux policy](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_selinux/writing-a-custom-selinux-policy_using-selinux)
238+
236239
## Explore more
237240

238241
- [Deploy as FastCGI application](/deployment/fastcgi)

documentation/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ description: Documentation and developer's resources for Fano Framework, web app
3737
## Security
3838

3939
- **[Handling CORS](/security/handling-cors)** discusses how to handle *Cross-origin Resource Sharing (CORS)* issue in Fano Framework.
40-
- **[Form Validation](/security/form-validation)**. It explains how to validate form input data.
40+
- **[Form Validation](/security/form-validation)**. It explains how to validate form input data including how to use [built-in validation rules](/security/form-validation/built-in-validation-rules/) or [creating your own validation rule]((/security/form-validation#writing-your-own-validation-rule)).
4141
- **[CSRF Protection](/security/csrf-protection)** discusses how to protect application from *Cross-site request Forgery (CSRF)* attack.
4242
- **[HTTP Verb Tunnelling](/security/http-verb-tunnelling)** explains about how to override HTTP verb such as `PUT`, `PATCH` and `DELETE`.
4343
- **[HTTP Authentication](/security/http-authentication)** discusses authentication using basic, digest, bearer token authentication. It is also related to JSON Web Token.

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<li><a href="#feature">Features</a></li>
4141
<li><a href="/getting-started">Getting Started</a></li>
4242
<li><a href="/documentation">Documentation</a></li>
43-
<li><a href="https://www.youtube.com/channel/UCaPzzTCYRDs7pH9k-FtUHBQ">Video Tutorials</a></li>
43+
<li><a href="https://www.youtube.com/@fanoframework">Video Tutorials</a></li>
4444
</ul>
4545
</nav>
4646
</div>
@@ -146,7 +146,7 @@ <h3>Open source</h3>
146146

147147
<ul class="actions">
148148
<li><a href="/documentation" class="button">Learn more</a></li>
149-
<li><a href="https://www.youtube.com/channel/UCaPzzTCYRDs7pH9k-FtUHBQ"
149+
<li><a href="https://www.youtube.com/@fanoframework"
150150
class="button icon fa-youtube-play">Video Tutorials</a></li>
151151
</ul>
152152
</div>
@@ -159,7 +159,7 @@ <h3>Open source</h3>
159159
<ul class="menu">
160160
<li>&copy; juhara.com. All rights reserved.</li>
161161
<li><a class="icon fa-github" href="https://github.com/fanoframework/fanoframework.github.io"> Edit Documentation</a></li>
162-
<li><a class="icon fa-youtube-play" href="https://www.youtube.com/channel/UCaPzzTCYRDs7pH9k-FtUHBQ"> Fano Framework video tutorials</a></li>
162+
<li><a class="icon fa-youtube-play" href="https://www.youtube.com/@fanoframework"> Fano Framework video tutorials</a></li>
163163
<li>Template based on <a href="https://html5up.net/hyperspace">Hyperspace</a></li>
164164
</ul>
165165
</div>

security/form-validation/built-in-validation-rules/index.md

+68-27
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,35 @@ description: List of built-in validation rules in Fano Framework
77

88
This page lists all available built-in validation rules that Fano Framework provides. For information on how to use these validation rules in application, please read [Form Validation](/security/form-validation) documentation.
99

10-
| [Alpha](#talphavalidator) | [Alpha Num](#talphanumvalidator) | [Alpha num space](#talphanumspacevalidator) |
11-
| [Required](#trequiredvalidator) | [Present](#tpresentvalidator) | [Required if](#trequiredifvalidator) |
12-
| [Alpha num dash](#talphanumdashvalidator) | [Email](#temailvalidator) | [Url](#turlvalidator) |
13-
| [Slug](#tslugvalidator) | [Phone](#tphonevalidator) | [Regex](#tregexvalidator) |
14-
| [Equal string](#tequalstrvalidator) | [Case insensitive equal string](#tcaseinsensitiveequalstrvalidator) | [Equal length](#tequallengthvalidator) |
15-
| [Min length](#tminlengthvalidator) | [Max length](#tmaxlengthvalidator) | [Integer](#tintegervalidator) |
16-
| [Int64](#tint64validator) | [Dword](#tdwordvalidator) | [Qword](#tqwordvalidator) |
17-
| [Float](#tfloatvalidator) | [Currency](#tcurrencyvalidator) | [Numeric](#tnumericvalidator) |
18-
| [Min integer](#tminintegervalidator) | [Max integer](#tmaxintegervalidator) | [Less than](#tlessthanvalidator) |
19-
| [Greater than](#tgreaterthanvalidator) | [Equal integer](#tequalintvalidator) | [Positive integer](#tpositiveintvalidator) |
20-
| [Negative integer](#tnegativeintvalidator) | [Odd integer](#toddintvalidator) | [Even integer](#tevenintvalidator) |
21-
| [Boolean](#tbooleanvalidator) | [Accepted](#tacceptedvalidator) | [In](#tinvalidator) |
22-
| [In integer](#tinintvalidator) | [Not in integer](#tnotinintvalidator) | [Date](#tdatevalidator) |
23-
| [Date time](#tdatetimevalidator) | [Time](#ttimevalidator) | [Equal date time](#tequaldatetimevalidator) |
24-
| [After date time](#tafterdatetimevalidator) | [Before date time](#tbeforedatetimevalidator) | [After date time field](#tafterdatetimefieldvalidator) |
25-
| [Before date time field](#tbeforedatetimefieldvalidator) | [File](#tfilevalidator) | [Directory](#tdirectoryvalidator) |
10+
| [Accepted](#tacceptedvalidator) | [After date time](#tafterdatetimevalidator) | [After date time field](#tafterdatetimefieldvalidator) |
11+
| [Alpha](#talphavalidator) | [Alpha Num](#talphanumvalidator) | [Alpha num dash](#talphanumdashvalidator) |
12+
| [Alpha num space](#talphanumspacevalidator) | [Always pass](#talwayspassvalidator) | [And](#tandvalidator) |
13+
| [Anti virus](#tantivirusvalidator) | [Any of](#tanyofvalidator) | [Base64](#tbase64validator) |
14+
| [Before date time](#tbeforedatetimevalidator) | [Before date time field](#tbeforedatetimefieldvalidator) | [Boolean](#tbooleanvalidator) |
15+
| [Case insensitive equal string](#tcaseinsensitiveequalstrvalidator) | [Color](#tcolorvalidator) | [Collective](#tcollectivevalidator) |
16+
| [Confirmed](#tconfirmedvalidator) | [Composite](#tcompositevalidator) | [Currency](#tcurrencyvalidator) |
17+
| [Date](#tdatevalidator) | [Date time](#tdatetimevalidator) | [Directory](#tdirectoryvalidator) |
18+
| [Dword](#tdwordvalidator) | [Email](#temailvalidator) | [Equal string](#tequalstrvalidator) |
19+
| [Equal length](#tequallengthvalidator) | [Equal date time](#tequaldatetimevalidator) | [Equal integer](#tequalintvalidator) |
20+
| [Even integer](#tevenintvalidator) | [Float](#tfloatvalidator) | [Greater than](#tgreaterthanvalidator) |
21+
| [In](#tinvalidator) | [IPv4](#tipv4validator) | [Int64](#tint64validator) |
22+
| [Less than](#tlessthanvalidator) | [Max integer](#tmaxintegervalidator) | [Max length](#tmaxlengthvalidator) |
23+
| [Min integer](#tminintegervalidator) | [Min length](#tminlengthvalidator) | [Negative integer](#tnegativeintvalidator) |
24+
| [Numeric](#tnumericvalidator) | [Integer](#tintegervalidator) | [In integer](#tinintvalidator) |
25+
| [Not in integer](#tnotinintvalidator) | [Odd integer](#toddintvalidator) | [Present](#tpresentvalidator) |
26+
| [Positive integer](#tpositiveintvalidator) | [Qword](#tqwordvalidator) | [Required](#trequiredvalidator) |
27+
| [Required if](#trequiredifvalidator) | [Time](#ttimevalidator) | [Url](#turlvalidator) |
28+
| [Slug](#tslugvalidator) | [File](#tfilevalidator) | [Not](#tnotvalidator) |
2629
| [Uploaded file](#tuploadedfilevalidator) | [Uploaded Mime](#tuploadedmimevalidator) | [Uploaded size](#tuploadedsizevalidator) |
2730
| [File format](#tfileformatvalidator) | [Image PNG](#timagepngvalidator-timagejpgvalidator-timagegifvalidator) | [Image JPG](#timagepngvalidator-timagejpgvalidator-timagegifvalidator) |
28-
| [Image GIF](#timagepngvalidator-timagejpgvalidator-timagegifvalidator) | [Anti virus](#tantivirusvalidator) | [Composite](#tcompositevalidator) |
29-
| [Collective](#tcollectivevalidator) | [Or](#torvalidator) | [Any of](#tanyofvalidator) |
30-
| [And](#tandvalidator) | [Not](#tnotvalidator) | [Confirmed](#tconfirmedvalidator) |
31+
| [Image GIF](#timagepngvalidator-timagejpgvalidator-timagegifvalidator) | [Regex](#tregexvalidator) | [Or](#torvalidator) |
3132
| [Same](#tsamevalidator) | [UUID](#tuuidvalidator) | [Exists](#texistsvalidator) |
32-
| [Always pass](#talwayspassvalidator) | [IPv4](#tipv4validator) | [IPv6](#tipv6validator) |
33-
| [MAC](#tmacaddrvalidator) | [JSON](#tjsonvalidator) | [Base64](#tbase64validator) |
34-
| [Color](#tcolorvalidator) | [Start With](#tstartwithvalidator) | [End With](#tendwithvalidator) |
33+
| [IPv6](#tipv6validator) | [MAC](#tmacaddrvalidator) | [JSON](#tjsonvalidator) |
34+
| [Phone](#tphonevalidator) | [Start With](#tstartwithvalidator) | [End With](#tendwithvalidator) |
3535
| [Latitude](#tlatitudevalidator) | [Longitude](#tlongitudevalidator) | [Between](#tbetweenvalidator) |
36-
| [Less or equal than](#tlessorequalthanvalidator) | [Greater or equal than](#tgreaterorequalthanvalidator) | - |
36+
| [Less or equal than](#tlessorequalthanvalidator) | [Greater or equal than](#tgreaterorequalthanvalidator) | [At least one alpha](#tatleastonealphavalidator) |
37+
| [At least one lower alpha](#tatleastoneloweralphavalidator) | [At least one upper alpha](#tatleastoneupperalphavalidator) | [At least one digit](#tatleastonedigitvalidator) |
38+
| [At least one symbol](#tatleastonesymbolvalidator) | [Mixed capitalization](#tmixedcapsvalidator) | - |
3739

3840
## Field availability
3941

@@ -693,6 +695,45 @@ rule := TAntivirusValidator.create(TNullAv.create());
693695
```
694696
This is provided to bypass antivirus scanning.
695697

698+
## Password-related validation
699+
700+
### <a name="tatleastonealphavalidator"></a>TAtLeastOneAlphaValidator
701+
702+
Validate string contains at least one alphabet character.
703+
704+
### <a name="tatleastoneloweralphavalidator"></a>TAtLeastOneLowerAlphaValidator
705+
706+
Validate string contains at least one lower case alphabet character.
707+
708+
### <a name="tatleastoneupperalphavalidator"></a>TAtLeastOneUpperAlphaValidator
709+
710+
Validate string contains at least one upper case alphabet character.
711+
712+
### <a name="tatleastonedigitvalidator"></a>TAtLeastOneDigitValidator
713+
714+
Validate string contains at least one digit character.
715+
716+
### <a name="tatleastonesymbolvalidator"></a>TAtLeastOneSymbolValidator
717+
718+
Validate string contains at least one symbol character (e.g., #$@!%^&*+-_ etc).
719+
720+
### <a name="tmixedcapsvalidator"></a>TMixedCapsValidator
721+
722+
Validate string contains at least one lower case and one upper case alphabet characters.
723+
724+
For example, following validation rules ensure that password is mandatory with minimum length of 8 characters that contains at least one lower case letter,
725+
one upper case letter, one digit character and one symbol character.
726+
```
727+
passwordRule := TCompositeValidator.create([
728+
TRequiredValidator.create(),
729+
TMinLengthValidator.create(8),
730+
TAtLeastOneAlphaValidator.create(TRegex.create()),
731+
TAtLeastOneDigitValidator.create(TRegex.create()),
732+
TAtLeastOneSymbolValidator.create(TRegex.create()),
733+
TMixedCapsValidator.create(TRegex.create())
734+
]);
735+
```
736+
696737
## Miscellaneous
697738

698739
### <a name="tcompositevalidator"></a>TCompositeValidator
@@ -704,7 +745,7 @@ rule := TCompositeValidator.create([
704745
TRequiredValidator.create(),
705746
TAlphaNumDashValidator.create(TRegex.create()),
706747
TMinLengthValidator.create(8),
707-
TMaxLengthValidator.create(10),
748+
TMaxLengthValidator.create(10)
708749
]);
709750
```
710751

@@ -719,7 +760,7 @@ rule := TCollectiveValidator.create([
719760
TRequiredValidator.create(),
720761
TAlphaNumDashValidator.create(TRegex.create()),
721762
TMinLengthValidator.create(8),
722-
TMaxLengthValidator.create(10),
763+
TMaxLengthValidator.create(10)
723764
]);
724765
```
725766

@@ -732,7 +773,7 @@ rule := TOrValidator.create([
732773
TRequiredValidator.create(),
733774
TAlphaNumDashValidator.create(TRegex.create()),
734775
TMinLengthValidator.create(8),
735-
TMaxLengthValidator.create(10),
776+
TMaxLengthValidator.create(10)
736777
]);
737778
```
738779

@@ -749,7 +790,7 @@ rule := TAndValidator.create([
749790
TRequiredValidator.create(),
750791
TAlphaNumDashValidator.create(TRegex.create()),
751792
TMinLengthValidator.create(8),
752-
TMaxLengthValidator.create(10),
793+
TMaxLengthValidator.create(10)
753794
]);
754795
```
755796

security/form-validation/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ Please note that `lastValidationResult()` return last validation status so, abov
206206

207207
`lastValidationResult()` method is provided so developer can execute validation in middleware and later in controller inspects last validation status and act accordingly.
208208

209-
## <a name="built-in-validation-rule"></a>Built-in validation rule
209+
## <a name="built-in-validation-rule"></a>Built-in validation rules
210210

211211
Fano Framework comes with several built-in validation rules, some are validation rule mentioned in above code example. Read [Built-in Validation Rules](/security/form-validation/built-in-validation-rules) for more information.
212212

213-
## Writing your own validation rule
213+
## <a name="writing-your-own-validation-rule"></a>Writing your own validation rule
214214

215215
If built-in validation rules do not meet your requirement, you can create your own validation rule by creating class that implements `IValidator`.
216216

0 commit comments

Comments
 (0)