diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-09-17 19:15:46 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-09-24 17:29:29 +0200 |
commit | 6ab30a669b3dde5dce2b63fb33b1ec44f1889b2f (patch) | |
tree | dab547fb88f9793df972c92972590a4ce484e949 /apps/user_ldap/tests | |
parent | fb904a9670369aab244b2f3fe3cec8fb65b0c277 (diff) | |
download | nextcloud-server-6ab30a669b3dde5dce2b63fb33b1ec44f1889b2f.tar.gz nextcloud-server-6ab30a669b3dde5dce2b63fb33b1ec44f1889b2f.zip |
ensure that user and group IDs in LDAP's tables are also max 64chars
- limitation by core tables (e.g. sharing), IDs are always 64chars
- when longer group IDs were requested they are hashed (does not affect
displaynames)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r-- | apps/user_ldap/tests/AccessTest.php | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index e49faca70cc..92b337c2cb8 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -695,7 +695,28 @@ class AccessTest extends TestCase { ['epost@poste.test', 'epost@poste.test'], ['frรคnk', $translitExpected], [' gerda ', 'gerda'], - ['๐ฑ๐ต๐๐', null] + ['๐ฑ๐ต๐๐', null], + [ + 'OneNameToRuleThemAllOneNameToFindThemOneNameToBringThemAllAndInTheDarknessBindThem', + '81ff71b5dd0f0092e2dc977b194089120093746e273f2ef88c11003762783127' + ] + ]; + } + + public function groupIDCandidateProvider() { + return [ + ['alice', 'alice'], + ['b/ob', 'b/ob'], + ['charly๐ฌ', 'charly๐ฌ'], + ['debo rah', 'debo rah'], + ['epost@poste.test', 'epost@poste.test'], + ['frรคnk', 'frรคnk'], + [' gerda ', 'gerda'], + ['๐ฑ๐ต๐๐', '๐ฑ๐ต๐๐'], + [ + 'OneNameToRuleThemAllOneNameToFindThemOneNameToBringThemAllAndInTheDarknessBindThem', + '81ff71b5dd0f0092e2dc977b194089120093746e273f2ef88c11003762783127' + ] ]; } @@ -716,6 +737,14 @@ class AccessTest extends TestCase { $this->assertSame($expected, $sanitizedName); } + /** + * @dataProvider groupIDCandidateProvider + */ + public function testSanitizeGroupIDCandidate(string $name, string $expected) { + $sanitizedName = $this->access->sanitizeGroupIDCandidate($name); + $this->assertSame($expected, $sanitizedName); + } + public function testUserStateUpdate() { $this->connection->expects($this->any()) ->method('__get') |