Add support for SASL Kerberous realms. Closes #114
All checks were successful
Create Docker Image / Test Application (x86_64) (push) Successful in 33s
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m22s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 3m39s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
Deon George 2025-01-18 22:55:50 +11:00
parent cad0a11bd2
commit 673f070cb7

View File

@ -0,0 +1,19 @@
<?php
namespace App\Classes\LDAP\Attribute\Password;
final class SASL extends Base
{
public const key = 'SASL';
public function encode(string $password): string
{
if (! str_contains($password,'@'))
return '';
// Ensure our id is lowercase, and realm is uppercase
list($id,$realm) = explode('@',$password);
return sprintf('{%s}%s@%s',self::key,strtolower($id),strtoupper($realm));
}
}