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

Pivotal ID #185392780: User FTP files API support #724

Merged
merged 12 commits into from
Jun 28, 2023

Conversation

Juan-EBI
Copy link
Contributor

@Juan-EBI Juan-EBI commented Jun 13, 2023

@Juan-EBI Juan-EBI changed the title Pivotal #ID 185392780: User FTP files API support Pivotal ID #185392780: User FTP files API support Jun 13, 2023
private fun asUser(registerRequest: RegisterRequest) = DbUser(
email = registerRequest.email,
fullName = registerRequest.name,
orcid = registerRequest.orcid,
secret = securityUtil.newKey(),
notificationsEnabled = registerRequest.notificationsEnabled,
magicFolderType = MagicFolderType.NFS,
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be great to have the default value configurable in application properties

Juan-EBI added 4 commits June 14, 2023 05:47
…API-use-FTP' of github.com:EBIBioStudies/biostudies-backend-services into feature/pivotal-185392780-User-FTP-files-API-support
…services into feature/pivotal-185392780-User-FTP-files-API-support
@Juan-EBI Juan-EBI requested a review from jhoanmanuelms June 20, 2023 11:36
@Juan-EBI
Copy link
Contributor Author

@jhoanmanuelms after this one we will need to

  1. Update user table to include new column
  2. Update properties to have new organization

Copy link
Contributor

@jhoanmanuelms jhoanmanuelms left a comment

Choose a reason for hiding this comment

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

LGTM. Please consider my comments

@@ -76,6 +79,10 @@ class DbUser(
@Column
var notificationsEnabled: Boolean = false,

@Enumerated(EnumType.STRING)
@Column(name = "magic_folder_type")
var magicFolderType: MagicFolderType,
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand the "Magic Folder" denomination was something we inherited from the previous version of BioStudies. However, I think we should rename it to something more accurate like for example storageType or even storageMode.

}

data class FtpMagicFolder(override val relativePath: Path) : MagicFolder
Copy link
Contributor

Choose a reason for hiding this comment

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

The same comment could apply here. Perhaps we could use this opportunity to get rid of the "Magic" and call it by its name UserFolder which is more appropriate.

Don't get me wrong, I love magic as much as the next person, it's just that I feel in this case it's really out of context.

@@ -169,6 +182,7 @@ open class SecurityService(
orcid = registerRequest.orcid,
secret = securityUtil.newKey(),
notificationsEnabled = registerRequest.notificationsEnabled,
magicFolderType = securityProps.filesProperties.defaultMode,
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be:

magicFolderType = registerRequest.magicFolderType ?: securityProps.filesProperties.defaultMode

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to come in following PR

@@ -41,6 +42,7 @@ class SecurityQueryService(
email = email,
fullName = username,
secret = securityUtil.newKey(),
magicFolderType = MagicFolderType.NFS,
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this always be the default or should we consider the default mode defined in the properties? Or even should we maybe even allow the endpoint consumers to choose the type on a per request basis?

requireActivation: false
filesProperties:
filesDirPath:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could use this opportunity to add documentation for the properties

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they have, but not in the itest file but in application yml files of reulgar application

@Juan-EBI Juan-EBI merged commit c0287fc into master Jun 28, 2023
@Juan-EBI Juan-EBI deleted the feature/pivotal-185392780-User-FTP-files-API-support branch July 4, 2023 16:40
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.

3 participants