"Fossies" - the Fresh Open Source Software Archive  

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

discovery.py  (keystone-16.0.1):discovery.py  (keystone-17.0.0)
skipping to change at line 15 skipping to change at line 15
# 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
from flask import request from flask import request
import http.client
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from six.moves import http_client
from keystone.common import json_home from keystone.common import json_home
import keystone.conf import keystone.conf
from keystone.server import flask as ks_flask from keystone.server import flask as ks_flask
CONF = keystone.conf.CONF CONF = keystone.conf.CONF
MEDIA_TYPE_JSON = 'application/vnd.openstack.identity-%s+json' MEDIA_TYPE_JSON = 'application/vnd.openstack.identity-%s+json'
_DISCOVERY_BLUEPRINT = flask.Blueprint('Discovery', __name__) _DISCOVERY_BLUEPRINT = flask.Blueprint('Discovery', __name__)
def _get_versions_list(identity_url): def _get_versions_list(identity_url):
versions = {} versions = {}
versions['v3'] = { versions['v3'] = {
'id': 'v3.13', 'id': 'v3.14',
'status': 'stable', 'status': 'stable',
'updated': '2019-07-19T00:00:00Z', 'updated': '2020-04-07T00:00:00Z',
'links': [{ 'links': [{
'rel': 'self', 'rel': 'self',
'href': identity_url, 'href': identity_url,
}], }],
'media-types': [{ 'media-types': [{
'base': 'application/json', 'base': 'application/json',
'type': MEDIA_TYPE_JSON % 'v3' 'type': MEDIA_TYPE_JSON % 'v3'
}] }]
} }
return versions return versions
skipping to change at line 77 skipping to change at line 77
# TODO(morgan): If we ever have more API versions find the latest # TODO(morgan): If we ever have more API versions find the latest
# stable version instead of just using the "base_url", for now we # stable version instead of just using the "base_url", for now we
# simply have a single version so use it as the preferred location. # simply have a single version so use it as the preferred location.
preferred_location = identity_url preferred_location = identity_url
response = flask.Response( response = flask.Response(
response=jsonutils.dumps( response=jsonutils.dumps(
{'versions': { {'versions': {
'values': list(versions.values())}}), 'values': list(versions.values())}}),
mimetype=MimeTypes.JSON, mimetype=MimeTypes.JSON,
status=http_client.MULTIPLE_CHOICES) status=http.client.MULTIPLE_CHOICES)
response.headers['Location'] = preferred_location response.headers['Location'] = preferred_location
return response return response
@_DISCOVERY_BLUEPRINT.route('/v3') @_DISCOVERY_BLUEPRINT.route('/v3')
def get_version_v3(): def get_version_v3():
if v3_mime_type_best_match() == MimeTypes.JSON_HOME: if v3_mime_type_best_match() == MimeTypes.JSON_HOME:
# RENDER JSON-Home form, we have a clever client who will # RENDER JSON-Home form, we have a clever client who will
# understand the JSON-Home document. # understand the JSON-Home document.
content = json_home.JsonHomeResources.resources() content = json_home.JsonHomeResources.resources()
return flask.Response(response=jsonutils.dumps(content), return flask.Response(response=jsonutils.dumps(content),
 End of changes. 5 change blocks. 
4 lines changed or deleted 4 lines changed or added

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