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

feat(UUID): add IRI validation that allows only to create IRIs using UUID version 4 and 5 (DEV-402) #1990

Merged
merged 16 commits into from Feb 3, 2022

Conversation

mpro7
Copy link
Collaborator

@mpro7 mpro7 commented Jan 31, 2022

resolves DEV-402

@mpro7 mpro7 marked this pull request as ready for review February 2, 2022 16:54
@mpro7 mpro7 requested a review from subotic as a code owner February 2, 2022 16:54
@mpro7 mpro7 changed the title add method that checks if UUID version is correct feat(UUID): add IRI validation that allows only to create IRIs using UUID version 4 and 5 (DEV-402) Feb 2, 2022
Copy link
Collaborator

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

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

looks good, apart from a few minor naming things

@@ -22,8 +23,12 @@ object GroupIRI { self =>
if (value.isEmpty) {
Validation.fail(BadRequestException(GROUP_IRI_MISSING_ERROR))
} else {
val isUUID: Boolean = sf.couldBeUuid(value.split("/").last)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find the function name couldBeUuid() confusing. Either it is or it's not, but could seems weird in this context

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're partially right, because it only checks the length of string, so there is possibility checked string isn't the UUID, but I think to rename it.

@sonarcloud
Copy link

sonarcloud bot commented Feb 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@subotic subotic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@mpro7 mpro7 merged commit 74d4344 into main Feb 3, 2022
@mpro7 mpro7 deleted the wip/DEV-402 branch February 3, 2022 11:08
@mpro7 mpro7 self-assigned this Feb 9, 2022
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.

None yet

3 participants