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

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

sub types {
    return {
8 9 10
        'array' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
11
            }
12
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
13 14 15
        'authParamsText' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
16
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
17 18 19 20
        },
        'blackWhiteList' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
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;
Christophe Maudoux's avatar
Christophe Maudoux committed
39
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
40 41 42 43
        },
        'catAndAppList' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
44
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
45 46 47 48
        },
        'file' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
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";
Christophe Maudoux's avatar
Christophe Maudoux committed
83
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
84 85 86 87
        },
        'longtext' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
88
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
89 90 91 92
        },
        'menuApp' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
93
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
94 95 96 97
        },
        'menuCat' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
98
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
99 100 101 102
        },
        'oidcmetadatajson' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
103
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
104 105 106 107
        },
        'oidcmetadatajwks' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
108
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
109 110 111 112
        },
        'oidcOPMetaDataNode' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
113
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
114 115 116 117
        },
        'oidcRPMetaDataNode' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
118
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
119 120 121 122 123
        },
        'password' => {
            'msgFail' => '__malformedValue__',
            'test'    => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
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;
Christophe Maudoux's avatar
Christophe Maudoux committed
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;
Christophe Maudoux's avatar
Christophe Maudoux committed
145
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
146 147 148 149
        },
        'portalskinbackground' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
150
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
151 152 153 154
        },
        'post' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
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__' );
Christophe Maudoux's avatar
Christophe Maudoux committed
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__' );
Christophe Maudoux's avatar
Christophe Maudoux committed
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__' );
Christophe Maudoux's avatar
Christophe Maudoux committed
179
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
180 181 182 183
        },
        'rule' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
184
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
185 186 187 188
        },
        'samlAssertion' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
189
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
190 191 192 193
        },
        'samlAttribute' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
194
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
195 196 197 198
        },
        'samlIDPMetaDataNode' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
199
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
200 201 202 203
        },
        'samlService' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
204
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
205 206 207 208
        },
        'samlSPMetaDataNode' => {
            'test' => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
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" );
Christophe Maudoux's avatar
Christophe Maudoux committed
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;
Christophe Maudoux's avatar
Christophe Maudoux committed
225
            }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
226 227 228 229 230
        },
        'text' => {
            'msgFail' => '__malformedValue__',
            'test'    => sub {
                1;
Christophe Maudoux's avatar
Christophe Maudoux committed
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_]+$/,
Yadd's avatar
Yadd 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'
Yadd's avatar
Yadd committed
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)'
Yadd's avatar
Yadd 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
                    {
Yadd's avatar
Yadd committed
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'
                    }
                ],
Yadd's avatar
Yadd 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'
                    }
                ],
Yadd's avatar
Yadd 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',
Yadd's avatar
Yadd 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'
                },
                {
Yadd's avatar
Yadd committed
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'
        },
Yadd's avatar
Yadd committed
590 591 592
        'autoSigninRules' => {
            'type' => 'keyTextContainer'
        },
Yadd's avatar
Yadd committed
593
        'available2F' => {
Maxime Besson's avatar
Maxime Besson committed
594
            'default' => 'UTOTP,TOTP,U2F,REST,Mail2F,Ext2F,Yubikey',
595
            'type'    => 'text'
Yadd's avatar
Yadd committed
596 597
        },
        'available2FSelfRegistration' => {
598 599
            'default' => 'TOTP,U2F,Yubikey',
            'type'    => 'text'
Yadd's avatar
Yadd committed
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',
Yadd's avatar
Yadd 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' => {
Christophe Maudoux's avatar
Christophe Maudoux committed
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' => {
Christophe Maudoux's avatar
Christophe Maudoux committed
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'
        },
Yadd's avatar
Yadd committed
759
        'checkState' => {
760 761
            'default' => 0,
            'type'    => 'bool'
Yadd's avatar
Yadd committed
762 763 764 765
        },
        'checkStateSecret' => {
            'type' => 'text'
        },
