2.0 release candidate (#3808)
* use SAML interface instead of implementation * moved implementation of SAML configs to system-configuration base class * bump composer packages * simplify configuration for different env
This commit is contained in:
@@ -9,9 +9,6 @@
|
||||
|
||||
namespace App\Configuration;
|
||||
|
||||
/**
|
||||
* @CloudRequired
|
||||
*/
|
||||
final class SamlConfiguration implements SamlConfigurationInterface
|
||||
{
|
||||
public function __construct(private SystemConfiguration $configuration)
|
||||
@@ -35,22 +32,17 @@ final class SamlConfiguration implements SamlConfigurationInterface
|
||||
|
||||
public function getAttributeMapping(): array
|
||||
{
|
||||
return $this->configuration->findArray('saml.mapping');
|
||||
return $this->configuration->getSamlAttributeMapping();
|
||||
}
|
||||
|
||||
public function getRolesAttribute(): ?string
|
||||
{
|
||||
$attr = $this->configuration->find('saml.roles.attribute');
|
||||
if (empty($attr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $attr;
|
||||
return $this->configuration->getSamlRolesAttribute();
|
||||
}
|
||||
|
||||
public function getRolesMapping(): array
|
||||
{
|
||||
return $this->configuration->findArray('saml.roles.mapping');
|
||||
return $this->configuration->getSamlRolesMapping();
|
||||
}
|
||||
|
||||
public function isRolesResetOnLogin(): bool
|
||||
@@ -60,6 +52,6 @@ final class SamlConfiguration implements SamlConfigurationInterface
|
||||
|
||||
public function getConnection(): array
|
||||
{
|
||||
return $this->configuration->findArray('saml.connection');
|
||||
return $this->configuration->getSamlConnection();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,32 @@
|
||||
|
||||
namespace App\Configuration;
|
||||
|
||||
/**
|
||||
* @CloudRequired
|
||||
*/
|
||||
interface SamlConfigurationInterface
|
||||
{
|
||||
/**
|
||||
* Whether SAML login is activated.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isActivated(): bool;
|
||||
|
||||
/**
|
||||
* Returns the title that is exclusively used in the frontend.
|
||||
* Currently, used to display the button in the login screen.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle(): string;
|
||||
|
||||
/**
|
||||
* Returns the provider name that is exclusively used in the frontend.
|
||||
* Currently, used to display an icon in the login screen.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProvider(): string;
|
||||
|
||||
public function getAttributeMapping(): array;
|
||||
|
||||
@@ -218,6 +218,40 @@ final class SystemConfiguration
|
||||
return (bool) $this->find('saml.roles.resetOnLogin');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<mixed>
|
||||
*/
|
||||
public function getSamlRolesMapping(): array
|
||||
{
|
||||
return $this->findArray('saml.roles.mapping');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<mixed>
|
||||
*/
|
||||
public function getSamlConnection(): array
|
||||
{
|
||||
return $this->findArray('saml.connection');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<mixed>
|
||||
*/
|
||||
public function getSamlAttributeMapping(): array
|
||||
{
|
||||
return $this->findArray('saml.mapping');
|
||||
}
|
||||
|
||||
public function getSamlRolesAttribute(): ?string
|
||||
{
|
||||
$attr = $this->find('saml.roles.attribute');
|
||||
if (empty($attr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $attr;
|
||||
}
|
||||
|
||||
public function isLdapActive(): bool
|
||||
{
|
||||
return (bool) $this->find('ldap.activate');
|
||||
|
||||
Reference in New Issue
Block a user