"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/credential/backends/sql.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

sql.py  (keystone-16.0.1):sql.py  (keystone-17.0.0)
skipping to change at line 16 skipping to change at line 16
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo_db import api as oslo_db_api from oslo_db import api as oslo_db_api
import six
from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.ext.hybrid import hybrid_property
from keystone.common import driver_hints from keystone.common import driver_hints
from keystone.common import sql from keystone.common import sql
from keystone.credential.backends import base from keystone.credential.backends import base
from keystone import exception from keystone import exception
class CredentialModel(sql.ModelBase, sql.ModelDictMixinWithExtras): class CredentialModel(sql.ModelBase, sql.ModelDictMixinWithExtras):
__tablename__ = 'credential' __tablename__ = 'credential'
attributes = [ attributes = [
skipping to change at line 47 skipping to change at line 46
@hybrid_property @hybrid_property
def encrypted_blob(self): def encrypted_blob(self):
return self._encrypted_blob return self._encrypted_blob
@encrypted_blob.setter @encrypted_blob.setter
def encrypted_blob(self, encrypted_blob): def encrypted_blob(self, encrypted_blob):
# Make sure to hand over the encrypted credential as a string value # Make sure to hand over the encrypted credential as a string value
# to the backend driver to avoid the sql drivers (esp. psycopg2) # to the backend driver to avoid the sql drivers (esp. psycopg2)
# treating this as binary data and e.g. hex-escape it. # treating this as binary data and e.g. hex-escape it.
if six.PY3 and isinstance(encrypted_blob, six.binary_type): if isinstance(encrypted_blob, bytes):
encrypted_blob = encrypted_blob.decode('utf-8') encrypted_blob = encrypted_blob.decode('utf-8')
self._encrypted_blob = encrypted_blob self._encrypted_blob = encrypted_blob
class Credential(base.CredentialDriverBase): class Credential(base.CredentialDriverBase):
# credential crud # credential crud
@sql.handle_conflicts(conflict_type='credential') @sql.handle_conflicts(conflict_type='credential')
def create_credential(self, credential_id, credential): def create_credential(self, credential_id, credential):
with sql.session_for_write() as session: with sql.session_for_write() as session:
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)