@@ -107,17 +101,14 @@
-
{{translate(node.title)}} |
- {{node.title}} |
- {{translate(node.value)}} |
- {{node.value}} |
- {{translate(node.epoch)}} |
- {{localeDate(node.epoch)}} |
+ {{translate(node.title)}} |
+ {{node.title}} |
+ {{translate(node.value)}} |
+ {{node.value}} |
+ {{translate(node.epoch)}} |
+ {{localeDate(node.epoch)}} |
-
-
+
|
diff --git a/lemonldap-ng-manager/site/templates/sessions.tpl b/lemonldap-ng-manager/site/templates/sessions.tpl
index db561bb10..90a6f5b49 100644
--- a/lemonldap-ng-manager/site/templates/sessions.tpl
+++ b/lemonldap-ng-manager/site/templates/sessions.tpl
@@ -107,9 +107,6 @@
{{localeDate(node.epoch)}} |
-
|
diff --git a/lemonldap-ng-manager/t/04-2F-api.t b/lemonldap-ng-manager/t/04-2F-api.t
index 364647435..7167c8ded 100644
--- a/lemonldap-ng-manager/t/04-2F-api.t
+++ b/lemonldap-ng-manager/t/04-2F-api.t
@@ -135,14 +135,6 @@ sub checkGetList {
return $ret;
}
-sub checkGetBadType {
- my ( $uid, $type ) = splice @_;
- my ( $test, $res );
- $test = "Get for uid $uid and type \"$type\" should get rejected.";
- $res = get( $test, $uid, $type );
- check400( $test, $res );
-}
-
sub checkGetOnIds {
my ( $uid, $ret ) = splice @_;
foreach (@$ret) {
@@ -313,7 +305,7 @@ checkGetList( 1, 'dwho', 'U2F' );
checkGetList( 1, 'dwho', 'TOTP' );
checkGetList( 1, 'dwho', 'UBK' );
checkGetList( 1, 'dwho', 'WebAuthn' );
-checkGetBadType( 'dwho', 'UBKIKI' );
+checkGetList( 0, 'dwho', 'UBKIKI' );
$ret = checkGetList( 4, 'dwho' );
checkGetOnIds( 'dwho', $ret );
checkDelete( 'dwho', @$ret[0]->{id} );
diff --git a/lemonldap-ng-manager/t/60-2ndfa.t b/lemonldap-ng-manager/t/60-2ndfa.t
index fff93623c..0ecd12ad8 100644
--- a/lemonldap-ng-manager/t/60-2ndfa.t
+++ b/lemonldap-ng-manager/t/60-2ndfa.t
@@ -147,8 +147,7 @@ ok( ( $res->{_2fDevices} and $res->{_2fDevices} =~ /"type":\s*"UBK"/s ),
count(5);
## "All" query
-$res = &client->jsonResponse( '/sfa/persistent',
- 'groupBy=substr(uid,1)&U2FCheck=1&TOTPCheck=1&UBKCheck=1' );
+$res = &client->jsonResponse( '/sfa/persistent', 'groupBy=substr(uid,1)' );
ok( $res->{result} == 1, 'Search * - Result code = 1' );
ok( $res->{count} == 3, 'Found 3 results' ) or print STDERR Dumper($res);
ok( @{ $res->{values} } == 3, 'List 3 results' );
@@ -168,8 +167,8 @@ count(9);
## "Search by UID" query
# uid=d*
-$res = &client->jsonResponse( '/sfa/persistent',
- 'uid=d*&groupBy=substr(uid,1)&U2FCheck=1&TOTPCheck=1&UBKCheck=1' );
+$res =
+ &client->jsonResponse( '/sfa/persistent', 'uid=d*&groupBy=substr(uid,1)' );
ok( $res->{result} == 1, 'Search "uid"=d* - Result code = 1' );
ok( $res->{count} == 1, 'Found 1 result' ) or print STDERR Dumper($res);
ok( @{ $res->{values} } == 1, 'List 1 result' );
@@ -180,8 +179,8 @@ ok( $res->{values}->[0]->{count} == 2, 'Found 2 sessions starting with "d"' );
count(5);
# uid=dw*
-$res = &client->jsonResponse( '/sfa/persistent',
- 'uid=dw*&groupBy=substr(uid,2)&U2FCheck=1&TOTPCheck=1&UBKCheck=1' );
+$res =
+ &client->jsonResponse( '/sfa/persistent', 'uid=dw*&groupBy=substr(uid,2)' );
ok( $res->{result} == 1, 'Search "uid"=dw* - Result code = 1' );
ok( $res->{count} == 1, 'Found 1 result' ) or print STDERR Dumper($res);
ok( @{ $res->{values} } == 1, 'List 1 result' );
@@ -193,7 +192,7 @@ count(5);
# uid=d* & UBK
$res = &client->jsonResponse( '/sfa/persistent',
- 'uid=d*&groupBy=substr(uid,1)&U2FCheck=1&TOTPCheck=1&UBKCheck=2' );
+ 'uid=d*&groupBy=substr(uid,1)&type=UBK' );
ok( $res->{result} == 1, 'Search "uid"=d* & UBK - Result code = 1' );
ok( $res->{count} == 1, 'Found 1 result' ) or print STDERR Dumper($res);
ok( @{ $res->{values} } == 1, 'List 1 result' );
@@ -208,7 +207,7 @@ count(5);
# uid=dw* & UBK
$res = &client->jsonResponse( '/sfa/persistent',
- 'uid=dw*&groupBy=substr(uid,2)&U2FCheck=1&TOTPCheck=1&UBKCheck=2' );
+ 'uid=dw*&groupBy=substr(uid,2)&type=UBK' );
ok( $res->{result} == 1, 'Search "uid"=dw* & UBK - Result code = 1' );
ok( $res->{count} == 1, 'Found 1 result' ) or print STDERR Dumper($res);
ok( @{ $res->{values} } == 1, 'List 1 result' );
@@ -223,7 +222,7 @@ count(5);
# uid=da* & UBK
$res = &client->jsonResponse( '/sfa/persistent',
- 'uid=da*&groupBy=substr(uid,2)&U2FCheck=1&TOTPCheck=1&UBKCheck=2' );
+ 'uid=da*&groupBy=substr(uid,2)&type=UBK' );
ok( $res->{result} == 1, 'Search "uid"=da* & UBK - Result code = 1' );
ok( $res->{count} == 0, 'Found 0 session with "da" & UBK' )
or print STDERR Dumper($res);
@@ -232,7 +231,7 @@ count(3);
## "Filtered by U2F" query
$res = &client->jsonResponse( '/sfa/persistent',
- 'uid=*&groupBy=substr(uid,0)&U2FCheck=2&TOTPCheck=1&UBKCheck=1' );
+ 'uid=*&groupBy=substr(uid,0)&type=U2F' );
ok( $res->{result} == 1, 'Search "uid"=* & UBK - Result code = 1' );
ok( $res->{count} == 3, 'Found 3 results' ) or print STDERR Dumper($res);
ok( @{ $res->{values} } == 3, 'List 3 results' );
@@ -261,7 +260,7 @@ count(9);
## "Filtered by U2F & TOTP" query
$res = &client->jsonResponse( '/sfa/persistent',
- 'uid=*&groupBy=substr(uid,0)&U2FCheck=2&TOTPCheck=2&UBKCheck=1' );
+ 'uid=*&groupBy=substr(uid,0)&type=U2F&type=TOTP' );
ok( $res->{result} == 1, 'Search "uid"=* & UBK & TOTP - Result code = 1' );
ok( $res->{count} == 1, 'Found 1 result' ) or print STDERR Dumper($res);
ok( @{ $res->{values} } == 1, 'List 1 result' );
@@ -274,7 +273,7 @@ count(5);
## "Filtered by U2F & TOTP & UBK" query
$res = &client->jsonResponse( '/sfa/persistent',
- 'uid=*&groupBy=substr(uid,0)&U2FCheck=2&TOTPCheck=2&UBKCheck=2' );
+ 'uid=*&groupBy=substr(uid,0)&type=U2F&type=TOTP&type=UBK' );
ok( $res->{result} == 1,
'Search "uid"=* & UBK & TOTP & UBK - Result code = 1' );
ok( $res->{count} == 1, 'Found 1 result' ) or print STDERR Dumper($res);
@@ -288,7 +287,7 @@ count(5);
## "Filtered by U2F & UBK" query
$res = &client->jsonResponse( '/sfa/persistent',
- 'uid=*&groupBy=substr(uid,0)&U2FCheck=2&TOTPCheck=1&UBKCheck=2' );
+ 'uid=*&groupBy=substr(uid,0)&type=U2F&type=UBK' );
ok( $res->{result} == 1, 'Search "uid"=* & UBK & UBK - Result code = 1' );
ok( $res->{count} == 2, 'Found 2 results' ) or print STDERR Dumper($res);
ok( @{ $res->{values} } == 2, 'List 2 results' );
@@ -345,14 +344,18 @@ foreach ( 2 .. 3 ) {
}
## Check than all devices have been deleted with "All" query
-$res = &client->jsonResponse( '/sfa/persistent',
- 'groupBy=substr(uid,1)&U2FCheck=1&TOTPCheck=1&UBKCheck=1' );
+$res = &client->jsonResponse( '/sfa/persistent', 'groupBy=substr(uid,1)' );
ok( $res->{result} == 1, 'Result code = 1' );
ok( $res->{count} == 0, 'Found 0 session with 2F device' )
or print STDERR Dumper($res);
ok( @{ $res->{values} } == 0, 'List 0 result' );
count(3);
+ok( $res = &client->_get('/2ndfa.html'), 'Succeed to get /2ndfa.html' );
+like( $res->[2]->[0],
+ qr,, );
+count(2);
+
done_testing( count() );
# Remove sessions directory