-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
refactor(ipfs): change ipfs url to pinata #1946
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -61,10 +61,10 @@ public String handleSubmit( | |||||
storyBookPeerReviewEventDao.create(storyBookPeerReviewEvent); | ||||||
|
||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBookContributionEvent.getStoryBook().getId(); | ||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBookContributionEvent.getStoryBook().getId(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security: Consider using HTTPS instead of HTTP The URL protocol has been changed from HTTPS to HTTP. This is generally not recommended as HTTP connections are not encrypted and can be intercepted. Apply this diff to use HTTPS: - String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBookContributionEvent.getStoryBook().getId();
+ String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBookContributionEvent.getStoryBook().getId(); 📝 Committable suggestion
Suggested change
|
||||||
String embedThumbnailUrl = null; | ||||||
if (storyBookContributionEvent.getStoryBook().getCoverImage() != null) { | ||||||
embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + storyBookContributionEvent.getStoryBook().getCoverImage().getId() + "_r" + storyBookContributionEvent.getStoryBook().getCoverImage().getRevisionNumber() + "." + storyBookContributionEvent.getStoryBook().getCoverImage().getImageFormat().toString().toLowerCase(); | ||||||
embedThumbnailUrl = storyBookContributionEvent.getStoryBook().getCoverImage().getUrl(); | ||||||
} | ||||||
DiscordHelper.sendChannelMessage( | ||||||
"Storybook peer-reviewed: " + contentUrl, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -102,10 +102,10 @@ public String handleSubmit( | |||||
storyBookContributionEventDao.create(storyBookContributionEvent); | ||||||
|
||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security Concern: Avoid using HTTP protocol The URL protocol has been changed from HTTPS to HTTP, which is not recommended for modern web applications. Even for internal domains, HTTPS should be used to ensure secure communication and prevent man-in-the-middle attacks. Apply this diff to use HTTPS: - String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId();
+ String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); 📝 Committable suggestion
Suggested change
|
||||||
String embedThumbnailUrl = null; | ||||||
if (storyBook.getCoverImage() != null) { | ||||||
embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + storyBook.getCoverImage().getId() + "_r" + storyBook.getCoverImage().getRevisionNumber() + "." + storyBook.getCoverImage().getImageFormat().toString().toLowerCase(); | ||||||
embedThumbnailUrl = storyBook.getCoverImage().getUrl(); | ||||||
} | ||||||
DiscordHelper.sendChannelMessage( | ||||||
"Storybook created: " + contentUrl, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -421,10 +421,10 @@ public String handleSubmit( | |||||||||||||||||||
storyBookDao.update(storyBook); | ||||||||||||||||||||
|
||||||||||||||||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||||||||||||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||||||||||||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||||||||||||||||
String embedThumbnailUrl = null; | ||||||||||||||||||||
if (storyBook.getCoverImage() != null) { | ||||||||||||||||||||
embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + storyBook.getCoverImage().getId() + "_r" + storyBook.getCoverImage().getRevisionNumber() + "." + storyBook.getCoverImage().getImageFormat().toString().toLowerCase(); | ||||||||||||||||||||
embedThumbnailUrl = storyBook.getCoverImage().getUrl(); | ||||||||||||||||||||
Comment on lines
+424
to
+427
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider security implications of using HTTP instead of HTTPS. The change from HTTPS to HTTP for content URLs could expose user data to man-in-the-middle attacks. Unless there's a specific requirement (e.g., internal network constraints), it's recommended to use HTTPS for all external URLs. - String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId();
+ String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||
} | ||||||||||||||||||||
DiscordHelper.sendChannelMessage( | ||||||||||||||||||||
"Storybook created (imported from ePUB): " + contentUrl, | ||||||||||||||||||||
|
@@ -522,8 +522,8 @@ private void storeImageContributionEvent(Image image, HttpSession session, HttpS | |||||||||||||||||||
imageContributionEventDao.create(imageContributionEvent); | ||||||||||||||||||||
|
||||||||||||||||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||||||||||||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/multimedia/image/edit/" + image.getId(); | ||||||||||||||||||||
String embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + image.getId() + "_r" + image.getRevisionNumber() + "." + image.getImageFormat().toString().toLowerCase(); | ||||||||||||||||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/multimedia/image/edit/" + image.getId(); | ||||||||||||||||||||
String embedThumbnailUrl = image.getUrl(); | ||||||||||||||||||||
DiscordHelper.sendChannelMessage( | ||||||||||||||||||||
"Image created: " + contentUrl, | ||||||||||||||||||||
"\"" + image.getTitle() + "\"", | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -222,10 +222,10 @@ public String handleSubmit( | |||||
storyBookContributionEventDao.create(storyBookContributionEvent); | ||||||
|
||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security Concern: Avoid using HTTP protocol The URL protocol has been changed from HTTPS to HTTP, which is a security risk. Using HTTP can expose sensitive information during transit as the data is not encrypted. Apply this diff to use HTTPS instead: - String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId();
+ String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); 📝 Committable suggestion
Suggested change
|
||||||
String embedThumbnailUrl = null; | ||||||
if (storyBook.getCoverImage() != null) { | ||||||
embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + storyBook.getCoverImage().getId() + "_r" + storyBook.getCoverImage().getRevisionNumber() + "." + storyBook.getCoverImage().getImageFormat().toString().toLowerCase(); | ||||||
embedThumbnailUrl = storyBook.getCoverImage().getUrl(); | ||||||
} | ||||||
DiscordHelper.sendChannelMessage("Storybook edited: " + contentUrl, | ||||||
"\"" + storyBookContributionEvent.getStoryBook().getTitle() + "\"", | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -107,10 +107,10 @@ public String handleSubmit( | |||||
storyBookContributionEventDao.create(storyBookContributionEvent); | ||||||
|
||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security Concern: Avoid using HTTP protocol The URL protocol has been changed from HTTPS to HTTP, which is a security downgrade. Using HTTP exposes the content to potential man-in-the-middle attacks and is generally discouraged in modern web applications. Apply this diff to use HTTPS: - String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId();
+ String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); 📝 Committable suggestion
Suggested change
|
||||||
String embedThumbnailUrl = null; | ||||||
if (storyBook.getCoverImage() != null) { | ||||||
embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + storyBook.getCoverImage().getId() + "_r" + storyBook.getCoverImage().getRevisionNumber() + "." + storyBook.getCoverImage().getImageFormat().toString().toLowerCase(); | ||||||
embedThumbnailUrl = storyBook.getCoverImage().getUrl(); | ||||||
} | ||||||
DiscordHelper.sendChannelMessage( | ||||||
"Storybook chapter created: " + contentUrl, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -135,10 +135,10 @@ public String handleRequest(HttpSession session, @PathVariable Long storyBookId, | |||||
storyBookContributionEventDao.create(storyBookContributionEvent); | ||||||
|
||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid downgrading to HTTP protocol. The URL protocol has been changed from HTTPS to HTTP, which is generally not recommended as it reduces security. Even for internal or notification purposes, it's best practice to use HTTPS. Apply this diff to maintain HTTPS: - String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId();
+ String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); 📝 Committable suggestion
Suggested change
|
||||||
String embedThumbnailUrl = null; | ||||||
if (storyBook.getCoverImage() != null) { | ||||||
embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + storyBook.getCoverImage().getId() + "_r" + storyBook.getCoverImage().getRevisionNumber() + "." + storyBook.getCoverImage().getImageFormat().toString().toLowerCase(); | ||||||
embedThumbnailUrl = storyBook.getCoverImage().getUrl(); | ||||||
} | ||||||
DiscordHelper.sendChannelMessage( | ||||||
"Storybook chapter deleted: " + contentUrl, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -112,10 +112,10 @@ public String handleSubmit( | |||||
storyBookContributionEventDao.create(storyBookContributionEvent); | ||||||
|
||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security concern: Avoid using HTTP protocol. The URL protocol has been changed from HTTPS to HTTP. This is a security regression as HTTP traffic is unencrypted and susceptible to man-in-the-middle attacks. Apply this diff to use HTTPS: - String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId();
+ String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); 📝 Committable suggestion
Suggested change
|
||||||
String embedThumbnailUrl = null; | ||||||
if (storyBook.getCoverImage() != null) { | ||||||
embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + storyBook.getCoverImage().getId() + "_r" + storyBook.getCoverImage().getRevisionNumber() + "." + storyBook.getCoverImage().getImageFormat().toString().toLowerCase(); | ||||||
embedThumbnailUrl = storyBook.getCoverImage().getUrl(); | ||||||
} | ||||||
DiscordHelper.sendChannelMessage( | ||||||
"Storybook paragraph created: " + contentUrl, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -93,10 +93,10 @@ public String handleRequest(HttpSession session, @PathVariable Long id) { | |||||
storyBookContributionEventDao.create(storyBookContributionEvent); | ||||||
|
||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security: Consider using HTTPS instead of HTTP Using HTTP for content URLs may expose data to man-in-the-middle attacks. Consider using HTTPS to ensure secure communication. Apply this diff to use HTTPS: - String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId();
+ String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); 📝 Committable suggestion
Suggested change
|
||||||
String embedThumbnailUrl = null; | ||||||
if (storyBook.getCoverImage() != null) { | ||||||
embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + storyBook.getCoverImage().getId() + "_r" + storyBook.getCoverImage().getRevisionNumber() + "." + storyBook.getCoverImage().getImageFormat().toString().toLowerCase(); | ||||||
embedThumbnailUrl = storyBook.getCoverImage().getUrl(); | ||||||
} | ||||||
DiscordHelper.sendChannelMessage( | ||||||
"Storybook paragraph deleted: " + contentUrl, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -102,10 +102,10 @@ public String handleSubmit( | |||||
storyBookContributionEventDao.create(storyBookContributionEvent); | ||||||
|
||||||
if (!EnvironmentContextLoaderListener.PROPERTIES.isEmpty()) { | ||||||
String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security concern: Using HTTP instead of HTTPS The URL protocol has been changed from HTTPS to HTTP. This is generally not recommended as it could expose user data to man-in-the-middle attacks. Consider keeping HTTPS for secure communication: - String contentUrl = "http://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId();
+ String contentUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/content/storybook/edit/" + storyBook.getId(); 📝 Committable suggestion
Suggested change
|
||||||
String embedThumbnailUrl = null; | ||||||
if (storyBook.getCoverImage() != null) { | ||||||
embedThumbnailUrl = "https://" + EnvironmentContextLoaderListener.PROPERTIES.getProperty("content.language").toLowerCase() + ".elimu.ai/image/" + storyBook.getCoverImage().getId() + "_r" + storyBook.getCoverImage().getRevisionNumber() + "." + storyBook.getCoverImage().getImageFormat().toString().toLowerCase(); | ||||||
embedThumbnailUrl = storyBook.getCoverImage().getUrl(); | ||||||
} | ||||||
DiscordHelper.sendChannelMessage( | ||||||
"Storybook paragraph edited: " + contentUrl, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security: Consider using HTTPS instead of HTTP
Using HTTP for content URLs may expose sensitive data in transit. Consider using HTTPS to ensure secure communication.
Apply this diff to use HTTPS:
📝 Committable suggestion