Skip to content

Add a Cypress test to check anonymous users can only access public resources - #3906

Merged
lorenzo-cavazzi merged 9 commits into
lorenzo/cypress-renku-2.0from
lorenzo/cypress-renku-2.0-anonymous
Feb 18, 2025
Merged

lorenzo-cavazzi merged 9 commits into
lorenzo/cypress-renku-2.0from
lorenzo/cypress-renku-2.0-anonymous

Conversation

@lorenzo-cavazzi

Copy link
Copy Markdown
Member

See title.

Mind that this will be rebased after closing #3887 and #3901

/deploy renku-ui=lorenzo/cypress-renku-2.0-data-cy

fix #3903

@RenkuBot

Copy link
Copy Markdown
Collaborator

@olevski olevski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you Lorenzo. Two minor things.

cy.getDataCy("search-input").clear().type(randomString);
cy.getDataCy("search-button").click();
cy.wait("@searchQuery");
cy.getDataCy("search-card").should("have.length", 2);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggestion: It doesnt hurt to assert that we can find the two projects here by name (the private and public one). Just to be safe.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point 👍 Done here 2af4cb1
P.S. I used the randomString string wherever we had more than one resource to simplify the logic while keeping the test effective.

@leafty leafty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@olevski

olevski commented Feb 18, 2025

Copy link
Copy Markdown
Member

My bad I misclicked and dismissed @leafty's approval. That was a mistake.

@leafty

leafty commented Feb 18, 2025

Copy link
Copy Markdown
Member

I will dismiss yours then 😆

