@Override
    public SamlIdPMetadataDocument fetchInternal(final Optional<SamlRegisteredService> registeredService) throws Exception {
        if (gitRepository.pull()) {
            LOGGER.debug("Successfully pulled metadata changes from the remote repository");
        } else {
            LOGGER.warn("Unable to pull changes from the remote repository. Metadata files may be stale.");
        }

        val metadataFile = getMetadataArtifactFile(registeredService, "idp-metadata.xml");
        LOGGER.trace("IdP metadata file to use is [{}]", metadataFile);

        val signingKey = getMetadataArtifactFile(registeredService, "idp-signing.key");
        LOGGER.trace("IdP metadata signing key file to use is [{}]", metadataFile);

        val signingCert = getMetadataArtifactFile(registeredService, "idp-signing.crt");
        LOGGER.trace("IdP metadata signing certificate file to use is [{}]", metadataFile);

        val encryptionKey = getMetadataArtifactFile(registeredService, "idp-encryption.key");
        LOGGER.trace("IdP metadata encryption key file to use is [{}]", metadataFile);

        val encryptionCert = getMetadataArtifactFile(registeredService, "idp-encryption.crt");
        LOGGER.trace("IdP metadata encryption certificate file to use is [{}]", metadataFile);

        return SamlIdPMetadataDocument.builder()
            .appliesTo(getAppliesToFor(registeredService))
            .encryptionCertificate(readFromFile(encryptionCert))
            .encryptionKey(readFromFile(encryptionKey))
            .signingCertificate(readFromFile(signingCert))
            .signingKey(readFromFile(signingKey))
            .metadata(readFromFile(metadataFile))
            .build();
    }
This is {@link GitSamlIdPMetadataLocator}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-saml-idp-metadata-git/src/main/java/org/apereo/cas/support/saml/idp/metadata/GitSamlIdPMetadataLocator.java