|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Read-only configuration of the IRSS User Content Isolation feature. More...
Collaboration diagram for ILIAS\FileDelivery\Isolation\IsolationConfig:Public Member Functions | |
| __construct (private bool $activated, private ?string $content_domain, private ?string $ilias_domain,) | |
| isActivated () | |
| getContentDomain () | |
| getIliasDomain () | |
| getContentHost () | |
| getIliasHost () | |
| toArray () | |
Static Public Member Functions | |
| static | fromArray (array $data) |
| static | disabled () |
| static | fromArtefact (?string $path=null) |
| Load the configuration from the static artefact written by the setup. More... | |
| static | normalizeOrigin (mixed $value) |
| Validate and normalize a configured domain to a bare origin ("scheme://host[:port]"), or null if it is not a usable http/https origin. More... | |
| static | originFromUrl (mixed $value) |
| Reduce a (trusted) application URL to its bare origin "scheme://host[:port]". More... | |
Data Fields | |
| const | KEY_ACTIVATED = 'activated' |
| const | KEY_CONTENT_DOMAIN = 'content_domain' |
| const | KEY_ILIAS_DOMAIN = 'ilias_domain' |
Private Member Functions | |
| extractHost (?string $url) | |
Static Private Member Functions | |
| static | normalizeUrl (mixed $value) |
| Normalize the configured value to a bare origin: "scheme://host[:port]". More... | |
Read-only configuration of the IRSS User Content Isolation feature.
Loaded from a static PHP artefact written by the setup so that the FileDelivery service can decide whether to deliver content via a dedicated content domain — without any DB dependency.
Both the content domain (admin-configured) and the ILIAS domain (derived from the installed http_path at setup time) are baked into the artefact. The runtime therefore never has to read ilias.ini.php to learn either value.
Definition at line 38 of file IsolationConfig.php.
| ILIAS\FileDelivery\Isolation\IsolationConfig::__construct | ( | private bool | $activated, |
| private ?string | $content_domain, | ||
| private ?string | $ilias_domain | ||
| ) |
Definition at line 44 of file IsolationConfig.php.
|
static |
Definition at line 69 of file IsolationConfig.php.
Referenced by ILIAS\FileDelivery\Isolation\IsolationConfig\fromArtefact(), getFileDelivery(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testDisabledFactory(), ILIAS\Tests\FileDelivery\Delivery\BaseDeliveryIsolationTest\testGeneralHeadersCarryNoIsolationHeadersWhenDisabled(), ILIAS\Tests\FileDelivery\Delivery\BaseDeliveryIsolationTest\testHostAllowedWhenIsolationDisabled(), ILIAS\Tests\FileDelivery\ServicesBaseUriTest\testKeepsPortWhenIsolationDisabled(), ILIAS\Tests\FileDelivery\Delivery\LegacyDeliveryIsolationTest\testLegacyDeliveryIsServedOnAnyHostWhenIsolationIsDisabled(), ILIAS\Tests\FileDelivery\Delivery\BaseDeliveryIsolationTest\testNoIsolationHeadersWhenDisabled(), ILIAS\Tests\FileDelivery\Delivery\BaseDeliveryIsolationTest\testNotOnContentHostWhenIsolationDisabled(), ILIAS\Tests\FileDelivery\Delivery\StreamDeliveryIsolationTest\testTokenWithoutIsolationIsServedOnAnyHostWhenIsolationIsDisabled(), ILIAS\Tests\FileDelivery\ServicesBaseUriTest\testUsesRequestHostWhenIsolationDisabled(), and ILIAS\Tests\FileDelivery\Delivery\StreamDeliveryIsolationTest\testValidTokenIsServedOnAnyHostWhenIsolationIsDisabled().
Here is the caller graph for this function:
|
private |
Definition at line 132 of file IsolationConfig.php.
Referenced by ILIAS\FileDelivery\Isolation\IsolationConfig\getContentHost(), and ILIAS\FileDelivery\Isolation\IsolationConfig\getIliasHost().
Here is the caller graph for this function:
|
static |
| array<string,mixed> | $data |
Definition at line 54 of file IsolationConfig.php.
References $data, and ILIAS\FileDelivery\Isolation\IsolationConfig\normalizeUrl().
Referenced by ILIAS\Tests\FileDelivery\Delivery\BaseDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\Delivery\LegacyDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\Delivery\StreamDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\ServicesBaseUriTest\activeConfig(), ILIAS\FileDelivery\Isolation\IsolationConfig\fromArtefact(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testActivatedWithoutContentDomainIsForcedOff(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testActivatedWithoutIliasDomainStaysActiveWithNullIliasDomain(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testBareHostnamesGetHttpsScheme(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArrayToArrayRoundtripIsStable(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArrayWithFullSpecExample(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromEmptyArrayIsDisabled(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testInactiveStillParsesDomains(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testNonBareOriginsAreRejected(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testToArrayUsesSpecKeys(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testTrailingSlashIsStripped(), and ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testUnusableDomainsNormalizeToNull().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Load the configuration from the static artefact written by the setup.
A missing, unreadable or malformed artefact keeps the feature off, so an installation that never ran the FileDelivery setup behaves as before.
| string | null | $path | only passed in tests; defaults to the artefact location the setup writes to |
Definition at line 83 of file IsolationConfig.php.
References $data, ILIAS\FileDelivery\Isolation\IsolationConfig\disabled(), ILIAS\FileDelivery\Isolation\IsolationConfig\fromArray(), and ILIAS\FileDelivery\Setup\BuildStaticConfigStoredObjective\PATH().
Referenced by ILIAS\FileDelivery\Setup\Agent\buildIsolationObjective(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArtefactReadsTheStoredSettings(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArtefactWithNonArrayContentIsDisabled(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArtefactWithoutFileIsDisabled(), and ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArtefactWithoutReturnValueIsDisabled().
Here is the call graph for this function:
Here is the caller graph for this function:| ILIAS\FileDelivery\Isolation\IsolationConfig::getContentDomain | ( | ) |
Definition at line 112 of file IsolationConfig.php.
| ILIAS\FileDelivery\Isolation\IsolationConfig::getContentHost | ( | ) |
Definition at line 122 of file IsolationConfig.php.
References ILIAS\FileDelivery\Isolation\IsolationConfig\extractHost().
Here is the call graph for this function:| ILIAS\FileDelivery\Isolation\IsolationConfig::getIliasDomain | ( | ) |
Definition at line 117 of file IsolationConfig.php.
| ILIAS\FileDelivery\Isolation\IsolationConfig::getIliasHost | ( | ) |
Definition at line 127 of file IsolationConfig.php.
References ILIAS\FileDelivery\Isolation\IsolationConfig\extractHost().
Here is the call graph for this function:| ILIAS\FileDelivery\Isolation\IsolationConfig::isActivated | ( | ) |
Definition at line 107 of file IsolationConfig.php.
|
static |
Validate and normalize a configured domain to a bare origin ("scheme://host[:port]"), or null if it is not a usable http/https origin.
Shared with the setup layer so that the setup and the runtime enforce one identical set of rules for what a content/ILIAS domain may look like.
Definition at line 102 of file IsolationConfig.php.
References ILIAS\FileDelivery\Isolation\IsolationConfig\normalizeUrl().
Referenced by ILIAS\FileDelivery\Setup\FileDeliverySetupConfig\__construct().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Normalize the configured value to a bare origin: "scheme://host[:port]".
Security: the result is used both as the base for asset URLs and as the value of the Access-Control-Allow-Origin response header. It must therefore be a clean origin only — any scheme other than http/https, and any userinfo, path, query or fragment, makes the value unusable (returns null, which keeps isolation disabled). The setup layer rejects such input loudly; this is the runtime safety net.
Definition at line 163 of file IsolationConfig.php.
Referenced by ILIAS\FileDelivery\Isolation\IsolationConfig\fromArray(), and ILIAS\FileDelivery\Isolation\IsolationConfig\normalizeOrigin().
Here is the caller graph for this function:
|
static |
Reduce a (trusted) application URL to its bare origin "scheme://host[:port]".
Unlike {
Used by the setup layer to derive the ILIAS domain from http_path at build time so the value can be baked into the artefact.
Definition at line 214 of file IsolationConfig.php.
Referenced by ILIAS\FileDelivery\Setup\IsolationObjective\readIliasDomain(), and ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testOriginFromUrlReducesTrustedAppUrlToBareOrigin().
Here is the caller graph for this function:| ILIAS\FileDelivery\Isolation\IsolationConfig::toArray | ( | ) |
Definition at line 144 of file IsolationConfig.php.
| const ILIAS\FileDelivery\Isolation\IsolationConfig::KEY_ACTIVATED = 'activated' |
Definition at line 40 of file IsolationConfig.php.
Referenced by ILIAS\Tests\FileDelivery\Setup\AgentTest\activatedArtefact(), ILIAS\Tests\FileDelivery\Delivery\BaseDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\Delivery\LegacyDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\Delivery\StreamDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\ServicesBaseUriTest\activeConfig(), ILIAS\FileDelivery\Setup\IsolationObjective\build(), ILIAS\FileDelivery\Setup\IsolationObjective\buildIn(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testActivatedWithoutContentDomainIsForcedOff(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testActivatedWithoutIliasDomainStaysActiveWithNullIliasDomain(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testBareHostnamesGetHttpsScheme(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testBuildInDerivesIliasDomainFromHttpPath(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testBuildInDoesNotThrowForSameHostWhenInactive(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testBuildInWithoutIniResourceLeavesIliasDomainNull(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testBuildProducesContentDomainWithNullIliasDomain(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testDefaultBuildIsDisabledArtifact(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArrayToArrayRoundtripIsStable(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArrayWithFullSpecExample(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testInactiveStillParsesDomains(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testNonBareOriginsAreRejected(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testToArrayUsesSpecKeys(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testTrailingSlashIsStripped(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testUnusableDomainsNormalizeToNull(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithoutConfigAndArtefactStaysDeactivated(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithoutConfigKeepsCurrentSettings(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithoutSectionKeepsCurrentSettings(), and ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithSectionOverridesCurrentSettings().
| const ILIAS\FileDelivery\Isolation\IsolationConfig::KEY_CONTENT_DOMAIN = 'content_domain' |
Definition at line 41 of file IsolationConfig.php.
Referenced by ILIAS\Tests\FileDelivery\Setup\AgentTest\activatedArtefact(), ILIAS\Tests\FileDelivery\Delivery\BaseDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\Delivery\LegacyDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\Delivery\StreamDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\ServicesBaseUriTest\activeConfig(), ILIAS\FileDelivery\Setup\IsolationObjective\build(), ILIAS\FileDelivery\Setup\IsolationObjective\buildIn(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testActivatedWithoutIliasDomainStaysActiveWithNullIliasDomain(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testBareHostnamesGetHttpsScheme(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testBuildInDerivesIliasDomainFromHttpPath(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testBuildProducesContentDomainWithNullIliasDomain(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testDefaultBuildIsDisabledArtifact(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArrayToArrayRoundtripIsStable(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArrayWithFullSpecExample(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testInactiveStillParsesDomains(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testMaliciousDomainIsEscapedAndNotExecuted(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testNonBareOriginsAreRejected(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testToArrayUsesSpecKeys(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testTrailingSlashIsStripped(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testUnusableDomainsNormalizeToNull(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithoutConfigAndArtefactStaysDeactivated(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithoutConfigKeepsCurrentSettings(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithoutSectionKeepsCurrentSettings(), and ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithSectionOverridesCurrentSettings().
| const ILIAS\FileDelivery\Isolation\IsolationConfig::KEY_ILIAS_DOMAIN = 'ilias_domain' |
Definition at line 42 of file IsolationConfig.php.
Referenced by ILIAS\Tests\FileDelivery\Setup\AgentTest\activatedArtefact(), ILIAS\Tests\FileDelivery\Delivery\BaseDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\Delivery\LegacyDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\Delivery\StreamDeliveryIsolationTest\activeConfig(), ILIAS\Tests\FileDelivery\ServicesBaseUriTest\activeConfig(), ILIAS\FileDelivery\Setup\IsolationObjective\build(), ILIAS\FileDelivery\Setup\IsolationObjective\buildIn(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testActivatedWithoutContentDomainIsForcedOff(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testBareHostnamesGetHttpsScheme(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testBuildInDerivesIliasDomainFromHttpPath(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testBuildInWithoutIniResourceLeavesIliasDomainNull(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testBuildProducesContentDomainWithNullIliasDomain(), ILIAS\Tests\FileDelivery\Setup\IsolationObjectiveTest\testDefaultBuildIsDisabledArtifact(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArrayToArrayRoundtripIsStable(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testFromArrayWithFullSpecExample(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testInactiveStillParsesDomains(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testNonBareOriginsAreRejected(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testToArrayUsesSpecKeys(), ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testTrailingSlashIsStripped(), and ILIAS\Tests\FileDelivery\Isolation\IsolationConfigTest\testUnusableDomainsNormalizeToNull().