Skip to content

Conversation

@douglas-xt
Copy link
Contributor

This PR adds end-to-end tests for the user registration endpoint (POST /users).

The tests cover three main scenarios: successful registration with valid data, rejection of invalid registration attempts (missing fields, invalid email format, duplicate email, field length limits), and verification that all user resources are created correctly after registration.

Additionally, mocks were added to test-app.helper for external services (MailerService, NewsletterService, NotificationListener) to prevent E2E tests from making real API calls to external services.

Comment on lines 39 to 51
keys: {
ecc: {
publicKey: `ecc-public-key-test-${uniqueId}`,
privateKey: `ecc-private-key-test-${uniqueId}`,
revocationKey: `ecc-revocation-key-test-${uniqueId}`,
},
kyber: {
publicKey: `kyber-public-key-test-${uniqueId}`,
privateKey: `kyber-private-key-test-${uniqueId}`,
},
},
...overrides,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Generate one key using the libraries if possible. Just to prevent any issue if we add a validation in the DTOs for the keys.

Just if possible, of course. I think we have the libraries to create keys already in the repository check the preCreated code to confirm. However, I feel we can merge this like this, you would need to create a tech debt ticket to tackle it later

Up to you @jzunigax2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to implement it now using the existing libraries (openpgp for ECC and @dashlane/pqc-kem-kyber512-node for Kyber) to avoid creating tech debt and get it right from the start.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants