Add GitHub parameters in Manager (#2154)

This commit is contained in:
Clément OUDOT 2020-04-18 00:08:43 +02:00
parent fb29673fdf
commit a5eadc49d3
17 changed files with 138 additions and 27 deletions

View File

@ -79,6 +79,9 @@ sub defaultValues {
'facebookUserField' => 'id',
'failedLoginNumber' => 5,
'formTimeout' => 120,
'githubAuthnLevel' => 1,
'githubScope' => 'user:email',
'githubUserField' => 'login',
'globalLogoutRule' => 0,
'globalLogoutTimer' => 1,
'globalStorage' => 'Apache::Session::File',

View File

@ -45,7 +45,7 @@ our $authParameters = {
gpgParams => [qw(gpgAuthnLevel gpgDb)],
kerberosParams => [qw(krbAuthnLevel krbKeytab krbByJs krbRemoveDomain)],
ldapParams => [qw(ldapAuthnLevel ldapExportedVars ldapServer ldapPort ldapBase managerDn managerPassword ldapTimeout ldapVersion ldapRaw LDAPFilter AuthLDAPFilter mailLDAPFilter ldapSearchDeref ldapGroupBase ldapGroupObjectClass ldapGroupAttributeName ldapGroupAttributeNameUser ldapGroupAttributeNameSearch ldapGroupDecodeSearchedValue ldapGroupRecursive ldapGroupAttributeNameGroup ldapPpolicyControl ldapSetPassword ldapChangePasswordAsUser ldapPwdEnc ldapUsePasswordResetAttribute ldapPasswordResetAttribute ldapPasswordResetAttributeValue ldapAllowResetExpiredPassword ldapITDS)],
linkedinParams => [qw(linkedInAuthnLevel linkedInClientID linkedInClientSecret linkedInFields linkedInUserField linkedInScope)],
linkedinParams => [qw(githubAuthnLevel githubClientID githubClientSecret githubUserField githubScope)],
nullParams => [qw(nullAuthnLevel)],
oidcParams => [qw(oidcAuthnLevel oidcRPCallbackGetParam oidcRPStateTimeout)],
openidParams => [qw(openIdAuthnLevel openIdExportedVars openIdSecret openIdIDPList)],

View File

@ -314,6 +314,10 @@ sub attributes {
'k' => 'Facebook',
'v' => 'Facebook'
},
{
'k' => 'GitHub',
'v' => 'GitHub'
},
{
'k' => 'GPG',
'v' => 'GPG'
@ -509,6 +513,10 @@ sub attributes {
'k' => 'Facebook',
'v' => 'Facebook'
},
{
'k' => 'GitHub',
'v' => 'GitHub'
},
{
'k' => 'GPG',
'v' => 'GPG'
@ -891,6 +899,10 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'k' => 'Facebook',
'v' => 'Facebook'
},
{
'k' => 'GitHub',
'v' => 'GitHub'
},
{
'k' => 'GPG',
'v' => 'GPG'
@ -1294,6 +1306,24 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
'default' => 120,
'type' => 'int'
},
'githubAuthnLevel' => {
'default' => 1,
'type' => 'int'
},
'githubClientID' => {
'type' => 'text'
},
'githubClientSecret' => {
'type' => 'password'
},
'githubScope' => {
'default' => 'user:email',
'type' => 'text'
},
'githubUserField' => {
'default' => 'login',
'type' => 'text'
},
'globalLogoutCustomParam' => {
'type' => 'text'
},

View File

@ -25,7 +25,8 @@ sub perlExpr {
$Lemonldap::NG::Common::Safelib::functions );
$cpt->reval("BEGIN { 'warnings'->unimport; } $val");
my $err = join( '',
grep { $_ =~ /(?:Undefined subroutine|Devel::StackTrace)/ ? () : $_ } split( /\n/, $@ ) );
grep { $_ =~ /(?:Undefined subroutine|Devel::StackTrace)/ ? () : $_ }
split( /\n/, $@ ) );
return $err ? ( -1, "__badExpression__: $err" ) : (1);
}
@ -801,19 +802,20 @@ sub attributes {
bruteForceProtectionMaxLockTime => {
default => 900,
type => 'int',
documentation =>
'Brute force attack protection -> Max lock time',
documentation => 'Brute force attack protection -> Max lock time',
},
bruteForceProtectionIncrementalTempo => {
default => 0,
help => 'bruteforceprotection.html',
type => 'bool',
documentation => 'Enable incremental lock time for brute force attack protection',
documentation =>
'Enable incremental lock time for brute force attack protection',
},
bruteForceProtectionLockTimes => {
type => 'text',
default => '5 15 60 300 600',
documentation => 'Incremental lock time values for brute force attack protection',
documentation =>
'Incremental lock time values for brute force attack protection',
},
grantSessionRules => {
type => 'grantContainer',
@ -2902,6 +2904,7 @@ sub attributes {
{ k => 'AD', v => 'Active Directory' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'Facebook', v => 'Facebook' },
{ k => 'GitHub', v => 'GitHub' },
{ k => 'GPG', v => 'GPG' },
{ k => 'Kerberos', v => 'Kerberos' },
{ k => 'LDAP', v => 'LDAP' },
@ -3417,6 +3420,17 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
linkedInScope =>
{ type => 'text', default => 'r_liteprofile r_emailaddress' },
# GitHub
githubAuthnLevel => {
type => 'int',
default => 1,
documentation => 'GitHub authentication level',
},
githubClientID => { type => 'text', },
githubClientSecret => { type => 'password', },
githubScope => { type => 'text', default => 'user:email' },
githubUserField => { type => 'text', default => 'login' },
# WebID
webIDAuthnLevel => {
type => 'int',
@ -3563,6 +3577,7 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'Demo', v => 'Demo' },
{ k => 'Facebook', v => 'Facebook' },
{ k => 'GitHub', v => 'GitHub' },
{ k => 'GPG', v => 'GPG' },
{ k => 'Kerberos', v => 'Kerberos' },
{ k => 'LDAP', v => 'LDAP' },
@ -3631,6 +3646,7 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
{ k => 'AD', v => 'Active Directory' },
{ k => 'DBI', v => 'Database (DBI)' },
{ k => 'Facebook', v => 'Facebook' },
{ k => 'GitHub', v => 'GitHub' },
{ k => 'GPG', v => 'GPG' },
{ k => 'Kerberos', v => 'Kerberos' },
{ k => 'LDAP', v => 'LDAP' },

View File

@ -305,6 +305,16 @@ sub tree {
'linkedInUserField', 'linkedInScope'
]
},
{
title => 'linkedinParams',
help => 'authlinkedin.html',
form => 'simpleInputContainer',
nodes => [
'githubAuthnLevel', 'githubClientID',
'githubClientSecret', 'githubUserField',
'githubScope'
]
},
{
title => 'combinationParams',
help => 'authcombination.html',
@ -708,8 +718,11 @@ sub tree {
title => 'globalLogout',
help => 'globallogout.html',
form => 'simpleInputContainer',
nodes =>
[ 'globalLogoutRule', 'globalLogoutTimer','globalLogoutCustomParam' ],
nodes => [
'globalLogoutRule',
'globalLogoutTimer',
'globalLogoutCustomParam'
],
},
{
title => 'stateCheck',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -316,6 +316,12 @@
"forms":"إستمارات",
"friendlyName":"اسم مألوف",
"generalParameters":"المعاييرالعامة",
"githubAuthnLevel":"Authentication level",
"githubClientID":"Client ID",
"githubClientSecret":"Client secret",
"githubParams":"GitHub Parameters",
"githubScope":"Scope",
"githubUserField":"Field containing user identifier",
"globalLogout":"Global logout",
"globalLogoutCustomParam":"Custom parameter",
"globalLogoutRule":"تفعيل",

View File

@ -316,6 +316,12 @@
"forms":"Forms",
"friendlyName":"Friendly name",
"generalParameters":"General Parameters",
"githubAuthnLevel":"Authentication level",
"githubClientID":"Client ID",
"githubClientSecret":"Client secret",
"githubParams":"GitHub Parameters",
"githubScope":"Scope",
"githubUserField":"Field containing user identifier",
"globalLogout":"Global logout",
"globalLogoutCustomParam":"Custom parameter",
"globalLogoutRule":"Activation",

View File

@ -316,6 +316,12 @@
"forms":"Forms",
"friendlyName":"Friendly name",
"generalParameters":"General Parameters",
"githubAuthnLevel":"Authentication level",
"githubClientID":"Client ID",
"githubClientSecret":"Client secret",
"githubParams":"GitHub Parameters",
"githubScope":"Scope",
"githubUserField":"Field containing user identifier",
"globalLogout":"Global logout",
"globalLogoutCustomParam":"Custom parameter",
"globalLogoutRule":"Activation",

View File

@ -316,6 +316,12 @@
"forms":"Formulaires",
"friendlyName":"Nom alternatif",
"generalParameters":"Paramètres généraux",
"githubAuthnLevel":"Niveau d'authentification",
"githubClientID":"Identifiant",
"githubClientSecret":"Mot de passe",
"githubParams":"Paramètres GitHub",
"githubScope":"Scope",
"githubUserField":"Champ contenant l'identifiant de l'utilisateur",
"globalLogout":"Déconnexion globale",
"globalLogoutCustomParam":"Paramètre personnalisé",
"globalLogoutRule":"Activation",

View File

@ -316,6 +316,12 @@
"forms":"Moduli",
"friendlyName":"Nome amichevole",
"generalParameters":"Parametri generali",
"githubAuthnLevel":"Authentication level",
"githubClientID":"Client ID",
"githubClientSecret":"Client secret",
"githubParams":"GitHub Parameters",
"githubScope":"Scope",
"githubUserField":"Field containing user identifier",
"globalLogout":"Global logout",
"globalLogoutCustomParam":"Custom parameter",
"globalLogoutRule":"Attivazione",

View File

@ -316,6 +316,12 @@
"forms":"Formlar",
"friendlyName":"Kolay ad",
"generalParameters":"Genel Parametreler",
"githubAuthnLevel":"Authentication level",
"githubClientID":"Client ID",
"githubClientSecret":"Client secret",
"githubParams":"GitHub Parameters",
"githubScope":"Scope",
"githubUserField":"Field containing user identifier",
"globalLogout":"Global çıkış",
"globalLogoutCustomParam":"Custom parameter",
"globalLogoutRule":"Aktivasyon",

View File

@ -316,6 +316,12 @@
"forms":"Biểu mẫu",
"friendlyName":"Tên thân thiện",
"generalParameters":"Thông số chung",
"githubAuthnLevel":"Authentication level",
"githubClientID":"Client ID",
"githubClientSecret":"Client secret",
"githubParams":"GitHub Parameters",
"githubScope":"Scope",
"githubUserField":"Field containing user identifier",
"globalLogout":"Global logout",
"globalLogoutCustomParam":"Custom parameter",
"globalLogoutRule":"Activation",

View File

@ -316,6 +316,12 @@
"forms":"Forms",
"friendlyName":"Friendly name",
"generalParameters":"通用参数",
"githubAuthnLevel":"Authentication level",
"githubClientID":"Client ID",
"githubClientSecret":"Client secret",
"githubParams":"GitHub Parameters",
"githubScope":"Scope",
"githubUserField":"Field containing user identifier",
"globalLogout":"Global logout",
"globalLogoutCustomParam":"Custom parameter",
"globalLogoutRule":"Activation",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long