Attributes.pm 110 KB
Newer Older
Xavier Guimard's avatar
Xavier Guimard committed
1
# This file is generated by Lemonldap::NG::Manager::Build. Don't modify it by hand
2 3
package Lemonldap::NG::Manager::Attributes;

Xavier Guimard's avatar
Xavier Guimard committed
4
our $VERSION = '2.0.2';
5 6 7

sub types {
    return {
8 9 10
        'array' => {
            'test' => sub {
                1;
11
            }
12
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
13 14 15
        'authParamsText' => {
            'test' => sub {
                1;
16
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
17 18 19 20
        },
        'blackWhiteList' => {
            'test' => sub {
                1;
21
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
22 23 24
        },
        'bool' => {
            'msgFail' => '__notABoolean__',
25
            'test'    => qr/^[01]$/
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
26 27 28 29 30
        },
        'boolOrExpr' => {
            'msgFail' => '__notAValidPerlExpression__',
            'test'    => sub {
                my ( $val, $conf ) = @_;
31 32
                my $s = '';
                'Safe'->new->reval("BEGIN { warnings->unimport; } $s $val");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
33 34 35 36 37 38
                my $err = join(
                    '',
                    grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                        split( /\n/, $@, 0 ) )
                );
                return $err ? ( 1, "__badExpression__: $err" ) : 1;
39
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
40 41 42 43
        },
        'catAndAppList' => {
            'test' => sub {
                1;
44
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
45 46 47 48
        },
        'file' => {
            'test' => sub {
                1;
49
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
50 51 52 53 54
        },
        'hostname' => {
            'form'    => 'text',
            'msgFail' => '__badHostname__',
            'test' =>
55
qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)))?$/
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
56 57 58
        },
        'int' => {
            'msgFail' => '__notAnInteger__',
59
            'test'    => qr/^\-?\d+$/
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
60 61
        },
        'keyText' => {
62
            'keyTest' => qr/^[a-zA-Z0-9_]+$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
63
            'msgFail' => '__badValue__',
64
            'test'    => qr/^.*$/
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
65 66 67
        },
        'keyTextContainer' => {
            'keyMsgFail' => '__badKeyName__',
68
            'keyTest'    => qr/^\w[\w\.\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
69
            'msgFail'    => '__emptyValueNotAllowed__',
70
            'test'       => qr/./
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
71 72 73 74 75 76
        },
        'lmAttrOrMacro' => {
            'form' => 'text',
            'test' => sub {
                my ( $val, $conf ) = @_;
                return 1
77
                  if defined $conf->{'macros'}{$val} or $val eq '_timezone';
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
78 79
                foreach $_ ( keys %$conf ) {
                    return 1
80
                      if $_ =~ /exportedvars$/i and defined $conf->{$_}{$val};
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
81 82
                }
                return 1, "__unknownAttrOrMacro__: $val";
83
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
84 85 86 87
        },
        'longtext' => {
            'test' => sub {
                1;
88
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
89 90 91 92
        },
        'menuApp' => {
            'test' => sub {
                1;
93
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
94 95 96 97
        },
        'menuCat' => {
            'test' => sub {
                1;
98
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
99 100 101 102
        },
        'oidcmetadatajson' => {
            'test' => sub {
                1;
103
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
104 105 106 107
        },
        'oidcmetadatajwks' => {
            'test' => sub {
                1;
108
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
109 110 111 112
        },
        'oidcOPMetaDataNode' => {
            'test' => sub {
                1;
113
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
114 115 116 117
        },
        'oidcRPMetaDataNode' => {
            'test' => sub {
                1;
118
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
119 120 121 122 123
        },
        'password' => {
            'msgFail' => '__malformedValue__',
            'test'    => sub {
                1;
124
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
125 126 127 128 129 130 131 132 133 134
        },
        'pcre' => {
            'form' => 'text',
            'test' => sub {
                eval {
                    do {
                        qr/$_[0]/;
                      }
                };
                return $@ ? ( 0, "__badRegexp__: $@" ) : 1;
135
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
136 137 138 139
        },
        'PerlModule' => {
            'form'    => 'text',
            'msgFail' => '__badPerlPackageName__',
140
            'test'    => qr/^[a-zA-Z][a-zA-Z0-9]*(?:::[a-zA-Z][a-zA-Z0-9]*)*$/
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
141 142 143 144
        },
        'portalskin' => {
            'test' => sub {
                1;
145
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
146 147 148 149
        },
        'portalskinbackground' => {
            'test' => sub {
                1;
150
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
151 152 153 154
        },
        'post' => {
            'test' => sub {
                1;
155
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
156 157 158 159
        },
        'RSAPrivateKey' => {
            'test' => sub {
                return $_[0] =~
160
m[^(?:(?:\-+\s*BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY\s*\-+\r?\n)?(?:Proc-Type:.*\r?\nDEK-Info:.*\r?\n[\r\n]*)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\n\-+\s*END\s+(?:RSA\s+)PRIVATE\s+KEY\s*\-+)?[\r\n]*)?$]s
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
161 162
                  ? 1
                  : ( 1, '__badPemEncoding__' );
163
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
164 165 166 167 168 169 170
        },
        'RSAPublicKey' => {
            'test' => sub {
                return $_[0] =~
m[^(?:(?:\-+\s*BEGIN\s+PUBLIC\s+KEY\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\n\-+\s*END\s+PUBLIC\s+KEY\s*\-+)?[\r\n]*)?$]s
                  ? 1
                  : ( 1, '__badPemEncoding__' );
171
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
172 173 174 175 176 177 178
        },
        'RSAPublicKeyOrCertificate' => {
            'test' => sub {
                return $_[0] =~
m[^(?:(?:\-+\s*BEGIN\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+\r?\n)?[a-zA-Z0-9/\+\r\n]+={0,2}(?:\r?\n\-+\s*END\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+)?[\r\n]*)?$]s
                  ? 1
                  : ( 1, '__badPemEncoding__' );
179
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
180 181 182 183
        },
        'rule' => {
            'test' => sub {
                1;
184
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
185 186 187 188
        },
        'samlAssertion' => {
            'test' => sub {
                1;
189
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
190 191 192 193
        },
        'samlAttribute' => {
            'test' => sub {
                1;
194
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
195 196 197 198
        },
        'samlIDPMetaDataNode' => {
            'test' => sub {
                1;
199
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
200 201 202 203
        },
        'samlService' => {
            'test' => sub {
                1;
204
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
205 206 207 208
        },
        'samlSPMetaDataNode' => {
            'test' => sub {
                1;
209
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
210 211 212 213 214
        },
        'select' => {
            'test' => sub {
                my $test =
                  grep( { $_ eq $_[0]; }
215
                    map( { $_->{'k'}; } @{ $_[2]{'select'}; } ) );
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
216 217 218
                return $test
                  ? 1
                  : ( 1, "Invalid value '$_[0]' for this select" );
219
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
220 221
        },
        'subContainer' => {
222
            'keyTest' => qr/\w/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
223 224
            'test'    => sub {
                1;
225
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
226 227 228 229 230
        },
        'text' => {
            'msgFail' => '__malformedValue__',
            'test'    => sub {
                1;
231
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
232 233 234
        },
        'trool' => {
            'msgFail' => '__authorizedValues__: -1, 0, 1',
235
            'test'    => qr/^(?:-1|0|1)$/
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
236 237 238 239 240
        },
        'url' => {
            'form'    => 'text',
            'msgFail' => '__badUrl__',
            'test' =>
241
qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)))(?::(?:(?:[0-9]*)))?(?:\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*)(?:\/(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*))*))(?:[?](?:(?:(?:[;\/?:@&=+\$,a-zA-Z0-9\-_.!~*'()]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)))?))?)/
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
        }
    };
}

sub attributes {
    return {
        'activeTimer' => {
            'default' => 1,
            'type'    => 'bool'
        },
        'ADPwdExpireWarning' => {
            'default' => 0,
            'type'    => 'int'
        },
        'ADPwdMaxAge' => {
            'default' => 0,
            'type'    => 'int'
        },
        'apacheAuthnLevel' => {
            'default' => 4,
            'type'    => 'int'
        },
        'applicationList' => {
            'default' => {
                'default' => {
                    'catname' => 'Default category',
                    'type'    => 'category'
                }
            },
271
            'keyTest' => qr/\w/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
272 273 274 275
            'type'    => 'catAndAppList'
        },
        'authChoiceModules' => {
            'keyMsgFail' => '__badChoiceKey__',
276
            'keyTest'    => qr/^(\d*)?[a-zA-Z0-9_]+$/,
Xavier Guimard's avatar
Xavier Guimard committed
277
            'select'     => [ [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
278 279
                        'k' => 'Apache',
                        'v' => 'Apache'
280
                    },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
281 282 283
                    {
                        'k' => 'AD',
                        'v' => 'Active Directory'
284
                    },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
285 286 287
                    {
                        'k' => 'CAS',
                        'v' => 'Central Authentication Service (CAS)'
288
                    },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
289 290 291
                    {
                        'k' => 'DBI',
                        'v' => 'Database (DBI)'
Xavier Guimard's avatar
Xavier Guimard committed
292
                    },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
293 294 295
                    {
                        'k' => 'Demo',
                        'v' => 'Demo'
296
                    },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
297 298 299
                    {
                        'k' => 'Facebook',
                        'v' => 'Facebook'
300
                    },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
301
                    {
302 303
                        'k' => 'GPG',
                        'v' => 'GPG'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
304 305 306 307 308 309 310 311 312
                    },
                    {
                        'k' => 'Kerberos',
                        'v' => 'Kerberos'
                    },
                    {
                        'k' => 'LDAP',
                        'v' => 'LDAP'
                    },
313 314 315 316
                    {
                        'k' => 'LinkedIn',
                        'v' => 'LinkedIn'
                    },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
                    {
                        'k' => 'PAM',
                        'v' => 'PAM'
                    },
                    {
                        'k' => 'Null',
                        'v' => 'None'
                    },
                    {
                        'k' => 'OpenID',
                        'v' => 'OpenID'
                    },
                    {
                        'k' => 'OpenIDConnect',
                        'v' => 'OpenID Connect'
                    },
                    {
                        'k' => 'Proxy',
                        'v' => 'Proxy'
                    },
                    {
                        'k' => 'Radius',
                        'v' => 'Radius'
                    },
                    {
                        'k' => 'REST',
                        'v' => 'REST'
                    },
                    {
                        'k' => 'Remote',
                        'v' => 'Remote'
                    },
                    {
                        'k' => 'SAML',
                        'v' => 'SAML v2'
                    },
                    {
                        'k' => 'Slave',
                        'v' => 'Slave'
                    },
                    {
                        'k' => 'SSL',
                        'v' => 'SSL'
                    },
                    {
                        'k' => 'Twitter',
                        'v' => 'Twitter'
                    },
                    {
                        'k' => 'WebID',
                        'v' => 'WebID'
                    },
                    {
                        'k' => 'Custom',
                        'v' => 'customModule'
                    }
                ],
Xavier Guimard's avatar
Xavier Guimard committed
374
                [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438
                        'k' => 'AD',
                        'v' => 'Active Directory'
                    },
                    {
                        'k' => 'CAS',
                        'v' => 'Central Authentication Service (CAS)'
                    },
                    {
                        'k' => 'DBI',
                        'v' => 'Database (DBI)'
                    },
                    {
                        'k' => 'Demo',
                        'v' => 'Demo'
                    },
                    {
                        'k' => 'Facebook',
                        'v' => 'Facebook'
                    },
                    {
                        'k' => 'LDAP',
                        'v' => 'LDAP'
                    },
                    {
                        'k' => 'Null',
                        'v' => 'None'
                    },
                    {
                        'k' => 'OpenID',
                        'v' => 'OpenID'
                    },
                    {
                        'k' => 'OpenIDConnect',
                        'v' => 'OpenID Connect'
                    },
                    {
                        'k' => 'Proxy',
                        'v' => 'Proxy'
                    },
                    {
                        'k' => 'REST',
                        'v' => 'REST'
                    },
                    {
                        'k' => 'Remote',
                        'v' => 'Remote'
                    },
                    {
                        'k' => 'SAML',
                        'v' => 'SAML v2'
                    },
                    {
                        'k' => 'Slave',
                        'v' => 'Slave'
                    },
                    {
                        'k' => 'WebID',
                        'v' => 'WebID'
                    },
                    {
                        'k' => 'Custom',
                        'v' => 'customModule'
                    }
                ],
Xavier Guimard's avatar
Xavier Guimard committed
439
                [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457
                        'k' => 'AD',
                        'v' => 'Active Directory'
                    },
                    {
                        'k' => 'DBI',
                        'v' => 'Database (DBI)'
                    },
                    {
                        'k' => 'Demo',
                        'v' => 'Demo'
                    },
                    {
                        'k' => 'LDAP',
                        'v' => 'LDAP'
                    },
                    {
                        'k' => 'REST',
                        'v' => 'REST'
458
                    },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
459 460 461
                    {
                        'k' => 'Null',
                        'v' => 'None'
462
                    },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479
                    {
                        'k' => 'Custom',
                        'v' => 'customModule'
                    }
                ]
            ],
            'test' => sub {
                1;
            },
            'type' => 'authChoiceContainer'
        },
        'authChoiceParam' => {
            'default' => 'lmAuth',
            'type'    => 'text'
        },
        'authentication' => {
            'default' => 'Demo',
Xavier Guimard's avatar
Xavier Guimard committed
480
            'select'  => [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496
                    'k' => 'Apache',
                    'v' => 'Apache'
                },
                {
                    'k' => 'AD',
                    'v' => 'Active Directory'
                },
                {
                    'k' => 'DBI',
                    'v' => 'Database (DBI)'
                },
                {
                    'k' => 'Facebook',
                    'v' => 'Facebook'
                },
                {
497 498
                    'k' => 'GPG',
                    'v' => 'GPG'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
499 500 501 502 503 504 505 506 507
                },
                {
                    'k' => 'Kerberos',
                    'v' => 'Kerberos'
                },
                {
                    'k' => 'LDAP',
                    'v' => 'LDAP'
                },
508 509 510 511
                {
                    'k' => 'LinkedIn',
                    'v' => 'LinkedIn'
                },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
                {
                    'k' => 'PAM',
                    'v' => 'PAM'
                },
                {
                    'k' => 'Radius',
                    'v' => 'Radius'
                },
                {
                    'k' => 'REST',
                    'v' => 'REST'
                },
                {
                    'k' => 'SSL',
                    'v' => 'SSL'
                },
                {
                    'k' => 'Twitter',
                    'v' => 'Twitter'
                },
                {
                    'k' => 'WebID',
                    'v' => 'WebID'
                },
                {
                    'k' => 'Demo',
                    'v' => 'Demonstration'
                },
                {
                    'k' => 'Choice',
                    'v' => 'authChoice'
                },
                {
                    'k' => 'Combination',
                    'v' => 'combineMods'
                },
                {
                    'k' => 'CAS',
                    'v' => 'Central Authentication Service (CAS)'
                },
                {
                    'k' => 'OpenID',
                    'v' => 'OpenID'
                },
                {
                    'k' => 'OpenIDConnect',
                    'v' => 'OpenID Connect'
                },
                {
                    'k' => 'SAML',
                    'v' => 'SAML v2'
                },
                {
                    'k' => 'Proxy',
                    'v' => 'Proxy'
                },
                {
                    'k' => 'Remote',
                    'v' => 'Remote'
                },
                {
                    'k' => 'Slave',
                    'v' => 'Slave'
                },
                {
                    'k' => 'Null',
                    'v' => 'None'
                },
                {
                    'k' => 'Custom',
                    'v' => 'customModule'
                }
            ],
            'type' => 'select'
        },
        'AuthLDAPFilter' => {
            'type' => 'text'
        },
590 591 592
        'autoSigninRules' => {
            'type' => 'keyTextContainer'
        },
593
        'available2F' => {
594
            'default' => 'UTOTP,TOTP,U2F,REST,Mail2F,Ext2F,Yubikey',
595
            'type'    => 'text'
596 597
        },
        'available2FSelfRegistration' => {
598 599
            'default' => 'TOTP,U2F,Yubikey',
            'type'    => 'text'
600
        },
601
        'bruteForceProtection' => {
602
            'default' => 0,
603 604
            'type'    => 'bool'
        },
605 606 607 608
        'bruteForceProtectionMaxAge' => {
            'default' => 300,
            'type'    => 'int'
        },
609 610 611 612
        'bruteForceProtectionMaxFailed' => {
            'default' => 3,
            'type'    => 'int'
        },
613 614 615 616
        'bruteForceProtectionTempo' => {
            'default' => 30,
            'type'    => 'int'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
        'captcha_login_enabled' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'captcha_mail_enabled' => {
            'default' => 1,
            'type'    => 'bool'
        },
        'captcha_register_enabled' => {
            'default' => 1,
            'type'    => 'bool'
        },
        'captcha_size' => {
            'default' => 6,
            'type'    => 'int'
        },
        'casAccessControlPolicy' => {
            'default' => 'none',
Xavier Guimard's avatar
Xavier Guimard committed
635
            'select'  => [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666
                    'k' => 'none',
                    'v' => 'None'
                },
                {
                    'k' => 'error',
                    'v' => 'Display error on portal'
                },
                {
                    'k' => 'faketicket',
                    'v' => 'Send a fake service ticket'
                }
            ],
            'type' => 'select'
        },
        'casAppMetaDataExportedVars' => {
            'default' => {
                'cn'   => 'cn',
                'mail' => 'mail',
                'uid'  => 'uid'
            },
            'type' => 'keyTextContainer'
        },
        'casAppMetaDataNodes' => {
            'type' => 'casAppMetaDataNodeContainer'
        },
        'casAppMetaDataOptions' => {
            'type' => 'subContainer'
        },
        'casAppMetaDataOptionsRule' => {
            'test' => sub {
                my ( $val, $conf ) = @_;
667 668
                my $s = '';
                'Safe'->new->reval("BEGIN { warnings->unimport; } $s $val");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708
                my $err = join(
                    '',
                    grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                        split( /\n/, $@, 0 ) )
                );
                return $err ? ( 1, "__badExpression__: $err" ) : 1;
            },
            'type' => 'text'
        },
        'casAppMetaDataOptionsService' => {
            'type' => 'url'
        },
        'casAttr' => {
            'type' => 'text'
        },
        'casAttributes' => {
            'type' => 'keyTextContainer'
        },
        'casAuthnLevel' => {
            'default' => 1,
            'type'    => 'int'
        },
        'casSrvMetaDataExportedVars' => {
            'default' => {
                'cn'   => 'cn',
                'mail' => 'mail',
                'uid'  => 'uid'
            },
            'type' => 'keyTextContainer'
        },
        'casSrvMetaDataNodes' => {
            'type' => 'casSrvMetaDataNodeContainer'
        },
        'casSrvMetaDataOptions' => {
            'type' => 'subContainer'
        },
        'casSrvMetaDataOptionsDisplayName' => {
            'type' => 'text'
        },
        'casSrvMetaDataOptionsGateway' => {
709 710
            'default' => 0,
            'type'    => 'bool'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
711 712 713 714 715 716
        },
        'casSrvMetaDataOptionsIcon' => {
            'type' => 'text'
        },
        'casSrvMetaDataOptionsProxiedServices' => {
            'keyMsgFail' => '__badCasProxyId__',
717
            'keyTest'    => qr/^\w/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
718 719 720
            'type'       => 'keyTextContainer'
        },
        'casSrvMetaDataOptionsRenew' => {
721 722
            'default' => 0,
            'type'    => 'bool'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
723 724 725 726
        },
        'casSrvMetaDataOptionsUrl' => {
            'msgFail' => '__badUrl__',
            'test' =>
727
qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)))(?::(?:(?:[0-9]*)))?(?:\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*)(?:\/(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*))*))(?:[?](?:(?:(?:[;\/?:@&=+\$,a-zA-Z0-9\-_.!~*'()]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)))?))?)/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758
            'type' => 'text'
        },
        'casStorage' => {
            'type' => 'PerlModule'
        },
        'casStorageOptions' => {
            'type' => 'keyTextContainer'
        },
        'cda' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'cfgAuthor' => {
            'type' => 'text'
        },
        'cfgAuthorIP' => {
            'type' => 'text'
        },
        'cfgDate' => {
            'type' => 'int'
        },
        'cfgLog' => {
            'type' => 'longtext'
        },
        'cfgNum' => {
            'default' => 0,
            'type'    => 'int'
        },
        'cfgVersion' => {
            'type' => 'text'
        },
759
        'checkState' => {
760 761
            'default' => 0,
            'type'    => 'bool'
762 763 764 765
        },
        'checkStateSecret' => {
            'type' => 'text'
        },
766 767 768 769
        'checkTime' => {
            'default' => 600,
            'type'    => 'int'
        },
770
        'checkUser' => {
771 772 773 774 775 776 777 778 779
            'default' => 0,
            'type'    => 'bool'
        },
        'checkUserDisplayEmptyValues' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'checkUserDisplayPersistentInfo' => {
            'default' => 0,
780 781
            'type'    => 'bool'
        },
782
        'checkUserHiddenAttributes' => {
783
            'default' => '_2fDevices _loginHistory hGroups',
784 785
            'type'    => 'text'
        },
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800
        'checkUserIdRule' => {
            'default' => 1,
            'test'    => sub {
                my ( $val, $conf ) = @_;
                my $s = '';
                'Safe'->new->reval("BEGIN { warnings->unimport; } $s $val");
                my $err = join(
                    '',
                    grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                        split( /\n/, $@, 0 ) )
                );
                return $err ? ( 1, "__badExpression__: $err" ) : 1;
            },
            'type' => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
801 802 803 804 805 806 807 808
        'checkXSS' => {
            'default' => 1,
            'type'    => 'bool'
        },
        'combination' => {
            'type' => 'text'
        },
        'combModules' => {
809
            'keyTest' => qr/^\w+$/,
Xavier Guimard's avatar
Xavier Guimard committed
810
            'select'  => [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826
                    'k' => 'Apache',
                    'v' => 'Apache'
                },
                {
                    'k' => 'AD',
                    'v' => 'Active Directory'
                },
                {
                    'k' => 'DBI',
                    'v' => 'Database (DBI)'
                },
                {
                    'k' => 'Facebook',
                    'v' => 'Facebook'
                },
                {
827 828
                    'k' => 'GPG',
                    'v' => 'GPG'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
829 830 831 832 833 834 835 836 837
                },
                {
                    'k' => 'Kerberos',
                    'v' => 'Kerberos'
                },
                {
                    'k' => 'LDAP',
                    'v' => 'LDAP'
                },
838 839 840 841
                {
                    'k' => 'LinkedIn',
                    'v' => 'LinkedIn'
                },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911
                {
                    'k' => 'PAM',
                    'v' => 'PAM'
                },
                {
                    'k' => 'Radius',
                    'v' => 'Radius'
                },
                {
                    'k' => 'REST',
                    'v' => 'REST'
                },
                {
                    'k' => 'SSL',
                    'v' => 'SSL'
                },
                {
                    'k' => 'Twitter',
                    'v' => 'Twitter'
                },
                {
                    'k' => 'WebID',
                    'v' => 'WebID'
                },
                {
                    'k' => 'Demo',
                    'v' => 'Demonstration'
                },
                {
                    'k' => 'CAS',
                    'v' => 'Central Authentication Service (CAS)'
                },
                {
                    'k' => 'OpenID',
                    'v' => 'OpenID'
                },
                {
                    'k' => 'OpenIDConnect',
                    'v' => 'OpenID Connect'
                },
                {
                    'k' => 'SAML',
                    'v' => 'SAML v2'
                },
                {
                    'k' => 'Proxy',
                    'v' => 'Proxy'
                },
                {
                    'k' => 'Remote',
                    'v' => 'Remote'
                },
                {
                    'k' => 'Slave',
                    'v' => 'Slave'
                },
                {
                    'k' => 'Null',
                    'v' => 'None'
                },
                {
                    'k' => 'Custom',
                    'v' => 'customModule'
                }
            ],
            'test' => sub {
                1;
            },
            'type' => 'cmbModuleContainer'
        },
Xavier Guimard's avatar
Xavier Guimard committed
912 913 914
        'configStorage' => {
            'type' => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
915 916
        'confirmFormMethod' => {
            'default' => 'post',
Xavier Guimard's avatar
Xavier Guimard committed
917
            'select'  => [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
918 919 920 921 922 923 924 925 926 927 928
                    'k' => 'get',
                    'v' => 'GET'
                },
                {
                    'k' => 'post',
                    'v' => 'POST'
                }
            ],
            'type' => 'select'
        },
        'cookieExpiration' => {
929
            'type' => 'int'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
930 931 932 933
        },
        'cookieName' => {
            'default' => 'lemonldap',
            'msgFail' => '__badCookieName__',
934
            'test'    => qr/^[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
935 936 937 938 939 940 941 942 943 944 945 946 947
            'type'    => 'text'
        },
        'cspConnect' => {
            'default' => '\'self\'',
            'type'    => 'text'
        },
        'cspDefault' => {
            'default' => '\'self\'',
            'type'    => 'text'
        },
        'cspFont' => {
            'default' => '\'self\'',
            'type'    => 'text'
948 949
        },
        'cspFormAction' => {
950
            'default' => '\'self\'',
951
            'type'    => 'text'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972
        },
        'cspImg' => {
            'default' => '\'self\' data:',
            'type'    => 'text'
        },
        'cspScript' => {
            'default' => '\'self\'',
            'type'    => 'text'
        },
        'cspStyle' => {
            'default' => '\'self\'',
            'type'    => 'text'
        },
        'customAddParams' => {
            'type' => 'keyTextContainer'
        },
        'customAuth' => {
            'type' => 'text'
        },
        'customFunctions' => {
            'msgFail' => '__badCustomFuncName__',
973
            'test'    => qr/^(?:\w+(?:::\w+)*(?:\s+\w+(?:::\w+)*)*)?$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024
            'type'    => 'text'
        },
        'customPassword' => {
            'type' => 'text'
        },
        'customRegister' => {
            'type' => 'text'
        },
        'customUserDB' => {
            'type' => 'text'
        },
        'dbiAuthChain' => {
            'type' => 'text'
        },
        'dbiAuthLoginCol' => {
            'type' => 'text'
        },
        'dbiAuthnLevel' => {
            'default' => 2,
            'type'    => 'int'
        },
        'dbiAuthPassword' => {
            'type' => 'password'
        },
        'dbiAuthPasswordCol' => {
            'type' => 'text'
        },
        'dbiAuthPasswordHash' => {
            'type' => 'text'
        },
        'dbiAuthTable' => {
            'type' => 'text'
        },
        'dbiAuthUser' => {
            'type' => 'text'
        },
        'dbiDynamicHashEnabled' => {
            'type' => 'bool'
        },
        'dbiDynamicHashNewPasswordScheme' => {
            'type' => 'text'
        },
        'dbiDynamicHashValidSaltedSchemes' => {
            'type' => 'text'
        },
        'dbiDynamicHashValidSchemes' => {
            'type' => 'text'
        },
        'dbiExportedVars' => {
            'default'    => {},
            'keyMsgFail' => '__badVariableName__',
1025
            'keyTest'    => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1026
            'msgFail'    => '__badValue__',
1027
            'test'       => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051
            'type'       => 'keyTextContainer'
        },
        'dbiPasswordMailCol' => {
            'type' => 'text'
        },
        'dbiUserChain' => {
            'type' => 'text'
        },
        'dbiUserPassword' => {
            'type' => 'password'
        },
        'dbiUserTable' => {
            'type' => 'text'
        },
        'dbiUserUser' => {
            'type' => 'text'
        },
        'demoExportedVars' => {
            'default' => {
                'cn'   => 'cn',
                'mail' => 'mail',
                'uid'  => 'uid'
            },
            'keyMsgFail' => '__badVariableName__',
1052
            'keyTest'    => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1053
            'msgFail'    => '__badValue__',
1054
            'test'       => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1055 1056 1057 1058 1059 1060
            'type'       => 'keyTextContainer'
        },
        'domain' => {
            'default' => 'example.com',
            'msgFail' => '__badDomainName__',
            'test' =>
1061
qr/^(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?))?$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1062 1063 1064 1065 1066 1067 1068 1069
            'type' => 'text'
        },
        'exportedAttr' => {
            'type' => 'text'
        },
        'exportedHeaders' => {
            'keyMsgFail' => '__badHostname__',
            'keyTest' =>
1070
qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1071 1072
            'test' => {
                'keyMsgFail' => '__badHeaderName__',
1073
                'keyTest'    => qr/^(?=[^\-])[\w\-]+(?<=[^-])$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1074 1075
                'test'       => sub {
                    my ( $val, $conf ) = @_;
1076 1077
                    my $s = $val;
                    'Safe'->new->reval("BEGIN { warnings->unimport; } $s");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1078 1079 1080 1081 1082 1083
                    my $err = join(
                        '',
                        grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                            split( /\n/, $@, 0 ) )
                    );
                    return $err ? ( 1, "__badExpression__: $err" ) : 1;
1084
                }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1085 1086 1087 1088 1089 1090 1091 1092
            },
            'type' => 'keyTextContainer'
        },
        'exportedVars' => {
            'default' => {
                'UA' => 'HTTP_USER_AGENT'
            },
            'keyMsgFail' => '__badVariableName__',
1093
            'keyTest'    => qr/^!?[_a-zA-Z][a-zA-Z0-9_]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1094
            'msgFail'    => '__badValue__',
1095
            'test'       => qr/^[_a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1096 1097 1098 1099 1100 1101 1102 1103 1104
            'type'       => 'keyTextContainer'
        },
        'ext2fActivation' => {
            'default' => 0,
            'type'    => 'boolOrExpr'
        },
        'ext2fAuthnLevel' => {
            'type' => 'int'
        },
1105 1106
        'ext2fCodeActivation' => {
            'default' => '\\d{6}',
1107
            'type'    => 'pcre'
1108
        },
1109 1110 1111
        'ext2fLogo' => {
            'type' => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
        'ext2FSendCommand' => {
            'type' => 'text'
        },
        'ext2FValidateCommand' => {
            'type' => 'text'
        },
        'facebookAppId' => {
            'type' => 'text'
        },
        'facebookAppSecret' => {
            'type' => 'text'
        },
        'facebookAuthnLevel' => {
            'default' => 1,
            'type'    => 'int'
        },
        'facebookExportedVars' => {
            'default'    => {},
            'keyMsgFail' => '__badVariableName__',
1131
            'keyTest'    => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1132
            'msgFail'    => '__badValue__',
1133
            'test'       => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1134 1135
            'type'       => 'keyTextContainer'
        },
1136 1137 1138 1139
        'facebookUserField' => {
            'default' => 'id',
            'type'    => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160
        'failedLoginNumber' => {
            'default' => 5,
            'type'    => 'int'
        },
        'formTimeout' => {
            'default' => 120,
            'type'    => 'int'
        },
        'globalStorage' => {
            'default' => 'Apache::Session::File',
            'type'    => 'PerlModule'
        },
        'globalStorageOptions' => {
            'default' => {
                'Directory' => '/var/lib/lemonldap-ng/sessions/',
                'generateModule' =>
                  'Lemonldap::NG::Common::Apache::Session::Generate::SHA256',
                'LockDirectory' => '/var/lib/lemonldap-ng/sessions/lock/'
            },
            'type' => 'keyTextContainer'
        },
1161 1162 1163 1164
        'gpgDb' => {
            'default' => '',
            'type'    => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1165 1166 1167
        'grantSessionRules' => {
            'keyTest' => sub {
                my ( $val, $conf ) = @_;
1168 1169
                my $s = '';
                'Safe'->new->reval("BEGIN { warnings->unimport; } $s $val");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185
                my $err = join(
                    '',
                    grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                        split( /\n/, $@, 0 ) )
                );
                return $err ? ( 1, "__badExpression__: $err" ) : 1;
            },
            'test' => sub {
                1;
            },
            'type' => 'grantContainer'
        },
        'groups' => {
            'default' => {},
            'test'    => sub {
                my ( $val, $conf ) = @_;
1186 1187
                my $s = '';
                'Safe'->new->reval("BEGIN { warnings->unimport; } $s $val");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1188 1189 1190 1191 1192 1193 1194 1195 1196
                my $err = join(
                    '',
                    grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                        split( /\n/, $@, 0 ) )
                );
                return $err ? ( 1, "__badExpression__: $err" ) : 1;
            },
            'type' => 'keyTextContainer'
        },
1197 1198 1199 1200
        'handlerInternalCache' => {
            'default' => 15,
            'type'    => 'int'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
        'hiddenAttributes' => {
            'default' => '_password',
            'type'    => 'text'
        },
        'hideOldPassword' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'httpOnly' => {
            'default' => 1,
            'type'    => 'bool'
        },
        'https' => {
1214 1215
            'default' => -1,
            'type'    => 'trool'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1216
        },
1217
        'impersonationHiddenAttributes' => {
1218 1219 1220
            'default' => '_2fDevices _loginHistory',
            'type'    => 'text'
        },
1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235
        'impersonationIdRule' => {
            'default' => 1,
            'test'    => sub {
                my ( $val, $conf ) = @_;
                my $s = '';
                'Safe'->new->reval("BEGIN { warnings->unimport; } $s $val");
                my $err = join(
                    '',
                    grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                        split( /\n/, $@, 0 ) )
                );
                return $err ? ( 1, "__badExpression__: $err" ) : 1;
            },
            'type' => 'text'
        },
1236
        'impersonationMergeSSOgroups' => {
1237 1238 1239
            'default' => 0,
            'type'    => 'bool'
        },
1240
        'impersonationPrefix' => {
1241 1242 1243
            'default' => 'real_',
            'type'    => 'text'
        },
1244
        'impersonationRule' => {
1245
            'default' => 0,
1246 1247
            'type'    => 'boolOrExpr'
        },
1248
        'impersonationSkipEmptyValues' => {
1249 1250 1251
            'default' => 1,
            'type'    => 'bool'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1252 1253
        'infoFormMethod' => {
            'default' => 'get',
Xavier Guimard's avatar
Xavier Guimard committed
1254
            'select'  => [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277
                    'k' => 'get',
                    'v' => 'GET'
                },
                {
                    'k' => 'post',
                    'v' => 'POST'
                }
            ],
            'type' => 'select'
        },
        'issuerDBCASActivation' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'issuerDBCASPath' => {
            'default' => '^/cas/',
            'type'    => 'pcre'
        },
        'issuerDBCASRule' => {
            'default' => 1,
            'type'    => 'boolOrExpr'
        },
        'issuerDBGetActivation' => {
1278
            'default' => 0,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1279 1280 1281 1282 1283 1284
            'type'    => 'bool'
        },
        'issuerDBGetParameters' => {
            'default'    => {},
            'keyMsgFail' => '__badHostname__',
            'keyTest' =>
1285
qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1286 1287
            'test' => {
                'keyMsgFail' => '__badKeyName__',
1288
                'keyTest'    => qr/^(?=[^\-])[\w\-]+(?<=[^-])$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1289 1290 1291
                'test'       => sub {
                    my ( $val, $conf ) = @_;
                    return 1
1292
                      if defined $conf->{'macros'}{$val} or $val eq '_timezone';
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1293 1294 1295
                    foreach $_ ( keys %$conf ) {
                        return 1
                          if $_ =~ /exportedvars$/i
1296
                          and defined $conf->{$_}{$val};
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1297 1298
                    }
                    return 1, "__unknownAttrOrMacro__: $val";
1299
                }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315
            },
            'type' => 'doubleHash'
        },
        'issuerDBGetPath' => {
            'default' => '^/get/',
            'type'    => 'text'
        },
        'issuerDBGetRule' => {
            'default' => 1,
            'type'    => 'boolOrExpr'
        },
        'issuerDBOpenIDActivation' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'issuerDBOpenIDConnectActivation' => {
1316
            'default' => 0,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364
            'type'    => 'bool'
        },
        'issuerDBOpenIDConnectPath' => {
            'default' => '^/oauth2/',
            'type'    => 'text'
        },
        'issuerDBOpenIDConnectRule' => {
            'default' => 1,
            'type'    => 'boolOrExpr'
        },
        'issuerDBOpenIDPath' => {
            'default' => '^/openidserver/',
            'type'    => 'pcre'
        },
        'issuerDBOpenIDRule' => {
            'default' => 1,
            'type'    => 'boolOrExpr'
        },
        'issuerDBSAMLActivation' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'issuerDBSAMLPath' => {
            'default' => '^/saml/',
            'type'    => 'pcre'
        },
        'issuerDBSAMLRule' => {
            'default' => 1,
            'type'    => 'boolOrExpr'
        },
        'jsRedirect' => {
            'default' => 0,
            'type'    => 'boolOrExpr'
        },
        'key' => {
            'type' => 'password'
        },
        'krbAuthnLevel' => {
            'default' => 3,
            'type'    => 'int'
        },
        'krbByJs' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'krbKeytab' => {
            'type' => 'text'
        },
1365 1366 1367 1368
        'krbRemoveDomain' => {
            'default' => 1,
            'type'    => 'bool'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379
        'ldapAllowResetExpiredPassword' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'ldapAuthnLevel' => {
            'default' => 2,
            'type'    => 'int'
        },
        'ldapBase' => {
            'default' => 'dc=example,dc=com',
            'msgFail' => '__badValue__',
1380
            'test'    => qr/^(?:\w+=.*|)$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393
            'type'    => 'text'
        },
        'ldapChangePasswordAsUser' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'ldapExportedVars' => {
            'default' => {
                'cn'   => 'cn',
                'mail' => 'mail',
                'uid'  => 'uid'
            },
            'keyMsgFail' => '__badVariableName__',
1394
            'keyTest'    => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1395
            'msgFail'    => '__badValue__',
1396
            'test'       => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420
            'type'       => 'keyTextContainer'
        },
        'LDAPFilter' => {
            'type' => 'text'
        },
        'ldapGroupAttributeName' => {
            'default' => 'member',
            'type'    => 'text'
        },
        'ldapGroupAttributeNameGroup' => {
            'default' => 'dn',
            'type'    => 'text'
        },
        'ldapGroupAttributeNameSearch' => {
            'default' => 'cn',
            'type'    => 'text'
        },
        'ldapGroupAttributeNameUser' => {
            'default' => 'dn',
            'type'    => 'text'
        },
        'ldapGroupBase' => {
            'type' => 'text'
        },
1421 1422 1423 1424
        'ldapGroupDecodeSearchedValue' => {
            'default' => 0,
            'type'    => 'bool'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451
        'ldapGroupObjectClass' => {
            'default' => 'groupOfNames',
            'type'    => 'text'
        },
        'ldapGroupRecursive' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'ldapPasswordResetAttribute' => {
            'default' => 'pwdReset',
            'type'    => 'text'
        },
        'ldapPasswordResetAttributeValue' => {
            'default' => 'TRUE',
            'type'    => 'text'
        },
        'ldapPort' => {
            'default' => 389,
            'type'    => 'int'
        },
        'ldapPpolicyControl' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'ldapPwdEnc' => {
            'default' => 'utf-8',
            'msgFail' => '__badEncoding__',
1452
            'test'    => qr/^[a-zA-Z0-9_][a-zA-Z0-9_\-]*[a-zA-Z0-9_]$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1453 1454 1455 1456 1457 1458 1459
            'type'    => 'text'
        },
        'ldapRaw' => {
            'type' => 'text'
        },
        'ldapSearchDeref' => {
            'default' => 'find',
Xavier Guimard's avatar
Xavier Guimard committed
1460
            'select'  => [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482
                    'k' => 'never',
                    'v' => 'never'
                },
                {
                    'k' => 'search',
                    'v' => 'search'
                },
                {
                    'k' => 'find',
                    'v' => 'find'
                },
                {
                    'k' => 'always',
                    'v' => 'always'
                }
            ],
            'type' => 'select'
        },
        'ldapServer' => {
            'default' => 'ldap://localhost',
            'test'    => sub {
                my $l = shift();
1483
                my @s = split( /[\s,]+/, $l, 0 );
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508
                foreach my $s (@s) {
                    return 0, qq[__badLdapUri__: "$s"]
                      unless $s =~
m[^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?::\d{1,5})?/?.*)$]o;
                }
                return 1;
            },
            'type' => 'text'
        },
        'ldapSetPassword' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'ldapTimeout' => {
            'default' => 120,
            'type'    => 'int'
        },
        'ldapUsePasswordResetAttribute' => {
            'default' => 1,
            'type'    => 'bool'
        },
        'ldapVersion' => {
            'default' => 3,
            'type'    => 'int'
        },
1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530
        'linkedInAuthnLevel' => {
            'default' => 1,
            'type'    => 'int'
        },
        'linkedInClientID' => {
            'type' => 'text'
        },
        'linkedInClientSecret' => {
            'type' => 'password'
        },
        'linkedInFields' => {
            'default' => 'id,first-name,last-name,email-address',
            'type'    => 'text'
        },
        'linkedInScope' => {
            'default' => 'r_basicprofile r_emailaddress',
            'type'    => 'text'
        },
        'linkedInUserField' => {
            'default' => 'emailAddress',
            'type'    => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544
        'localSessionStorage' => {
            'default' => 'Cache::FileCache',
            'type'    => 'PerlModule'
        },
        'localSessionStorageOptions' => {
            'default' => {
                'cache_depth'        => 3,
                'cache_root'         => '/tmp',
                'default_expires_in' => 600,
                'directory_umask'    => '007',
                'namespace'          => 'lemonldap-ng-sessions'
            },
            'type' => 'keyTextContainer'
        },
Xavier Guimard's avatar
Xavier Guimard committed
1545 1546 1547 1548 1549 1550
        'localStorage' => {
            'type' => 'text'
        },
        'localStorageOptions' => {
            'type' => 'keyTextContainer'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1551 1552 1553 1554 1555 1556
        'locationRules' => {
            'default' => {
                'default' => 'deny'
            },
            'keyMsgFail' => '__badHostname__',
            'keyTest' =>
1557
qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577
            'test' => {
                'keyMsgFail' => '__badRegexp__',
                'keyTest'    => sub {
                    eval {
                        do {
                            qr/$_[0]/;
                          }
                    };
                    return $@ ? 0 : 1;
                },
                'msgFail' => '__badExpression__',
                'test'    => sub {
                    my ( $val, $conf ) = @_;
                    my $s = $val;
                    if ( $s =~ s/^logout(?:_(?:sso|app(?:_sso)?))?\s*// ) {
                        return $s =~ m[^(?:https?://.*)?$]
                          ? 1
                          : ( 0, '__badUrl__' );
                    }
                    $s =~ s/\b(accept|deny|unprotect|skip)\b/1/g;
1578
                    'Safe'->new->reval("BEGIN { warnings->unimport; } $s");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1579 1580 1581 1582 1583 1584
                    my $err = join(
                        '',
                        grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                            split( /\n/, $@, 0 ) )
                    );
                    return $err ? ( 1, "__badExpression__: $err" ) : 1;
1585
                }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1586 1587 1588
            },
            'type' => 'ruleContainer'
        },
1589 1590 1591 1592 1593 1594
        'log4perlConfFile' => {
            'type' => 'text'
        },
        'logger' => {
            'type' => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1595 1596 1597 1598
        'loginHistoryEnabled' => {
            'default' => 0,
            'type'    => 'bool'
        },
Christophe Maudoux's avatar
Christophe Maudoux committed
1599 1600 1601
        'logLevel' => {
            'type' => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614
        'logoutServices' => {
            'default' => {},
            'type'    => 'keyTextContainer'
        },
        'lwpOpts' => {
            'type' => 'keyTextContainer'
        },
        'lwpSslOpts' => {
            'type' => 'keyTextContainer'
        },
        'macros' => {
            'default'    => {},
            'keyMsgFail' => '__badMacroName__',
1615
            'keyTest'    => qr/^[_a-zA-Z][a-zA-Z0-9_]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1616 1617
            'test'       => sub {
                my ( $val, $conf ) = @_;
1618 1619
                my $s = '';
                'Safe'->new->reval("BEGIN { warnings->unimport; } $s $val");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1620 1621 1622 1623 1624 1625 1626 1627 1628
                my $err = join(
                    '',
                    grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                        split( /\n/, $@, 0 ) )
                );
                return $err ? ( 1, "__badExpression__: $err" ) : 1;
            },
            'type' => 'keyTextContainer'
        },
1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639
        'mail2fActivation' => {
            'default' => 0,
            'type'    => 'boolOrExpr'
        },
        'mail2fAuthnLevel' => {
            'type' => 'int'
        },
        'mail2fBody' => {
            'type' => 'longtext'
        },
        'mail2fCodeRegex' => {
Christophe Maudoux's avatar
Christophe Maudoux committed
1640
            'default' => '\\d{6}',
1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651
            'type'    => 'pcre'
        },
        'mail2fLogo' => {
            'type' => 'text'
        },
        'mail2fSubject' => {
            'type' => 'text'
        },
        'mail2fTimeout' => {
            'type' => 'int'
        },
1652 1653 1654
        'mailBody' => {
            'type' => 'longtext'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1655 1656 1657 1658
        'mailCharset' => {
            'default' => 'utf-8',
            'type'    => 'text'
        },
1659 1660 1661 1662 1663 1664
        'mailConfirmBody' => {
            'type' => 'longtext'
        },
        'mailConfirmSubject' => {
            'type' => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675
        'mailFrom' => {
            'default' => 'noreply@example.com',
            'type'    => 'text'
        },
        'mailLDAPFilter' => {
            'type' => 'text'
        },
        'mailOnPasswordChange' => {
            'default' => 0,
            'type'    => 'bool'
        },
1676
        'mailReplyTo' => {
1677 1678
            'type' => 'text'
        },