summaryrefslogtreecommitdiff
path: root/src/leap/base
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-12-15 02:25:50 +0900
committerkali <kali@leap.se>2012-12-15 02:25:50 +0900
commit5e7ca61cfd942404663e68d2d4eae062dfbc66bc (patch)
tree1540883cdc002930210365c4d2e975a93b2a7989 /src/leap/base
parentf3cbae1d2c14e2ff22888d4fc83d03ec6c452541 (diff)
parent914a07aaf8ef52b2eaf88f1bf01fb6f72adcac5a (diff)
Merge branch 'feature/eip-service-formatchange' into develop
Diffstat (limited to 'src/leap/base')
-rw-r--r--src/leap/base/auth.py14
-rw-r--r--src/leap/base/specs.py16
-rw-r--r--src/leap/base/tests/test_providers.py6
3 files changed, 23 insertions, 13 deletions
diff --git a/src/leap/base/auth.py b/src/leap/base/auth.py
index 73856bb0..c6bd3518 100644
--- a/src/leap/base/auth.py
+++ b/src/leap/base/auth.py
@@ -43,7 +43,7 @@ class LeapSRPRegister(object):
def __init__(self,
schema="https",
provider=None,
- port=None,
+ #port=None,
verify=True,
register_path="1/users.json",
method="POST",
@@ -57,8 +57,8 @@ class LeapSRPRegister(object):
self.schema = schema
# XXX FIXME
- self.provider = provider
- self.port = port
+ #self.provider = provider
+ #self.port = port
# XXX splitting server,port
# deprecate port call.
domain, port = get_https_domain_and_port(provider)
@@ -255,6 +255,7 @@ class SRPAuth(requests.auth.AuthBase):
try:
assert self.srp_usr.authenticated()
logger.debug('user is authenticated!')
+ print 'user is authenticated!'
except (AssertionError):
raise SRPAuthenticationError(
"Auth verification failed.")
@@ -355,8 +356,11 @@ if __name__ == "__main__":
req.raise_for_status
return req
- req = test_srp_protected_get('https://localhost:8443/1/cert')
- print 'cert :', req.content[:200] + "..."
+ #req = test_srp_protected_get('https://localhost:8443/1/cert')
+ req = test_srp_protected_get('%s/1/cert' % SERVER)
+ import ipdb;ipdb.set_trace()
+ #print 'cert :', req.content[:200] + "..."
+ print 'cert :', req.content
sys.exit(0)
if action == "add":
diff --git a/src/leap/base/specs.py b/src/leap/base/specs.py
index b4bb8dcf..962aa07d 100644
--- a/src/leap/base/specs.py
+++ b/src/leap/base/specs.py
@@ -2,22 +2,26 @@ leap_provider_spec = {
'description': 'provider definition',
'type': 'object',
'properties': {
- 'serial': {
- 'type': int,
- 'default': 1,
- 'required': True,
- },
+ #'serial': {
+ #'type': int,
+ #'default': 1,
+ #'required': True,
+ #},
'version': {
'type': unicode,
'default': '0.1.0'
#'required': True
},
+ "default_language": {
+ 'type': unicode,
+ 'default': 'en'
+ },
'domain': {
'type': unicode, # XXX define uri type
'default': 'testprovider.example.org'
#'required': True,
},
- 'display_name': {
+ 'name': {
'type': dict, # XXX multilingual object?
'default': {u'en': u'Test Provider'}
#'required': True
diff --git a/src/leap/base/tests/test_providers.py b/src/leap/base/tests/test_providers.py
index d9604fab..8801a3eb 100644
--- a/src/leap/base/tests/test_providers.py
+++ b/src/leap/base/tests/test_providers.py
@@ -16,10 +16,12 @@ from leap.base import providers
EXPECTED_DEFAULT_CONFIG = {
u"api_version": u"0.1.0",
u"description": {u'en': u"Test provider"},
- u"display_name": {u'en': u"Test Provider"},
+ u"default_language": u"en",
+ #u"display_name": {u'en': u"Test Provider"},
u"domain": u"testprovider.example.org",
+ u'name': {u'en': u'Test Provider'},
u"enrollment_policy": u"open",
- u"serial": 1,
+ #u"serial": 1,
u"services": [
u"eip"
],