diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-08-06 18:04:38 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-08-06 18:04:38 -0300 |
commit | baf3738bec7a712f90316f79255d4c91259e3fdf (patch) | |
tree | eebefcc413069741e61933e3a647768e15a81635 /src/leap/services/mail/smtpspec.py | |
parent | 275109e17f53c2fceb21d6f87626762800f53e22 (diff) |
Add multiple schemas support for SMTP
Diffstat (limited to 'src/leap/services/mail/smtpspec.py')
-rw-r--r-- | src/leap/services/mail/smtpspec.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/leap/services/mail/smtpspec.py b/src/leap/services/mail/smtpspec.py index 270dfb76..9fc1984a 100644 --- a/src/leap/services/mail/smtpspec.py +++ b/src/leap/services/mail/smtpspec.py @@ -15,7 +15,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -smtp_config_spec = { +# Schemas dict +# To add a schema for a version you should follow the form: +# { '1': schema_v1, '2': schema_v2, ... etc } +# so for instance, to add the '2' version, you should do: +# eipservice_config_spec['2'] = schema_v2 +smtp_config_spec = {} + +smtp_config_spec['1'] = { 'description': 'sample smtp service config', 'type': 'object', 'properties': { @@ -49,3 +56,15 @@ smtp_config_spec = { } } } + + +def get_schema(version): + """ + Returns the schema corresponding to the version given. + + :param version: the version of the schema to get. + :type version: str + :rtype: dict or None if the version is not supported. + """ + schema = smtp_config_spec.get(version, None) + return schema |