summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Utils
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #433 from thijskh/feature/deprecate-certFingerprintJaime Pérez Crespo2016-09-141-2/+2
|\ | | | | Deprecate the certFingerprint option.
| * Deprecate the certFingerprint option.Thijs Kinkhorst2016-08-051-2/+2
| | | | | | | | | | | | Issue a notice when the option is used nonetheless. Closes: #432
* | bugfix: Do not try to apply SSP's base URL if REQUEST_URI does not match.Jaime Pérez2016-08-221-9/+26
| | | | | | | | It is possible that the current script ($_SERVER['SCRIPT_FILENAME']) is inside SimpleSAMLphp's 'www' directory. However, even if that's the case, we should not enforce our base URL (as set in the 'baseurlpath' configuration option) if the request URI ($_SERVER['REQUEST_URI']) does not contain the relative path to the script. This is the case of AuthMemCookie, for example, where accessing a random URL protected by Apache, leads to the execution of a SimpleSAMLphp script, where SimpleSAML\Utils\HTTP::getSelfURL() must not try to be smart when guessing the current URL.
* | Make the 'debug' configuration option more fine-grained.Jaime Pérez2016-08-101-6/+20
|/ | | | | | | | Some things, like logging of SAML messages or backtraces, are controlled with the 'debug' configuration option. However, it might be possible that we don't want one while we want the other, but that's impossible with just one option. This commit allows us to configure debugging options independently, but groupping all of them together. This is particularly useful if we want to log backtraces to debug errors, for example, but we don't want to log SAML messages to keep the privacy of the users. This also allows us to get rid of the 'debug.validatexml' configuration option, and group it with other debug options. This changes are backwards-compatible. Old and new configurations will work at the same time.
* Bump the version of the SAML2 library.Jaime Pérez2016-07-261-2/+2
| | | | Now we are finally using the 2.x branch of the SAML2 library, which was also migrated to use namespaces. Even though the library provides an autoloader that allows loading the classes with the old names using class aliasing, we need to do the migration in one commit (at least for most part of it). This is due to the way SimpleSAMLphp checks data types, using inheritance to check objects agains abstract or more general classes. Even though class aliasing works, there's no way to replicate those relationships, and type checks that use the old class names will fail because the aliases are virtually new classes that don't inherit from others.
* Removed unnecessary exceptionSergio Gomez2016-07-201-2/+1
|
* bugfix: Restore the capability to get our self URL when invoked from a ↵Jaime Pérez2016-07-151-9/+25
| | | | | | | | | | third-party script. Recent fixes for URL guessing and building addressed bugs in the code that were preventing the 'baseurlpath' from being used properly. However, they introduced a new issue, as the code was assuming the current URL would always point to a SimpleSAMLphp script. This is not always true, of course, as any script can invoke our API and end up trying to get its own URL (for example, when calling requireAuth()). In order to fix this, we monitor mismatches between SimpleSAMLphp's installation path and the absolute, real path to the current script. When there's a mismatch, it means we are running a third-party script outside SimpleSAMLphp, and therefore we should NOT enforce 'baseurlpath'. This introduces an additional issue, as applications behind a reverse proxy may cause trouble to guess the right URL (we will use the URL as seen by SimpleSAMLphp in the server, which is not necessarily the same as the user sees with a reverse proxy in between). For the moment, we'll leave the responsibility to sort that issue out to implementors. It might be a good idea to add a page to the wiki explaining how to do this. This resolves #418.
* bugfix: Restore support for windows machines.Jaime Pérez2016-07-051-1/+5
| | | | | | Due to recent changes to fix the way we were building URLs (mixing what the 'baseurlpath' configuration option and the current URL, see #396), we introduced another bug by assuming file paths will always use slashes ('/'), which obviously is not true in Windows machines. This commit fixes SimpleSAML_Configuration::getBaseDir() and SimpleSAML\Utils\HTTP::getSelfURL() to take that into account. This closes #414.
* Enhance redirections and make them more resilient.Jaime Pérez2016-07-041-6/+8
| | | | Currently, if headers have already been sent, a redirection will fail and generate errors in the error log. The user will be presented with a page containing a link that he or she will need to click on. Checking if headers have already been sent we can avoid errors, and adding a simple javascript to the "onload" event in the body of the page, we can still redirect automatically. That way, only when headers have already been sent and the users have javascript disabled, they will get to see the page.
* Start using the error codes in SimpleSAML\Error\CannotSetCookie.Jaime Pérez2016-07-041-4/+12
| | | | Both SimpleSAML_SessionHandlerPHP::setCookie() and SimpleSAML\Utils\HTTP::setCookie() throw the SimpleSAML\Error\CannotSetCookie exception. Depending on why the error was generated, set the error code in the exception accordingly.
* Make the SimpleSAML\Utils\HTTP::setCookie() method throw the new ↵Jaime Pérez2016-07-021-2/+2
| | | | SimpleSAML\Error\CannotSetCookie exception.
* Silence errors when setting a cookie.Jaime Pérez2016-07-021-2/+2
|
* bugfix: Resolve issue with incorrect self URL when using symlinks.Jaime Pérez2016-06-271-1/+1
| | | | Recent commits have introduced a new way to obtain the self URL, honouring whatever is specified in 'baseurlpath'. However, this new code breaks when accessing SimpleSAMLphp through a path containing symbolic links in the file system, since the base directory refers always to the real path while the $_SERVER contents reflect what the web server sees (symlinks included). We use realpath() to convert a path with symlinks to a canonical path that we can compare.
* Stop using the deprecated SimpleSAML_Configuration::getBaseURL() method.Jaime Perez Crespo2016-06-081-1/+1
|
* Fix build. There was a bug in SimpleSAML\Utils\HTTP::parseQueryString() that ↵Jaime Perez Crespo2016-06-081-0/+4
| | | | was producing an empty parameter with an empty value when the query string was empty.
* Change the implementation of SimpleSAML\Utils\HTTP::getSelfURL() and ↵Jaime Perez Crespo2016-06-081-26/+18
| | | | getSelfURLNoQuery() to honor the 'baseurlpath' configuration option instead of simply using the environment. They were actually broken since they were using it to build the scheme, host and port, but completely ignoring the path, rendering wrong URLs in between what was configured in 'baseurlpath' and the real information in the environment. This resolves #396, but also affects #5. The changes to getSelfURLNoQuery() in #391 are unnecessary now, since we now basically getting the full URL and remove the query afterwards.
* Minor change to enhance code clarity.Jaime Perez Crespo2016-06-071-4/+3
|
* Be graceful with the 'baseurlpath' configuration option. We should not fail ↵Jaime Perez Crespo2016-06-071-2/+2
| | | | when the trailing slash is missing, just add it.
* Fix an issue with some PHP environments (mostly related to FastCGI or ↵Jaime Perez Crespo2016-06-031-1/+9
| | | | php-fpm, common with nginx) where $_SERVER['SCRIPT_NAME'] is already populated with $_SERVER['PATH_INFO'] appended to it. In those cases, we should not blindly append PATH_INFO to SCRIPT_NAME, but check the latter first. This hopefully resolves #5 and closes #391.
* Allow regular expression matching of trusted.url.domains.Jon Dufresne2016-06-011-3/+21
| | | | Fixes #379
* Start using the new configuration exceptions, handling error situations that ↵Jaime Perez Crespo2016-04-201-3/+11
| | | | before led to blank pages or even worse.
* If $_SERVER does not contain the variables we need (i.e. when running tests) ↵Jaime Perez Crespo2016-04-191-4/+7
| | | | it makes no sense at all to try to guess the root URI, since there's no such a thing, probably.
* Add a method that tries to guess the base URI path.Jaime Perez Crespo2016-04-181-0/+30
|
* Update the classes in lib/SimpleSAML/ too.Jaime Perez Crespo2016-03-091-2/+2
|
* Bugfix: do not set the timezone as initialized if it wasn't!Jaime Perez Crespo2016-03-041-5/+11
|
* No need to disable the error handler momentarily when guessing the timezone ↵Jaime Perez Crespo2016-03-041-10/+4
| | | | from the OS. Mask errors instead.
* Complete the coverage for SimpleSAML\Utils\Time::parseDuration().Jaime Perez Crespo2016-03-041-1/+2
|
* Minor formatting issues.Jaime Perez Crespo2016-03-033-15/+27
|
* Some more fixes for the new SimpleSAML\Module and SimpleSAML\Logger.Jaime Perez Crespo2016-03-032-9/+11
|
* Initial test for SimpleSAML\Utils\Time.Jaime Perez Crespo2016-03-031-2/+3
|
* Fix a couple formatting issues in SimpleSAML\Utils\HTTP. Start using ↵Jaime Perez Crespo2016-03-031-15/+31
| | | | SimpleSAML\Module and SimpleSAML\Logger in there.
* Fix build for older PHP versions that don't allow passing return values as a ↵Jaime Perez Crespo2016-03-031-1/+2
| | | | reference to a function.
* Bugfix: there's a couple of places in SimpleSAML\Utils\HTTP where we should ↵Jaime Perez Crespo2016-03-031-2/+2
| | | | use the host AND port if the latter is not the default one, but we are only using the host. These are the case for evaluating the 'trusted.url.domains' configuration options (we should allow the host and port we are reachable in, but not other ports in the same host) and the method that returns the host with path, which should include the port if that's not standard (the documentation of the method already says so).
* Rename Utils\HTTP::getSelfHostWithoutPort() to ↵Jaime Perez Crespo2016-03-031-13/+16
| | | | Utils\HTTP::getSelfHostWithNonStandardPort(), change the logic, and reimplement Utils\HTTP::getSelfHost() to depend on use the former. Complete the tests to include the case of port 443 while using HTTPS.
* Fixes issue 337Andrés Blanco2016-03-021-2/+16
|
* Take #2. Use the recently migrated SimpleSAML_Logger::maskErrors() and ↵Jaime Perez Crespo2016-02-261-24/+6
| | | | popErrorMask() methods to simplify code un SimpleSAML\Utils\Config\Metadata.
* Desist on the optimization introduced in d32eb4a, it doesn't work.Jaime Perez Crespo2016-02-161-4/+24
|
* Silence failures we don't care about.Jaime Perez Crespo2016-02-161-1/+1
|
* Make SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery() resilient to ↵Jaime Perez Crespo2016-02-031-5/+4
| | | | all kinds of failures.
* Minor optimalization - Don't gather settings if we don't use themTim van Dijen2016-01-191-1/+1
| | | Don't gather the proxy.auth setting if we don't use it
* Update HTTP.phprestena-sw2016-01-151-1/+1
|
* Update HTTP.phprestena-sw2016-01-151-1/+6
|
* Clean one-liner comments.Jaime Perez Crespo2015-11-061-2/+2
|
* s/simpleSAMLphp/SimpleSAMLphp/gJaime Perez Crespo2015-11-061-1/+1
| | | | (being respectful with occurences that might change the behaviour, i.e. default database prefixes)
* Merge branch 'saml2-domdocumentfactory' of ↵Jaime Perez Crespo2015-10-211-4/+11
|\ | | | | | | https://github.com/sgomez/simplesamlphp into master
| * XML data is loaded using SAML2_DOMDocumentFactory classSergio Gómez2015-10-111-4/+11
| |
* | Make SimpleSAMLphp resilient to open redirections by default.Jaime Perez Crespo2015-10-211-6/+2
|/
* SimpleSAML\Utils\Attributes::getExpectedAttribute(): Check if the attribute ↵Jaime Perez Crespo2015-09-011-2/+6
| | | | has any values, and raise an exception if not.
* Refactor SimpleSAML\Utils\Arrays::normalizeAttributesArray() to ↵Jaime Perez Crespo2015-09-012-45/+49
| | | | SimpleSAML\Utils\Attributes::normalizeAttributesArray().
* Add a new \SimpleSAML\Utils\Attributes class.Jaime Perez Crespo2015-09-011-0/+57
|
* Avoid tests to fail.Jaime Perez Crespo2015-08-111-2/+0
|
* Merge branch 'master' of https://github.com/tldev/simplesamlphp into ↵Jaime Perez Crespo2015-08-111-1/+31
|\ | | | | | | feature/config-from-env
| * Moved logic pertaining to finding configdir to central location, added ↵Tom Johnell2015-06-101-1/+29
| | | | | | | | ability to set via environment variable
* | Avoid code duplication when checking if an entity should be hidden from ↵Jaime Perez Crespo2015-08-051-1/+42
| | | | | | | | discovery service.
* | Typo.Jaime Perez Crespo2015-08-041-1/+1
| |
* | Declare visibility of SimpleSAML\Utils\Net::ipCIDRcheck().Jaime Perez Crespo2015-07-311-1/+1
| |
* | Use the predefined rtrim() function instead of a while loop.Jaime Perez Crespo2015-07-311-4/+2
| |
* | Be explicit when checking if there's a salt defined or not.Jaime Perez Crespo2015-07-311-1/+1
| |
* | Fix undeclared variables.Jaime Perez Crespo2015-07-311-0/+2
| |
* | Reimplement \SimpleSAML\Utils\Crypto::aesDecrypt() and ↵Jaime Perez Crespo2015-07-201-51/+30
| | | | | | | | \SimpleSAML\Utils\Crypto::aesEncrypt() to use openssl instead of mcrypt. This removes the direct dependency on mcrypt and closes #228.
* | Move the aes[En|De]crypt() functionality in \SimpleSAML\Utils\Crypto to ↵Jaime Perez Crespo2015-06-201-9/+44
|/ | | | internal methods where the secret is passed as a parameter. Then we don't need a working configuration to test the functionality.
* Corrected logic in checkSessionCookieEnrico Cavalli2015-06-031-2/+2
| | | Raise InvalidArgumentException if $retryURL is not a string AND is not null
* Fix the phpdoc for SimpleSAML\Utils\Random::generateID() and add a constant ↵Jaime Perez Crespo2015-05-271-3/+8
| | | | with the length of generated IDs.
* Silence inet_ptonBrook Schofield2015-05-261-4/+4
| | | | inet_pton failure is captured later - silence so unit tests pass.
* Use InvalidArgumentException instead of SimpleSAML_Error_Exception when ↵Jaime Perez Crespo2015-04-238-74/+106
| | | | dealing with wrong input parameters.
* Move SimpleSAML_Utilities::resolveCert() to ↵Jaime Perez Crespo2015-04-232-3/+25
| | | | SimpleSAML\Utils\Config::getCertPath() and deprecate the former.
* Move SimpleSAML_Utilities::validateXMLDocument() to ↵Jaime Perez Crespo2015-04-231-2/+53
| | | | SimpleSAML\Utils\XML::checkSAMLMessage().
* Move SimpleSAML_Utilities::validateXML() to SimpleSAML\Utils\XML::isValid().Jaime Perez Crespo2015-04-231-0/+56
|
* Move SimpleSAML_Utils_Config_Metadata to SimpleSAML\Utils\Config\Metadata.Jaime Perez Crespo2015-04-231-11/+11
| | | | Deprecate SimpleSAML_Utilities::getDefaultEndpoint().
* Move SimpleSAML_Utilities::getDefaultEndpoint() to ↵Jaime Perez Crespo2015-04-231-9/+77
| | | | SimpleSAML_Utils_Config_Metadata.
* Move SimpleSAML_Utilities:: debugMessage() to ↵Jaime Perez Crespo2015-04-231-0/+55
| | | | SimpleSAML\Utils\HTTP::debugSAMLMessage() and deprecate the former.
* Move SimpleSAML_Utilities:: checkCookie() to ↵Jaime Perez Crespo2015-04-231-0/+32
| | | | SimpleSAML\Utils\HTTP::checkSessionCookie() and deprecate the former.
* SimpleSAML_Utilities::resolvePath was moved incorrectly to ↵Jaime Perez Crespo2015-04-222-54/+57
| | | | \SimpleSAML\Utils\HTTP instead of \SimpleSAML\Utils\System. Fix that.
* Move SimpleSAML_Utilities:: redirectUntrustedURL() to ↵Jaime Perez Crespo2015-04-221-0/+32
| | | | SimpleSAML\Utils\HTTP:: redirectUntrustedURL() and deprecate the former.
* Bugfix.Jaime Perez Crespo2015-04-221-3/+3
|
* Move SimpleSAML_Utilities:: checkURLAllowed() to SimpleSAML\Utils\HTTP:: ↵Jaime Perez Crespo2015-04-221-0/+48
| | | | checkURLAllowed() and deprecate the former.
* Move SimpleSAML_Utilities:: redirectTrustedURL() to SimpleSAML\Utils\HTTP:: ↵Jaime Perez Crespo2015-04-221-0/+33
| | | | redirectTrustedURL() and deprecate the former.
* Move SimpleSAML_Utilities:: setCookie() to SimpleSAML\Utils\HTTP:: ↵Jaime Perez Crespo2015-04-211-2/+76
| | | | setCookie() and deprecate the former.
* Move the createPostRedirectLink(), postRedirect() and ↵Jaime Perez Crespo2015-04-211-0/+121
| | | | createHttpPostRedirectLink() methods in SimpleSAML_Utilities to \SimpleSAML\Utils\HTTP. The last one is made private, the others are renamed to submitPOSTData() and getPOSTRedirectURL(), respectively. Deprecate the three old ones.
* Move SimpleSAML_Utilities::fetch() to SimpleSAML\Utils\HTTP::fetch() and ↵Jaime Perez Crespo2015-04-211-0/+90
| | | | deprecate the former.
* Move SimpleSAML_Utilities::isHTTPS() to SimpleSAML\Utils\HTTP::isHTTPS() and ↵Jaime Perez Crespo2015-04-211-0/+14
| | | | deprecate the former.
* Move SimpleSAML_Utilities::normalizeURL() to ↵Jaime Perez Crespo2015-04-211-0/+29
| | | | SimpleSAML\Utils\HTTP::normalizeURL() and deprecate the former.
* Move SimpleSAML_Utilities::resolveURL() to ↵Jaime Perez Crespo2015-04-211-0/+87
| | | | SimpleSAML\Utils\HTTP::resolveURL() and deprecate the former.
* Move SimpleSAML_Utilities::selfURLNoQuery() to ↵Jaime Perez Crespo2015-04-211-4/+22
| | | | SimpleSAML\Utils\HTTP::getSelfURLNoQuery() and deprecate the former.
* Move SimpleSAML_Utilities::selfURL() to SimpleSAML\Utils\HTTP::getSelfURL() ↵Jaime Perez Crespo2015-04-212-1/+23
| | | | and deprecate the former.
* Move SimpleSAML_Utilities::selfURLhost() to ↵Jaime Perez Crespo2015-04-211-0/+17
| | | | SimpleSAML\Utils\HTTP::getSelfURLHost() and deprecate the former.
* Move SimpleSAML_Utilities::getFirstPathElement() to ↵Jaime Perez Crespo2015-04-211-0/+18
| | | | SimpleSAML\Utils\HTTP::getFirstPathElement() and deprecate the former.
* Move SimpleSAML_Utilities::getSelfHostWithPath() to ↵Jaime Perez Crespo2015-04-211-1/+19
| | | | SimpleSAML\Utils\HTTP::getSelfHostWithPath() and deprecate the former.
* Move SimpleSAML_Utilities::getSelfHost() to ↵Jaime Perez Crespo2015-04-211-0/+19
| | | | SimpleSAML\Utils\HTTP::getSelfHost() and deprecate the former.
* Move SimpleSAML_Utilities:::getAcceptLanguage() to ↵Jaime Perez Crespo2015-04-211-0/+68
| | | | SimpleSAML\Utils\HTTP::getAcceptLanguage() and deprecate the former.
* Move SimpleSAML_Utilities:::getBaseURL() to ↵Jaime Perez Crespo2015-04-211-0/+41
| | | | SimpleSAML\Utils\HTTP::getBaseURL() and deprecate the former.
* Move SimpleSAML_Utilities:::resolvePath() to ↵Jaime Perez Crespo2015-04-211-0/+53
| | | | SimpleSAML\Utils\HTTP::resolvePath() and deprecate the former.
* Move SimpleSAML_Utilities:::doRedirect() to SimpleSAML\Utils\HTTP::redirect().Jaime Perez Crespo2015-04-211-24/+102
|
* Move SimpleSAML_Utilities::addURLparameter() to ↵Jaime Perez Crespo2015-04-211-1/+41
| | | | SimpleSAML\Utils\HTTP::addURLParameters() and deprecate the former.
* Move SimpleSAML_Utilities::parseQueryString() to ↵Jaime Perez Crespo2015-04-211-0/+36
| | | | SimpleSAML\Utils\HTTP::parseQueryString() and deprecate the former.
* Move SimpleSAML_Utilities::getServerHosst(), getServerHTTPS() and ↵Jaime Perez Crespo2015-04-211-0/+90
| | | | getServerPort() to SimpleSAML\Utils\HTTP.
* Fix namespaces.Jaime Perez Crespo2015-04-201-9/+9
|
* Move SimpleSAML_Utils_Crypto to SimpleSAML\Utils\Crypto.Jaime Perez Crespo2015-04-201-27/+28
|
* Move SimpleSAML_Utils_Arrays to SimpleSAML\Utils\Arrays.Jaime Perez Crespo2015-04-201-6/+6
|
* Move SimpleSAML_Utils_Auth to SimpleSAML\Utils\Auth.Jaime Perez Crespo2015-04-201-9/+9
|