Skip to content

Commit 82b7d4e

Browse files
committed
fix(DB): allow group names from SAML with a max length of 255 (from 64)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent ad2aaa3 commit 82b7d4e

3 files changed

Lines changed: 38 additions & 2 deletions

File tree

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following providers are supported and tested at the moment:
2020
* Any other provider that authenticates using the environment variable
2121
2222
While theoretically any other authentication provider implementing either one of those standards is compatible, we like to note that they are not part of any internal test matrix.]]></description>
23-
<version>7.1.0</version>
23+
<version>7.1.1</version>
2424
<licence>agpl</licence>
2525
<author>Lukas Reschke</author>
2626
<namespace>User_SAML</namespace>

lib/Migration/Version6000Date20220912152700.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
3939
]);
4040
$table->addColumn('saml_gid', Types::STRING, [
4141
'notnull' => true,
42-
'length' => 64,
42+
'length' => 255,
4343
'default' => '',
4444
]);
4545
$table->setPrimaryKey(['gid']);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
10+
namespace OCA\User_SAML\Migration;
11+
12+
use Closure;
13+
use OCP\DB\ISchemaWrapper;
14+
use OCP\Migration\IOutput;
15+
use OCP\Migration\SimpleMigrationStep;
16+
use Override;
17+
18+
class Version7001Date20251203110627 extends SimpleMigrationStep {
19+
20+
#[Override]
21+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
22+
$schema = $schemaClosure();
23+
24+
if (!$schema->hasTable('user_saml_groups')) {
25+
return null;
26+
}
27+
28+
$groupsTable = $schema->getTable('user_saml_groups');
29+
$samlGidColumn = $groupsTable->getColumn('saml_gid');
30+
if ($samlGidColumn->getLength() < 255) {
31+
$samlGidColumn->setLength(255);
32+
return $schema;
33+
}
34+
return null;
35+
}
36+
}

0 commit comments

Comments
 (0)