"Fossies" - the Fresh Open Source Software Archive  

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

validator.py  (keystone-16.0.1):validator.py  (keystone-17.0.0)
skipping to change at line 17 skipping to change at line 17
# 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.
"""oAuthlib request validator.""" """oAuthlib request validator."""
import six
from keystone.common import provider_api from keystone.common import provider_api
from keystone import exception from keystone import exception
from keystone.oauth1.backends import base from keystone.oauth1.backends import base
from keystone.oauth1 import core as oauth1 from keystone.oauth1 import core as oauth1
METHOD_NAME = 'oauth_validator' METHOD_NAME = 'oauth_validator'
PROVIDERS = provider_api.ProviderAPIs PROVIDERS = provider_api.ProviderAPIs
class OAuthValidator(provider_api.ProviderAPIMixin, oauth1.RequestValidator): class OAuthValidator(provider_api.ProviderAPIMixin, oauth1.RequestValidator):
skipping to change at line 179 skipping to change at line 177
def validate_verifier(self, client_key, token, verifier, request): def validate_verifier(self, client_key, token, verifier, request):
try: try:
req_token = PROVIDERS.oauth_api.get_request_token(token) req_token = PROVIDERS.oauth_api.get_request_token(token)
return req_token['verifier'] == verifier return req_token['verifier'] == verifier
except exception.NotFound: except exception.NotFound:
return False return False
def verify_request_token(self, token, request): def verify_request_token(self, token, request):
# there aren't strong expectations on the request token format # there aren't strong expectations on the request token format
return isinstance(token, six.string_types) return isinstance(token, str)
def verify_realms(self, token, realms, request): def verify_realms(self, token, realms, request):
return True return True
# The following save_XXX methods are called to create tokens. I chose to # The following save_XXX methods are called to create tokens. I chose to
# keep the original logic, but the comments below show how that could be # keep the original logic, but the comments below show how that could be
# implemented. The real implementation logic is in the backend. # implemented. The real implementation logic is in the backend.
def save_access_token(self, token, request): def save_access_token(self, token, request):
pass pass
# token_duration = CONF.oauth1.request_token_duration # token_duration = CONF.oauth1.request_token_duration
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added

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