Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isleshocky77/sfsslrequirementplugin
Git Mirror of Symfony's sfSslRequirementPlugin svn repository
https://github.com/isleshocky77/sfsslrequirementplugin
Last synced: 8 days ago
JSON representation
Git Mirror of Symfony's sfSslRequirementPlugin svn repository
- Host: GitHub
- URL: https://github.com/isleshocky77/sfsslrequirementplugin
- Owner: isleshocky77
- License: mit
- Created: 2011-05-28T22:16:19.000Z (over 13 years ago)
- Default Branch: 1.3
- Last Pushed: 2014-01-03T06:40:49.000Z (almost 11 years ago)
- Last Synced: 2023-04-10T13:51:10.224Z (over 1 year ago)
- Language: PHP
- Homepage: http://www.symfony-project.org/plugins/sfSslRequirementPlugin
- Size: 121 KB
- Stars: 2
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
= sfSslRequirement plugin (for symfony 1.1) =
The `sfSslRequirement` is a symfony plugin that provides SSL encryption support for your module actions.
It gives you 2 new security settings: `require_ssl` and `allow_ssl`.
The plugin also adds 2 new `sfAction` methods: `->sslRequired()` and `->sslAllowed()`.
== Logic ==
Only execute once per request and SF_ENVIRONMENT in one of the environments configured in app_disable_sslfilter
* if not posting
* if secured
* then check if its allowed else redirect from https to http
* else if secured required redirect from http to https== Installation ==
* Install the plugin
{{{
symfony plugin:install symfony/sfSslRequirementPlugin
}}}* Activate the filter in your `filters.yml`
{{{
sfSslRequirement:
class: sfSslRequirementFilter
}}}* Clear your cache
{{{
symfony cc
}}}=== Secure your application ===
To force SSL on an action:
* Add the following snippet to the module `security.yml`:
{{{
sslAction:
require_ssl: true
}}}* You're done. Now, if you try to access the `sslAction` with HTTP, you will be automatically redirected to HTTPS.
* The `sslAction` listed here is an example. Substitute with your actual action name.