From 215c7d71e9209fe72c935ad0124646dce513ac8e Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Thu, 24 Aug 2017 09:39:37 -0300 Subject: [PATCH] Fixed name introspect. --- keycloak/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/keycloak/__init__.py b/keycloak/__init__.py index 9288e0d..aec53e7 100644 --- a/keycloak/__init__.py +++ b/keycloak/__init__.py @@ -113,8 +113,8 @@ class Keycloak: :param kwargs: :return: """ - if method_token_info == 'instropect': - token_info = self.instropect(token) + if method_token_info == 'introspect': + token_info = self.introspect(token) else: token_info = self.decode_token(token, **kwargs) @@ -228,7 +228,7 @@ class Keycloak: return raise_error_from_response(data_raw, KeycloakGetError) - def instropect(self, token, rpt=None, token_type_hint=None): + def introspect(self, token, rpt=None, token_type_hint=None): """ The introspection endpoint is used to retrieve the active state of a token. It is can only be invoked by confidential clients. @@ -291,7 +291,7 @@ class Keycloak: self.authorization.load_config(authorization_json) authorization_file.close() - def get_policies(self, token, method_token_info='instropect', **kwargs): + def get_policies(self, token, method_token_info='introspect', **kwargs): """ Get policies by user token @@ -306,7 +306,7 @@ class Keycloak: token_info = self._token_info(token, method_token_info, **kwargs) - if method_token_info == 'instropect' and not token_info['active']: + if method_token_info == 'introspect' and not token_info['active']: raise KeycloakInvalidTokenError( "Token expired or invalid." ) @@ -325,7 +325,7 @@ class Keycloak: return list(set(policies)) - def get_permissions(self, token, method_token_info='instropect', **kwargs): + def get_permissions(self, token, method_token_info='introspect', **kwargs): """ Get permission by user token @@ -342,7 +342,7 @@ class Keycloak: token_info = self._token_info(token, method_token_info, **kwargs) - if method_token_info == 'instropect' and not token_info['active']: + if method_token_info == 'introspect' and not token_info['active']: raise KeycloakInvalidTokenError( "Token expired or invalid." )