PM4Py-WS Session Management

PM4Py-WS Session Management

This is responsible for the user authentication and for the verification of the validity of a given session. Moreover,

The session managers could be found inside the pm4pyws.user_iam package. The interface of session management could be found inside pm4pyws.user_iam.interface. The current versions implemented inside PM4Py-WS are:

  • Basic session handler
  • Keycloak session handler (supported by the external GPL 3.0 library python-keycloak)

Methods that should be implemented by a session handler are:

do_login(self, user, password)

Parameters:

user => Username

password => Password

Returns:

If the authentication succeeds, then the session ID

If the authentication fails, then a None

 

check_session_validity(self, session_id)

Checks the validity of the current session

Parameters:

session_id => Session ID

Returns:

A boolean value (True if the session is valid)

 

get_user_from_session(self, session_id)

Gets the user ID corresponding to a given session

Parameters:

session_id => Session ID

Returns:

User ID associated to the session

 

clean_expired_session(self)

Cleans the expired sessions.

 

get_all_sessions(self)

Method that shall return all the sessions opened in the system.

 

get_all_users(self)

Method that shall returns all the users allowed by the user handler.