Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/modules/communityRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function handleGetCommunityResource(req, res) {
try {
const url = new URL(link);
// Only allow HTTPS protocol and restrict to specific trusted domains.
const allowedDomains = ['github.com', 'github.io'];
const allowedDomains = ['githubusercontent.com', 'github.com', 'github.io'];
if (
url.protocol !== 'https:' ||
!allowedDomains.some((domain) => url.hostname.endsWith(domain))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const AddSourceYamls = () => {
if (allTemplatesInstalled) {
return (
<>
<Text>
<Text data-testid="error-all-modules-installed">
{t('modules.community.source-yaml.all-modules-installed')}
</Text>
{displayExistingModulesList(existingModuleTemplates)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ context('Test Community Modules views', () => {
// Open Add YAML
cy.get('[accessible-name="add-yamls"]').click();

// Uncomment and adjust with https://github.com/kyma-project/busola/issues/4587
// cy.get('[accessible-name="Source YAML URL"]').click().type(
// 'https://raw.githubusercontent.com/kyma-project/community-modules/main/all-modules.yaml',
// );

// Open Add to Namespace select
cy.get(`[header-text="Add Source YAML"]:visible`)
.find('[data-testid="add-to-namespace-select"]')
Expand All @@ -109,6 +104,20 @@ context('Test Community Modules views', () => {
// Click of default namespace
cy.get('ui5-option-custom:visible').contains('default').click();

// Check access to raw github files
cy.get('[accessible-name="Source YAML URL"]')
.find('input')
.click()
.clear()
.type(
'https://raw.githubusercontent.com/kyma-project/busola/refs/heads/main/tests/integration/fixtures/community-modules/busola-0-12.yaml',
);

// Check if error 'all modules installed' is displayed
cy.get('[data-testid="error-all-modules-installed"]')
.contains('All modules in this YAML are already installed.')
.should('be.visible');

cy.get('ui5-button:visible').contains('Cancel').click();
});

Expand Down
Loading