fix(Krb): switch away from deprecated and broken KerberosApacheAuth()

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2025-07-10 15:08:22 +02:00
parent c0b31d1e2d
commit fd799afc17
No known key found for this signature in database
GPG key ID: 7424F1874854DF23
2 changed files with 4 additions and 8 deletions

View file

@ -9,8 +9,8 @@
namespace OCA\Files_External\Lib\Backend;
use Icewind\SMB\BasicAuth;
use Icewind\SMB\KerberosApacheAuth;
use Icewind\SMB\KerberosAuth;
use Icewind\SMB\KerberosTicket;
use Icewind\SMB\Native\NativeServer;
use Icewind\SMB\Wrapped\Server;
use OCA\Files_External\Lib\Auth\AuthMechanism;
@ -85,9 +85,10 @@ class SMB extends Backend {
throw new \InvalidArgumentException('invalid authentication backend');
}
$credentialsStore = $auth->getCredentialsStore();
$kerbAuth = new KerberosApacheAuth();
$kerbAuth = new KerberosAuth();
$kerbAuth->setTicket(KerberosTicket::fromEnv());
// check if a kerberos ticket is available, else fallback to session credentials
if ($kerbAuth->checkTicket()) {
if ($kerbAuth->getTicket()?->isValid()) {
$smbAuth = $kerbAuth;
} else {
try {

View file

@ -1462,11 +1462,6 @@
<code><![CDATA[class-string<IStorage>]]></code>
</MoreSpecificReturnType>
</file>
<file src="apps/files_external/lib/Lib/Backend/SMB.php">
<DeprecatedClass>
<code><![CDATA[new KerberosApacheAuth()]]></code>
</DeprecatedClass>
</file>
<file src="apps/files_external/lib/Lib/Storage/SFTP.php">
<InternalMethod>
<code><![CDATA[put]]></code>