Skip to content

Commit

Permalink
Use underscores instead of camelcase to be consistent. Note, this is …
Browse files Browse the repository at this point in the history
…a backwards incompatible API change, but this API hasn't been formally specced yet anyway.
  • Loading branch information
dbkr committed Apr 24, 2015
1 parent 5abc90b commit e39348e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions sydent/http/servlets/emailservlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ def __init__(self, syd):
def render_POST(self, request):
send_cors(request)

error = require_args(request, ('email', 'clientSecret', 'sendAttempt'))
error = require_args(request, ('email', 'client_secret', 'send_attempt'))
if error:
return error

email = request.args['email'][0]
clientSecret = request.args['clientSecret'][0]
sendAttempt = request.args['sendAttempt'][0]
clientSecret = request.args['client_secret'][0]
sendAttempt = request.args['send_attempt'][0]
ipaddress = self.sydent.ip_from_request(request)

nextLink = None
if 'nextLink' in request.args:
nextLink = request.args['nextLink'][0]
if 'next_link' in request.args:
nextLink = request.args['next_link'][0]

resp = None

Expand Down Expand Up @@ -99,13 +99,13 @@ def render_POST(self, request):
def do_validate_request(self, request):
send_cors(request)

err = require_args(request, ('token', 'sid', 'clientSecret'))
err = require_args(request, ('token', 'sid', 'client_secret'))
if err:
return err

sid = request.args['sid'][0]
tokenString = request.args['token'][0]
clientSecret = request.args['clientSecret'][0]
clientSecret = request.args['client_secret'][0]

try:
resp = self.sydent.validators.email.validateSessionWithToken(sid, clientSecret, tokenString)
Expand Down
6 changes: 3 additions & 3 deletions sydent/http/servlets/getvalidated3pidservlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def __init__(self, syd):

@jsonwrap
def render_GET(self, request):
err = require_args(request, ('sid', 'clientSecret'))
err = require_args(request, ('sid', 'client_secret'))
if err:
return err

sid = request.args['sid'][0]
clientSecret = request.args['clientSecret'][0]
clientSecret = request.args['client_secret'][0]

valSessionStore = ThreePidValSessionStore(self.sydent)

Expand All @@ -56,4 +56,4 @@ def render_GET(self, request):
return {'errcode': 'M_SESSION_NOT_VALIDATED',
'error': "This validation session has not yet been completed"}

return { 'medium': s.medium, 'address': s.address, 'validatedAt': s.mtime }
return { 'medium': s.medium, 'address': s.address, 'validated_at': s.mtime }
4 changes: 2 additions & 2 deletions sydent/http/servlets/threepidbindservlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def __init__(self, sydent):
@jsonwrap
def render_POST(self, request):
send_cors(request)
err = require_args(request, ('sid', 'clientSecret', 'mxid'))
err = require_args(request, ('sid', 'client_secret', 'mxid'))
if err:
return err

sid = request.args['sid'][0]
clientSecret = request.args['clientSecret'][0]
clientSecret = request.args['client_secret'][0]
mxid = request.args['mxid'][0]

# Return the same error for not found / bad client secret otherwise people can get information about
Expand Down
2 changes: 1 addition & 1 deletion sydent/validators/emailvalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def requestToken(self, emailAddress, clientSecret, sendAttempt, nextLink, ipaddr

def makeValidateLink(self, valSession, clientSecret, nextLink):
base = self.sydent.cfg.get('http', 'client_http_base')
link = "%s/_matrix/identity/api/v1/validate/email/submitToken?token=%s&clientSecret=%s&sid=%d" % (
link = "%s/_matrix/identity/api/v1/validate/email/submitToken?token=%s&client_secret=%s&sid=%d" % (
base,
urllib.quote(valSession.token),
urllib.quote(clientSecret),
Expand Down

0 comments on commit e39348e

Please sign in to comment.