"Fossies" - the Fresh Open Source Software Archive  

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

endpoints.py  (keystone-16.0.1):endpoints.py  (keystone-17.0.0)
skipping to change at line 16 skipping to change at line 16
# #
# 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.
# This file handles all flask-restful resources for /v3/services # This file handles all flask-restful resources for /v3/services
import flask_restful import flask_restful
from six.moves import http_client import http.client
from keystone.api._shared import json_home_relations from keystone.api._shared import json_home_relations
from keystone.catalog import schema from keystone.catalog import schema
from keystone.common import json_home from keystone.common import json_home
from keystone.common import provider_api from keystone.common import provider_api
from keystone.common import rbac_enforcer from keystone.common import rbac_enforcer
from keystone.common import utils from keystone.common import utils
from keystone.common import validation from keystone.common import validation
from keystone import exception from keystone import exception
from keystone import notifications from keystone import notifications
skipping to change at line 97 skipping to change at line 97
def post(self): def post(self):
ENFORCER.enforce_call(action='identity:create_endpoint') ENFORCER.enforce_call(action='identity:create_endpoint')
endpoint = self.request_body_json.get('endpoint') endpoint = self.request_body_json.get('endpoint')
validation.lazy_validate(schema.endpoint_create, endpoint) validation.lazy_validate(schema.endpoint_create, endpoint)
utils.check_endpoint_url(endpoint['url']) utils.check_endpoint_url(endpoint['url'])
endpoint = self._assign_unique_id(self._normalize_dict(endpoint)) endpoint = self._assign_unique_id(self._normalize_dict(endpoint))
endpoint = self._validate_endpoint_region(endpoint) endpoint = self._validate_endpoint_region(endpoint)
ref = PROVIDERS.catalog_api.create_endpoint( ref = PROVIDERS.catalog_api.create_endpoint(
endpoint['id'], endpoint, initiator=self.audit_initiator) endpoint['id'], endpoint, initiator=self.audit_initiator)
return self.wrap_member(_filter_endpoint(ref)), http_client.CREATED return self.wrap_member(_filter_endpoint(ref)), http.client.CREATED
def patch(self, endpoint_id): def patch(self, endpoint_id):
ENFORCER.enforce_call(action='identity:update_endpoint') ENFORCER.enforce_call(action='identity:update_endpoint')
endpoint = self.request_body_json.get('endpoint') endpoint = self.request_body_json.get('endpoint')
validation.lazy_validate(schema.endpoint_update, endpoint) validation.lazy_validate(schema.endpoint_update, endpoint)
self._require_matching_id(endpoint) self._require_matching_id(endpoint)
endpoint = self._validate_endpoint_region(endpoint) endpoint = self._validate_endpoint_region(endpoint)
ref = PROVIDERS.catalog_api.update_endpoint( ref = PROVIDERS.catalog_api.update_endpoint(
endpoint_id, endpoint, initiator=self.audit_initiator) endpoint_id, endpoint, initiator=self.audit_initiator)
return self.wrap_member(_filter_endpoint(ref)) return self.wrap_member(_filter_endpoint(ref))
def delete(self, endpoint_id): def delete(self, endpoint_id):
ENFORCER.enforce_call(action='identity:delete_endpoint') ENFORCER.enforce_call(action='identity:delete_endpoint')
PROVIDERS.catalog_api.delete_endpoint(endpoint_id, PROVIDERS.catalog_api.delete_endpoint(endpoint_id,
initiator=self.audit_initiator) initiator=self.audit_initiator)
return None, http_client.NO_CONTENT return None, http.client.NO_CONTENT
class EndpointPolicyEndpointResource(flask_restful.Resource): class EndpointPolicyEndpointResource(flask_restful.Resource):
def get(self, endpoint_id): def get(self, endpoint_id):
ENFORCER.enforce_call(action='identity:get_policy_for_endpoint') ENFORCER.enforce_call(action='identity:get_policy_for_endpoint')
PROVIDERS.catalog_api.get_endpoint(endpoint_id) PROVIDERS.catalog_api.get_endpoint(endpoint_id)
ref = PROVIDERS.endpoint_policy_api.get_policy_for_endpoint( ref = PROVIDERS.endpoint_policy_api.get_policy_for_endpoint(
endpoint_id) endpoint_id)
return ks_flask.ResourceBase.wrap_member( return ks_flask.ResourceBase.wrap_member(
ref, collection_name='endpoints', member_name='policy') ref, collection_name='endpoints', member_name='policy')
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

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