"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/receipt/handlers.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).

handlers.py  (keystone-16.0.1):handlers.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.
import flask import flask
import http.client
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from six.moves import http_client
from keystone.common import authorization from keystone.common import authorization
from keystone.common import provider_api from keystone.common import provider_api
from keystone import exception from keystone import exception
PROVIDERS = provider_api.ProviderAPIs PROVIDERS = provider_api.ProviderAPIs
def extract_receipt(auth_context): def extract_receipt(auth_context):
receipt_id = flask.request.headers.get( receipt_id = flask.request.headers.get(
authorization.AUTH_RECEIPT_HEADER, None) authorization.AUTH_RECEIPT_HEADER, None)
skipping to change at line 67 skipping to change at line 67
}, },
'required_auth_methods': receipt.required_methods, 'required_auth_methods': receipt.required_methods,
} }
return receipt_reference return receipt_reference
def build_receipt(mfa_error): def build_receipt(mfa_error):
receipt = PROVIDERS.receipt_provider_api. \ receipt = PROVIDERS.receipt_provider_api. \
issue_receipt(mfa_error.user_id, mfa_error.methods) issue_receipt(mfa_error.user_id, mfa_error.methods)
resp_data = _render_receipt_response_from_model(receipt) resp_data = _render_receipt_response_from_model(receipt)
resp_body = jsonutils.dumps(resp_data) resp_body = jsonutils.dumps(resp_data)
response = flask.make_response(resp_body, http_client.UNAUTHORIZED) response = flask.make_response(resp_body, http.client.UNAUTHORIZED)
response.headers[authorization.AUTH_RECEIPT_HEADER] = receipt.id response.headers[authorization.AUTH_RECEIPT_HEADER] = receipt.id
response.headers['Content-Type'] = 'application/json' response.headers['Content-Type'] = 'application/json'
return response return response
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added

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