@lorenzo-cavazzi
lorenzo-cavazzi merged commit 727b655 into lorenzo/cypress-renku-2.0 Feb 18, 2025
@lorenzo-cavazzi
lorenzo-cavazzi deleted the lorenzo/cypress-renku-2.0-anonymous branch February 18, 2025 16:00
lorenzo-cavazzi added a commit that referenced this pull request Mar 4, 2025
* Add prettier and update linter configuration
* Fix setting up baseUrl when running on cli
* Test project basic operations: create, edit, delete (#3881, #3908)
* Test working on groups: create, edit, delete (#3883, #3908)
* Test project resources -- code, data, environments (#3894)
* Test search entities (#3904)
* Test anonymous users navigation (#3906)
* Test running sessions (#3912)
* Update the cypress tests readme file (#3884)
* Split v2 and legacy cypress tests, improve naming (#3926)

---------

Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: Rok Roškar <[email protected]>
Panaetius pushed a commit that referenced this pull request Mar 4, 2025
* chore: create release 0.65.0

* chore(ci): update renku actions to v1.14.0 (#3886)

Co-authored-by: Lorenzo Cavazzi <[email protected]>

* fix: update csi rclone to 0.3.6 (#3889)

* chore(deps-dev): bump braces from 3.0.2 to 3.0.3 in /cypress-tests (#3888)

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /cypress-tests (#3840)

Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](moxystudio/node-cross-spawn@v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rok Roškar <[email protected]>
Co-authored-by: Lorenzo Cavazzi <[email protected]>

* Merge branch 'master' into release-0.65.0 (#3895)

* feat(helm): Make Jena passwords optional in values file.

This commit continues on the topic of making the definition
of the secrets in the values files optional, to simplify CI
deployments.

As previous similar commits this change supports:

- Existing deployments where the secret is defined will
keep working as usual

- New deployments where the secret is defined will keep
working as they did before this change

- New deployments where the secret is NOT defined will
get 2 random passwords which will be persisted across
upgrades/redeployments

The three scenarios have been manually tested.

* feat: Make Redis and OIDC client secrets optional.

These are the last two secrets that were needed to be generated
out-of-bands before deploying Renkulab.

Thus the `generate-values` script is not really necessary anymore
and in its place there is a `minimal-deployment` values file that
in a future commit will also be used as a base for CI deployments.

The documentation has been updated to reflect the removal of the
script.

Further cleanup and simplification of the Helm chart will result
in a smaller and simpler minimum-deployment file, with the ultimate
goal of being able to issue `helm install renku/renku` resulting
in a functioning development deployment.

* feat: Define some more sensible defaults.

* feat: Configure data-services to connect to solr (#3918)

* chore(ci): update renku actions to v1.14.1 (#3927)

Co-authored-by: Lorenzo Cavazzi <[email protected]>

* chore: update renku-ui to 3.47.0 (#3930)

* revert: Configure data services to connect to solr

Refs: e831264

* tests: add cypress tests for Renku 2.0 (#3879)

* Add prettier and update linter configuration
* Fix setting up baseUrl when running on cli
* Test project basic operations: create, edit, delete (#3881, #3908)
* Test working on groups: create, edit, delete (#3883, #3908)
* Test project resources -- code, data, environments (#3894)
* Test search entities (#3904)
* Test anonymous users navigation (#3906)
* Test running sessions (#3912)
* Update the cypress tests readme file (#3884)
* Split v2 and legacy cypress tests, improve naming (#3926)

---------

Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: Rok Roškar <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Lorenzo Cavazzi <[email protected]>
Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rok Roškar <[email protected]>
Co-authored-by: Alessandro Degano <[email protected]>
Co-authored-by: eikek <[email protected]>
Co-authored-by: Chandrasekhar Ramakrishnan <[email protected]>
Co-authored-by: Tasko Olevski <[email protected]>
olevski added a commit that referenced this pull request May 13, 2025
* chore: create release 0.65.0

* chore(ci): update renku actions to v1.14.0 (#3886)

Co-authored-by: Lorenzo Cavazzi <[email protected]>

* fix: update csi rclone to 0.3.6 (#3889)

* chore(deps-dev): bump braces from 3.0.2 to 3.0.3 in /cypress-tests (#3888)

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /cypress-tests (#3840)

Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](moxystudio/node-cross-spawn@v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rok Roškar <[email protected]>
Co-authored-by: Lorenzo Cavazzi <[email protected]>

* Merge branch 'master' into release-0.65.0 (#3895)

* feat(helm): Make Jena passwords optional in values file.

This commit continues on the topic of making the definition
of the secrets in the values files optional, to simplify CI
deployments.

As previous similar commits this change supports:

- Existing deployments where the secret is defined will
keep working as usual

- New deployments where the secret is defined will keep
working as they did before this change

- New deployments where the secret is NOT defined will
get 2 random passwords which will be persisted across
upgrades/redeployments

The three scenarios have been manually tested.

* feat: Make Redis and OIDC client secrets optional.

These are the last two secrets that were needed to be generated
out-of-bands before deploying Renkulab.

Thus the `generate-values` script is not really necessary anymore
and in its place there is a `minimal-deployment` values file that
in a future commit will also be used as a base for CI deployments.

The documentation has been updated to reflect the removal of the
script.

Further cleanup and simplification of the Helm chart will result
in a smaller and simpler minimum-deployment file, with the ultimate
goal of being able to issue `helm install renku/renku` resulting
in a functioning development deployment.

* feat: Define some more sensible defaults.

* feat: Configure data-services to connect to solr (#3918)

* chore(ci): update renku actions to v1.14.1 (#3927)

Co-authored-by: Lorenzo Cavazzi <[email protected]>

* chore: update renku-ui to 3.47.0 (#3930)

* revert: Configure data services to connect to solr

Refs: e831264

* tests: add cypress tests for Renku 2.0 (#3879)

* Add prettier and update linter configuration
* Fix setting up baseUrl when running on cli
* Test project basic operations: create, edit, delete (#3881, #3908)
* Test working on groups: create, edit, delete (#3883, #3908)
* Test project resources -- code, data, environments (#3894)
* Test search entities (#3904)
* Test anonymous users navigation (#3906)
* Test running sessions (#3912)
* Update the cypress tests readme file (#3884)
* Split v2 and legacy cypress tests, improve naming (#3926)

---------

Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: Rok Roškar <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Lorenzo Cavazzi <[email protected]>
Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rok Roškar <[email protected]>
Co-authored-by: Alessandro Degano <[email protected]>
Co-authored-by: eikek <[email protected]>
Co-authored-by: Chandrasekhar Ramakrishnan <[email protected]>
Co-authored-by: Tasko Olevski <[email protected]>

This branch was successfully deployed

1 active deployment
ci-renku-3906 — 5df2560c Deployed Feb 18, 2025 by lorenzo-cavazzi
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.

Tests - Anonymous users can see and work with public projects but can't see private projects.

4 participants