← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1431669] [NEW] Create saml assertion doesn't work with fernet token

 

Public bug reported:

TypeError: token must be bytes.
(keystone.common.wsgi): 2015-03-13 03:04:16,968 ERROR token must be bytes.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/keystone/common/wsgi.py", line 238, in __call__
    result = method(context, **params)
  File "/usr/local/lib/python2.7/dist-packages/keystone/common/validation/__init__.py", line 36, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keystone/contrib/federation/controllers.py", line 328, in create_saml_assertion
    token_data = self.token_provider_api.validate_token(token_id)
  File "/usr/local/lib/python2.7/dist-packages/keystone/token/provider.py", line 196, in validate_token
    token = self._validate_token(unique_id)
  File "/usr/local/lib/python2.7/dist-packages/dogpile/cache/region.py", line 1040, in decorate
    should_cache_fn)
  File "/usr/local/lib/python2.7/dist-packages/dogpile/cache/region.py", line 651, in get_or_create
    async_creator) as value:
  File "/usr/local/lib/python2.7/dist-packages/dogpile/core/dogpile.py", line 158, in __enter__
    return self._enter()
  File "/usr/local/lib/python2.7/dist-packages/dogpile/core/dogpile.py", line 98, in _enter
    generated = self._enter_create(createdtime)
  File "/usr/local/lib/python2.7/dist-packages/dogpile/core/dogpile.py", line 149, in _enter_create
    created = self.creator()
  File "/usr/local/lib/python2.7/dist-packages/dogpile/cache/region.py", line 619, in gen_value
    created_value = creator()
  File "/usr/local/lib/python2.7/dist-packages/dogpile/cache/region.py", line 1036, in creator
    return fn(*arg, **kw)
  File "/usr/local/lib/python2.7/dist-packages/keystone/token/provider.py", line 257, in _validate_token
    return self.driver.validate_v3_token(token_id)
  File "/usr/local/lib/python2.7/dist-packages/keystone/token/providers/fernet/core.py", line 150, in validate_v3_token
    token_formatter.validate_token(token_str))
  File "/usr/local/lib/python2.7/dist-packages/keystone/token/providers/fernet/token_formatters.py", line 223, in validate_token
    payload = self.unpack(token_string)
  File "/usr/local/lib/python2.7/dist-packages/keystone/token/providers/fernet/token_formatters.py", line 125, in unpack
    decrypted_token = self.crypto.decrypt(token_string)
  File "/usr/local/lib/python2.7/dist-packages/cryptography/fernet.py", line 138, in decrypt
    return f.decrypt(msg, ttl)
  File "/usr/local/lib/python2.7/dist-packages/cryptography/fernet.py", line 75, in decrypt
    raise TypeError("token must be bytes.")
TypeError: token must be bytes.

** Affects: keystone
     Importance: Undecided
         Status: New


** Tags: fernet

** Tags added: fernet

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1431669

Title:
  Create saml assertion doesn't work with fernet token

Status in OpenStack Identity (Keystone):
  New

Bug description:
  TypeError: token must be bytes.
  (keystone.common.wsgi): 2015-03-13 03:04:16,968 ERROR token must be bytes.
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/keystone/common/wsgi.py", line 238, in __call__
      result = method(context, **params)
    File "/usr/local/lib/python2.7/dist-packages/keystone/common/validation/__init__.py", line 36, in wrapper
      return func(*args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/keystone/contrib/federation/controllers.py", line 328, in create_saml_assertion
      token_data = self.token_provider_api.validate_token(token_id)
    File "/usr/local/lib/python2.7/dist-packages/keystone/token/provider.py", line 196, in validate_token
      token = self._validate_token(unique_id)
    File "/usr/local/lib/python2.7/dist-packages/dogpile/cache/region.py", line 1040, in decorate
      should_cache_fn)
    File "/usr/local/lib/python2.7/dist-packages/dogpile/cache/region.py", line 651, in get_or_create
      async_creator) as value:
    File "/usr/local/lib/python2.7/dist-packages/dogpile/core/dogpile.py", line 158, in __enter__
      return self._enter()
    File "/usr/local/lib/python2.7/dist-packages/dogpile/core/dogpile.py", line 98, in _enter
      generated = self._enter_create(createdtime)
    File "/usr/local/lib/python2.7/dist-packages/dogpile/core/dogpile.py", line 149, in _enter_create
      created = self.creator()
    File "/usr/local/lib/python2.7/dist-packages/dogpile/cache/region.py", line 619, in gen_value
      created_value = creator()
    File "/usr/local/lib/python2.7/dist-packages/dogpile/cache/region.py", line 1036, in creator
      return fn(*arg, **kw)
    File "/usr/local/lib/python2.7/dist-packages/keystone/token/provider.py", line 257, in _validate_token
      return self.driver.validate_v3_token(token_id)
    File "/usr/local/lib/python2.7/dist-packages/keystone/token/providers/fernet/core.py", line 150, in validate_v3_token
      token_formatter.validate_token(token_str))
    File "/usr/local/lib/python2.7/dist-packages/keystone/token/providers/fernet/token_formatters.py", line 223, in validate_token
      payload = self.unpack(token_string)
    File "/usr/local/lib/python2.7/dist-packages/keystone/token/providers/fernet/token_formatters.py", line 125, in unpack
      decrypted_token = self.crypto.decrypt(token_string)
    File "/usr/local/lib/python2.7/dist-packages/cryptography/fernet.py", line 138, in decrypt
      return f.decrypt(msg, ttl)
    File "/usr/local/lib/python2.7/dist-packages/cryptography/fernet.py", line 75, in decrypt
      raise TypeError("token must be bytes.")
  TypeError: token must be bytes.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1431669/+subscriptions


Follow ups

References