Skip to content
This repository has been archived by the owner on Feb 18, 2019. It is now read-only.

Commit

Permalink
some docstring/comment cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
rfk committed Jan 5, 2012
1 parent 4eb2cac commit 0071d6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 3 additions & 4 deletions vep/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def decode_bytes(value):
meaning we can't use the stdlib routines to decode them directly. This
is a simple wrapper that adds the padding back in.
If the value is not correctly encoded, ValueErro will be raised.
If the value is not correctly encoded, ValueError will be raised.
"""
if isinstance(value, unicode):
value = value.encode("ascii")
Expand Down Expand Up @@ -129,8 +129,8 @@ def bundle_certs_and_assertion(certificates, assertion, new_style=True):
def unbundle_certs_and_assertion(bundle):
"""Unbundle certificates and assertion from a single string.
This function parse a VEP "bundled assertion" into the contained chain of
certificates and final assertion. The return value is returns a tuple
This function parse a VEP "bundled assertion" into the contained chain
of certificates and final assertion. The returned value is a tuple
(certificates, assertion).
"""
if "~" in bundle:
Expand All @@ -157,7 +157,6 @@ def get_assertion_info(assertion):
then ValueError will be raised.
"""
info = {}
# Decode the bundled-assertion envelope.
try:
certificates, assertion = unbundle_certs_and_assertion(assertion)
# Get the asserted principal out of the certificate chain.
Expand Down
4 changes: 3 additions & 1 deletion vep/verifiers/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def verify(self, assertion, audience=None, now=None):
if now is None:
now = int(time.time() * 1000)
# This catches KeyError and turns it into ValueError.
# It saves having to test for the existence of individual
# items in the various assertion payloads.
try:
certificates, assertion = unbundle_certs_and_assertion(assertion)
# Check that the assertion is usable and valid.
Expand Down Expand Up @@ -144,7 +146,7 @@ def get_public_key(self, hostname):
locally then it calls fetch_public_key() to retreive it.
This function uses the well-known host meta-data file to locate and
download the public key for the given hostname. It keeps a cache
in memory to avoid hitting the internet for every check.
in memory to avoid hitting the network for every check.
"""
# TODO: periodically expire the cache
try:
Expand Down

0 comments on commit 0071d6c

Please sign in to comment.