19declare(strict_types=1);
28use PHPUnit\Framework\TestCase;
46 'https://content.example.org',
49 $artifact = $objective->build();
50 $this->assertInstanceOf(Artifact::class, $artifact);
89 $env = $this->createStub(Environment::class);
90 $env->method(
'getResource')->willReturn(
null);
105 $this->expectException(UnachievableException::class);
106 $objective->buildIn($env);
127 $marker = sys_get_temp_dir() .
'/isolation_injection_' . getmypid();
130 $payload =
"https://evil.example.org' . file_put_contents('" . $marker .
"', 'pwned') . '";
137 $this->assertFileDoesNotExist($marker);
142 $ini = $this->createStub(\ilIniFile::class);
143 $ini->method(
'readVariable')->willReturn($http_path);
145 $env = $this->createStub(Environment::class);
146 $env->method(
'getResource')->willReturn(
$ini);
159 $file = tempnam(sys_get_temp_dir(),
'isolation_artifact_') .
'.php';
160 file_put_contents($file, $artifact->
serialize());
163 $value = include $file;
168 $this->assertIsArray($value);
Read-only configuration of the IRSS User Content Isolation feature.
Writes the IRSS User Content Isolation settings to a static PHP artefact so the FileDelivery runtime ...
Signals that some goal won't be achievable by actions of the system ever.
testBuildInDerivesIliasDomainFromHttpPath()
environmentWithHttpPath(string $http_path)
testDefaultBuildIsDisabledArtifact()
testBuildInWithoutIniResourceLeavesIliasDomainNull()
testBuildInDoesNotThrowForSameHostWhenInactive()
evaluateArtifact(Artifact $artifact)
Execute the serialized artefact exactly the way the runtime loads it (include $path) and return the p...
testBuildInThrowsWhenContentHostEqualsIliasHost()
testBuildProducesContentDomainWithNullIliasDomain()
testMaliciousDomainIsEscapedAndNotExecuted()
Regression for the review concern that a generated PHP artefact could allow code injection via an une...
An artifact is some file that is build on demand per installation and is not shipped with the ILIAS s...
serialize()
This method will be called from the source, which wants to save the artifact.
An environment holds resources to be used in the setup process.