Yadd's avatar
Yadd committed
766 767 768 769
        'checkTime' => {
            'default' => 600,
            'type'    => 'int'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
770 771 772 773 774 775 776 777
        'checkXSS' => {
            'default' => 1,
            'type'    => 'bool'
        },
        'combination' => {
            'type' => 'text'
        },
        'combModules' => {
778
            'keyTest' => qr/^\w+$/,
Yadd's avatar
Yadd committed
779
            'select'  => [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795
                    'k' => 'Apache',
                    'v' => 'Apache'
                },
                {
                    'k' => 'AD',
                    'v' => 'Active Directory'
                },
                {
                    'k' => 'DBI',
                    'v' => 'Database (DBI)'
                },
                {
                    'k' => 'Facebook',
                    'v' => 'Facebook'
                },
                {
Yadd's avatar
Yadd committed
796 797
                    'k' => 'GPG',
                    'v' => 'GPG'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 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
                },
                {
                    'k' => 'Kerberos',
                    'v' => 'Kerberos'
                },
                {
                    'k' => 'LDAP',
                    'v' => 'LDAP'
                },
                {
                    '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'
        },
Yadd's avatar
Yadd committed
877 878 879
        'configStorage' => {
            'type' => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
880 881
        'confirmFormMethod' => {
            'default' => 'post',
Yadd's avatar
Yadd committed
882
            'select'  => [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
883 884 885 886 887 888 889 890 891 892 893
                    'k' => 'get',
                    'v' => 'GET'
                },
                {
                    'k' => 'post',
                    'v' => 'POST'
                }
            ],
            'type' => 'select'
        },
        'cookieExpiration' => {
894
            'type' => 'int'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
895 896 897 898
        },
        'cookieName' => {
            'default' => 'lemonldap',
            'msgFail' => '__badCookieName__',
899
            'test'    => qr/^[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
900 901 902 903 904 905 906 907 908 909 910 911 912
            'type'    => 'text'
        },
        'cspConnect' => {
            'default' => '\'self\'',
            'type'    => 'text'
        },
        'cspDefault' => {
            'default' => '\'self\'',
            'type'    => 'text'
        },
        'cspFont' => {
            'default' => '\'self\'',
            'type'    => 'text'
913 914
        },
        'cspFormAction' => {
915
            'default' => '\'self\'',
916
            'type'    => 'text'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937
        },
        '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__',
938
            'test'    => qr/^(?:\w+(?:::\w+)*(?:\s+\w+(?:::\w+)*)*)?$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989
            '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__',
990
            'keyTest'    => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
991
            'msgFail'    => '__badValue__',
992
            'test'       => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
            '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__',
1017
            'keyTest'    => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1018
            'msgFail'    => '__badValue__',
1019
            'test'       => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1020 1021 1022 1023 1024 1025
            'type'       => 'keyTextContainer'
        },
        'domain' => {
            'default' => 'example.com',
            'msgFail' => '__badDomainName__',
            'test' =>
1026
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
1027 1028 1029 1030 1031 1032 1033 1034
            'type' => 'text'
        },
        'exportedAttr' => {
            'type' => 'text'
        },
        'exportedHeaders' => {
            'keyMsgFail' => '__badHostname__',
            'keyTest' =>
Yadd's avatar
Yadd committed
1035
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
1036 1037
            'test' => {
                'keyMsgFail' => '__badHeaderName__',
1038
                'keyTest'    => qr/^(?=[^\-])[\w\-]+(?<=[^-])$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1039 1040
                'test'       => sub {
                    my ( $val, $conf ) = @_;
1041 1042
                    my $s = $val;
                    'Safe'->new->reval("BEGIN { warnings->unimport; } $s");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1043 1044 1045 1046 1047 1048
                    my $err = join(
                        '',
                        grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                            split( /\n/, $@, 0 ) )
                    );
                    return $err ? ( 1, "__badExpression__: $err" ) : 1;
Christophe Maudoux's avatar
Christophe Maudoux committed
1049
                }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1050 1051 1052 1053 1054 1055 1056 1057
            },
            'type' => 'keyTextContainer'
        },
        'exportedVars' => {
            'default' => {
                'UA' => 'HTTP_USER_AGENT'
            },
            'keyMsgFail' => '__badVariableName__',
1058
            'keyTest'    => qr/^!?[_a-zA-Z][a-zA-Z0-9_]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1059
            'msgFail'    => '__badValue__',
1060
            'test'       => qr/^[_a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1061 1062 1063 1064 1065 1066 1067 1068 1069
            'type'       => 'keyTextContainer'
        },
        'ext2fActivation' => {
            'default' => 0,
            'type'    => 'boolOrExpr'
        },
        'ext2fAuthnLevel' => {
            'type' => 'int'
        },
Christophe Maudoux's avatar
Christophe Maudoux committed
1070 1071
        'ext2fCodeActivation' => {
            'default' => '\\d{6}',
1072
            'type'    => 'pcre'
Christophe Maudoux's avatar
Christophe Maudoux committed
1073
        },
1074 1075 1076
        'ext2fLogo' => {
            'type' => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095
        'ext2FSendCommand' => {
            'type' => 'text'
        },
        'ext2FValidateCommand' => {
            'type' => 'text'
        },
        'facebookAppId' => {
            'type' => 'text'
        },
        'facebookAppSecret' => {
            'type' => 'text'
        },
        'facebookAuthnLevel' => {
            'default' => 1,
            'type'    => 'int'
        },
        'facebookExportedVars' => {
            'default'    => {},
            'keyMsgFail' => '__badVariableName__',
1096
            'keyTest'    => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1097
            'msgFail'    => '__badValue__',
1098
            'test'       => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1099 1100
            'type'       => 'keyTextContainer'
        },
1101 1102 1103 1104
        'facebookUserField' => {
            'default' => 'id',
            'type'    => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
        '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'
        },
Yadd's avatar
Yadd committed
1126 1127 1128 1129
        'gpgDb' => {
            'default' => '',
            'type'    => 'text'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1130 1131 1132
        'grantSessionRules' => {
            'keyTest' => sub {
                my ( $val, $conf ) = @_;
1133 1134
                my $s = '';
                'Safe'->new->reval("BEGIN { warnings->unimport; } $s $val");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
                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 ) = @_;
1151 1152
                my $s = '';
                'Safe'->new->reval("BEGIN { warnings->unimport; } $s $val");
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1153 1154 1155 1156 1157 1158 1159 1160 1161
                my $err = join(
                    '',
                    grep( { $_ =~ /Undefined subroutine/ ? () : $_; }
                        split( /\n/, $@, 0 ) )
                );
                return $err ? ( 1, "__badExpression__: $err" ) : 1;
            },
            'type' => 'keyTextContainer'
        },
1162 1163 1164 1165
        'handlerInternalCache' => {
            'default' => 15,
            'type'    => 'int'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178
        'hiddenAttributes' => {
            'default' => '_password',
            'type'    => 'text'
        },
        'hideOldPassword' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'httpOnly' => {
            'default' => 1,
            'type'    => 'bool'
        },
        'https' => {
1179 1180
            'default' => -1,
            'type'    => 'trool'
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1181 1182 1183
        },
        'infoFormMethod' => {
            'default' => 'get',
Yadd's avatar
Yadd committed
1184
            'select'  => [ {
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207
                    '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' => {
Yadd's avatar
Yadd committed
1208
            'default' => 0,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1209 1210 1211 1212 1213 1214
            'type'    => 'bool'
        },
        'issuerDBGetParameters' => {
            'default'    => {},
            'keyMsgFail' => '__badHostname__',
            'keyTest' =>
1215
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
1216 1217
            'test' => {
                'keyMsgFail' => '__badKeyName__',
1218
                'keyTest'    => qr/^(?=[^\-])[\w\-]+(?<=[^-])$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1219 1220 1221
                'test'       => sub {
                    my ( $val, $conf ) = @_;
                    return 1
1222
                      if defined $conf->{'macros'}{$val} or $val eq '_timezone';
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1223 1224 1225
                    foreach $_ ( keys %$conf ) {
                        return 1
                          if $_ =~ /exportedvars$/i
1226
                          and defined $conf->{$_}{$val};
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1227 1228
                    }
                    return 1, "__unknownAttrOrMacro__: $val";
Christophe Maudoux's avatar
Christophe Maudoux committed
1229
                }
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245
            },
            'type' => 'doubleHash'
        },
        'issuerDBGetPath' => {
            'default' => '^/get/',
            'type'    => 'text'
        },
        'issuerDBGetRule' => {
            'default' => 1,
            'type'    => 'boolOrExpr'
        },
        'issuerDBOpenIDActivation' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'issuerDBOpenIDConnectActivation' => {
Yadd's avatar
Yadd committed
1246
            'default' => 0,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294
            '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'
        },
1295 1296 1297 1298
        'krbRemoveDomain' => {
            'default' => 1,
            'type'    => 'bool'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309
        'ldapAllowResetExpiredPassword' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'ldapAuthnLevel' => {
            'default' => 2,
            'type'    => 'int'
        },
        'ldapBase' => {
            'default' => 'dc=example,dc=com',
            'msgFail' => '__badValue__',
1310
            'test'    => qr/^(?:\w+=.*|)$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323
            'type'    => 'text'
        },
        'ldapChangePasswordAsUser' => {
            'default' => 0,
            'type'    => 'bool'
        },
        'ldapExportedVars' => {
            'default' => {
                'cn'   => 'cn',
                'mail' => 'mail',
                'uid'  => 'uid'
            },
            'keyMsgFail' => '__badVariableName__',
1324
            'keyTest'    => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1325
            'msgFail'    => '__badValue__',
1326
            'test'       => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350
            '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'
        },
Christophe Maudoux's avatar
Christophe Maudoux committed
1351 1352 1353 1354
        'ldapGroupDecodeSearchedValue' => {
            'default' => 0,
            'type'    => 'bool'
        },
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381
        '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__',
1382
            'test'    => qr/^[a-zA-Z0-9_][a-zA-Z0-9_\-]*[a-zA-Z0-9_]$/,
dcoutadeur dcoutadeur's avatar
dcoutadeur dcoutadeur committed
1383 1384 1385 1386 1387 1388 1389
            'type'    => 'text'
        },
        'ldapRaw' => {
            'type' => 'text'
        },
        'ldapSearchDeref' => {
            'default' => 'find',
Yadd's avatar
Yadd committed
1390
            'select'  => [ {
dcoutadeur dcoutadeur's avatar