{"body":"    # identity attributes need to be reconciled among the auth plugins\n    IDENTITY_ATTRIBUTES = frozenset(['user_id', 'project_id',\n                                     'access_token_id', 'domain_id',\n                                     'expires_at'])\n\n    def __setitem__(self, key, val):\n        \"\"\"Override __setitem__ to prevent conflicting values.\"\"\"\n        if key in self.IDENTITY_ATTRIBUTES and key in self:\n            existing_val = self[key]\n            if key == 'expires_at':\n                # special treatment for 'expires_at', we are going to take\n                # the earliest expiration instead.\n                if existing_val != val:\n                    LOG.info(_LI('\"expires_at\" has conflicting values '\n                                 '%(existing)s and %(new)s.  Will use the '\n                                 'earliest value.'),\n                             {'existing': existing_val, 'new': val})\n                if existing_val is None or val is None:\n                    val = existing_val or val\n                else:\n                    val = min(existing_val, val)\n            elif existing_val != val:\n                msg = _('Unable to reconcile identity attribute %(attribute)s '\n                        'as it has conflicting values %(new)s and %(old)s') % (\n                            {'attribute': key,\n                             'new': val,\n                             'old': existing_val})\n                raise exception.Unauthorized(msg)\n        return super(AuthContext, self).__setitem__(key, val)","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/lhxZyDDY","modified":1484267737,"id":"lhxZyDDY","size":1548,"lines":29,"own_paste":false,"theme":"","date":1484267737}