MDQ metadata source fails on every download in 2.4.12 / 2.4.13: Call to undefined method SimpleSAML\Utils\HTTP::createHttpClient()
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- php
- Domínio
- authentication, backend
Direção de pesquisa
Leia src/SimpleSAML/Metadata/Sources/MDQ.php perto de getMetaData() na linha 330 e siga a chamada de download até Utils\HTTP::fetch(). A issue identifica uma chamada não utilizada a createHttpClient() que causa problemas no branch 2.4; remova-a e considere se o utilitário HTTP injetado deve tratar fetch(). O trabalho estará concluído quando uma consulta MDQ sem cache baixar metadados e aplicar as verificações de entityID no 2.4.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Since v2.4.12, the mdq metadata source (SimpleSAML\Metadata\Sources\MDQ) can no longer download metadata. Every lookup that is not already in the cache fails with:
Error: Call to undefined method SimpleSAML\Utils\HTTP::createHttpClient()
The call came with the backport of the MDQ entityID checks in 8e1190360 ("Merge commit from fork"). That commit added this to MDQ::getMetaData() (src/SimpleSAML/Metadata/Sources/MDQ.php:330):
$client = $this->httpUtils->createHttpClient([
'headers' => ['Accept' => 'application/samlmetadata+xml'],
]);
Utils\HTTP::createHttpClient() exists only in 2.5. On the 2.4 branch the method does not exist, and $client is never used: the metadata is still downloaded a few lines below with $httpUtils->fetch($mdq_url, $context), through a
separately created Utils\HTTP instance.
The tests added in the same commit injected a Utils\HTTP double that defines createHttpClient(), so they passed. They were removed from the legacy branch in f82c9b207, so nothing covers this code path with the real Utils\HTTP class.
Because Error is not an Exception, the catch (Exception $e) around the download does not catch it either. The whole metadata lookup aborts, and every IdP or SP that comes only from MDQ becomes unusable (e.g. login via eduGAIN fails).
Affected versions: v2.4.12, v2.4.13 (v2.4.11 is not affected).
Steps to reproduce
- Configure an MDQ source, e.g.:
'metadata.sources' => [
[
'type' => 'mdq',
'server' => 'https://mdq.aai.dfn.de',
'validateCertificate' => '/path/to/mdq-signer.crt',
'cachedir' => '/tmp/mdq-cache',
],
], - With an empty cache directory, look up any entity:
$handler = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler();
$handler->getMetaData('https://idp.example.org/idp/shibboleth', 'saml20-idp-remote'); - Result: Error: Call to undefined method SimpleSAML\Utils\HTTP::createHttpClient().
Expected behaviour: the metadata is downloaded with Utils\HTTP::fetch(), as in v2.4.11, and the new entityID checks are applied.
Suggested fix (2.4 branch): remove the unused statement:
-
$client = $this->httpUtils->createHttpClient([ -
'headers' => ['Accept' => 'application/samlmetadata+xml'], -
]);
Optionally, use the injected $this->httpUtils for the fetch() call instead of new Utils\HTTP(), so that setHttpUtils() actually affects the download and the code path can be tested.
Workaround until a fix is released: subclass the source (in a module) and, after parent::__construct(), call setHttpUtils() with a Utils\HTTP subclass that defines a no-op createHttpClient(). This restores the 2.4.11 download path and
keeps the entityID checks.
- Linguagem predominante
- PHP
- Estrelas
- 1.1k
- Forks
- 704
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de simplesamlphp/simplesamlphp
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 15/100
simplesamlphp/simplesamlphp#2691 · 3 comentários ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
simplesamlphp/simplesamlphp#2690 · 3 comentários ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
simplesamlphp/simplesamlphp#2689 · 8 comentários ·
-
Release tarball contains deprecated Twig includesTalvez já em andamento @Sharawey74 assumiu há 62 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
simplesamlphp/simplesamlphp#2687 · 1 comentário ·
-
Confirmed enhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
simplesamlphp/simplesamlphp#2664 · 2 comentários ·
Todas as issues de simplesamlphp/simplesamlphp
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Adyen/adyen-magento2#3453 ·
Mantenedores costumam responder em até 8 dias
-
component/media domain/discovery
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 1 dia
-
bug docker
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia