Feature #2701
closedSupport to generate an anonymized username (abc123456)
100%
Description
We would like to set a standard generator:
- specify prefix (some constant value, or none)
- specify a length of the random number
- the generator creates a username, which contains prefix+number and it's unique among identities in IdM
Updated by Radek Tomiška almost 4 years ago
- Assignee changed from Ondřej Kopr to Ondrej Husník
- Estimated time set to 16.00 h
Updated by Radek Tomiška almost 4 years ago
- Priority changed from Normal to High
Updated by Ondrej Husník almost 4 years ago
- Status changed from New to In Progress
Updated by Ondrej Husník almost 4 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Ondrej Husník to Vít Švanda
- % Done changed from 0 to 90
The implementation of generator is here.
https://github.com/bcvsolutions/CzechIdMng/commit/60cc75f54e1d80b0c03f22462698d5a915ce1f72
and some doc is
https://wiki.czechidm.com/devel/documentation/generated_values#identityanonymoususernamegenerator
Could you, please, provide me a feedback?
Updated by Ondrej Husník almost 4 years ago
I discovered a wrong behavior of this feature in the case when there are used two usernames like this: anonymous_03 and anonymous_3. They were treated as same values which was not correct. Now it's fixed here. Some more tests were also added.
https://github.com/bcvsolutions/CzechIdMng/commit/d0c20ddce5d43cd1998a5e68540ff7b4bd869113
Updated by Vít Švanda over 3 years ago
- Status changed from Needs feedback to In Progress
- Assignee changed from Vít Švanda to Ondrej Husník
- % Done changed from 90 to 100
I did review and tested it. Works very well with robust algoritm. Thanks for that.
Minor review notes:- Use a metamodel constant instead string in IdentityAnonymousUsernameGenerator:121 ("PageRequest.of(pageNum, pageSize, Sort.by("username").ascending()));").
- The "createUsername" method does not have the linker parameter mentioned in JavaDoc.
Updated by Ondrej Husník over 3 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Ondrej Husník to Vít Švanda
Here are changes based on your review. Also fixed some warnings from Sonar.
https://github.com/bcvsolutions/CzechIdMng/commit/b70551339a7724902c37ad8fe328e56b650c41b7
Updated by Vít Švanda over 3 years ago
- Status changed from Needs feedback to Resolved
- Assignee changed from Vít Švanda to Ondrej Husník
LGTM
Updated by Radek Tomiška over 3 years ago
- Status changed from Resolved to Closed