"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/credential/backends/sql.py" between
keystone-15.0.0.tar.gz and keystone-15.0.1.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 "Stein" series (maintained release).

sql.py  (keystone-15.0.0):sql.py  (keystone-15.0.1)
skipping to change at line 15 skipping to change at line 15
# a copy of the License at # a copy of the License at
# #
# 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 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 = [
'id', 'user_id', 'project_id', 'encrypted_blob', 'type', 'key_hash' 'id', 'user_id', 'project_id', 'encrypted_blob', 'type', 'key_hash'
] ]
skipping to change at line 97 skipping to change at line 99
with sql.session_for_write() as session: with sql.session_for_write() as session:
ref = self._get_credential(session, credential_id) ref = self._get_credential(session, credential_id)
session.delete(ref) session.delete(ref)
def delete_credentials_for_project(self, project_id): def delete_credentials_for_project(self, project_id):
with sql.session_for_write() as session: with sql.session_for_write() as session:
query = session.query(CredentialModel) query = session.query(CredentialModel)
query = query.filter_by(project_id=project_id) query = query.filter_by(project_id=project_id)
query.delete() query.delete()
@oslo_db_api.wrap_db_retry(retry_on_deadlock=True)
def delete_credentials_for_user(self, user_id): def delete_credentials_for_user(self, user_id):
with sql.session_for_write() as session: with sql.session_for_write() as session:
query = session.query(CredentialModel) query = session.query(CredentialModel)
query = query.filter_by(user_id=user_id) query = query.filter_by(user_id=user_id)
query.delete() query.delete()
 End of changes. 2 change blocks. 
0 lines changed or deleted 3 lines changed or added

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