Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version: Change naming mechanism for editor #322

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

GeoffreyKarnbach
Copy link
Contributor

Description

Bugfix

What does this PR do?

Add new method to security service with claims on JWT to use correct display name for editor in the version view.

closes GH-291

@GeoffreyKarnbach GeoffreyKarnbach linked an issue Jan 20, 2025 that may be closed by this pull request
@GeoffreyKarnbach GeoffreyKarnbach force-pushed the gk/291-version-view-editor-names-are-not-human-readable branch from c19062d to 5e1b3db Compare January 20, 2025 09:42
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
16.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Comment on lines +69 to +76
String displayName = name;
if (name == null) {
if (firstName != null && lastName != null) {
displayName = firstName + " " + lastName;
} else {
displayName = email;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking if name == null will never be true, since in this case getClaimValue("name").toString() would throw an exception. I would first check (null safe) if name exists. If yes, use it as displayName. If no, check for givenName and family_name...

@ValentinFutterer
Copy link
Collaborator

There should also be a plan on how to handle this retroactively, since the editor names for older dmps are just unreadable hashes (at least for TU Wien). Check with TU Graz and Med Uni Graz on how to proceed, if they all have the same problem, i would set old editor names to null, sicne seeing nothing is better than the users seeing random hashes with no visible meaning behind it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version-View: Editor names are not human readable
2 participants