Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Automatically register users vising the application for the first time #1189

@ggonzr

Description

@ggonzr

If a new user attempts to use a private endpoint, and it is not already registered in the database, an unhandled exception will be raised as it is not possible to retrieve the user's role and permissions, e.g: when a new user subscribes to a request to receive updates on its processing. The exception happens as there's always assumed the user sending the request exists in the database:

user = self.__user_cache.get(username)
if not user:
user = self.__db.get(username)
self.__user_cache.set(username, user, timeout=self.CACHE_TIMEOUT)
self.user_dict['role'] = user['role']
# we take email from DB if user is registered, else we use ADFS

Expected Behavior

New users should be automatically registered with the user role and there should not be any error regarding retrieving the user's role.

Current Behavior

The endpoint fails as there's an unhandled exception for taking the user's role.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions