77 throw_if_request_message_is_missing_key ,
88 AuthStorage ,
99 STORE_PASSWORD_IN_MEMORY ,
10- CLIENT_GET_REQUEST_RESULT
10+ CLIENT_GET_REQUEST_RESULT ,
1111)
1212from .native import _authenticate_native
1313
1717import logging
1818import sys
1919
20- # Constants defining the states and operations for the pam_interactive authentication flow
20+ # Constants defining the states and operations for the pam_interactive authentication flow
2121AUTH_CLIENT_AUTH_REQUEST = "pam_auth_client_request"
2222AUTH_CLIENT_AUTH_RESPONSE = "pam_auth_response"
2323PERFORM_RUNNING = "running"
3838
3939_logger = logging .getLogger (__name__ )
4040
41+
4142def login (conn , ** extra_opt ):
4243 """The entry point for the pam_interactive authentication scheme."""
4344
4445 # The AuthStorage object holds the token generated by the server for the native auth step
4546 depot = AuthStorage .create_temp_pw_storage (conn )
4647
4748 auth_client_object = _pam_interactive_ClientAuthState (conn , depot , scheme = PAM_INTERACTIVE_SCHEME )
48- auth_client_object .authenticate_client (
49- initial_request = extra_opt
50- )
49+ auth_client_object .authenticate_client (initial_request = extra_opt )
50+
5151
5252class _pam_interactive_ClientAuthState (authentication_base ):
5353 def __init__ (self , conn , depot , * _ , ** _kw ):
@@ -64,7 +64,7 @@ def auth_client_start(self, request):
6464 # to recall previous inputs through JSON pointers. "pdirty" flags if pstate has changed and needs syncing.
6565 # The server side implementation can be found here: https://github.com/irods/irods_auth_plugin_pam_interactive
6666 # The plugin is built on the authentication framework described here:
67- # https://github.com/irods-contrib/irods_working_group_authentication/tree/e83e84df8ea4a732e5de894fb28aae281c3b3d29/development
67+ # https://github.com/irods-contrib/irods_working_group_authentication/tree/e83e84df8ea4a732e5de894fb28aae281c3b3d29/development
6868
6969 resp ["pstate" ] = resp .get ("pstate" , {})
7070 resp ["pdirty" ] = resp .get ("pdirty" , False )
@@ -123,7 +123,7 @@ def _patch_state(self, req):
123123
124124 # If the patch operation is an add or replace without a value, use the response value (following json patch RFC)
125125 for op in patch_ops :
126- if op .get ("op" ) in ["add" , "replace" ] and "value" not in op :
126+ if op .get ("op" ) in ["add" , "replace" ] and "value" not in op :
127127 op ["value" ] = resp
128128
129129 req ["pstate" ] = jsonpatch .apply_patch (req .get ("pstate" , {}), patch_ops )
@@ -266,4 +266,4 @@ def timeout(self, request):
266266 return self ._auth_failure (request , "Authentication timed out." )
267267
268268 def not_authenticated (self , request ):
269- return self ._auth_failure (request , "Authentication failed possibly due to incorrect credentials." )
269+ return self ._auth_failure (request , "Authentication failed possibly due to incorrect credentials." )
0 commit comments