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

Remove contact_info from validation process #6836

Merged
merged 14 commits into from
Jan 22, 2024

Conversation

nicholaspcr
Copy link
Contributor

Summary

OS counterpart of https://github.com/TheThingsIndustries/lorawan-stack/pull/4012

Changes

  • Add migration to create email_validations table
  • Add EmailValidationRegistry to api
  • Add EmailValidationStore interface to IS's store
  • Update webui to call EmailValidationRegistry instead of ContactInfoRegistry when validating emails.

Testing

Unit tests and manual testing.

Test Steps

Use the following configuration for the Stack (remember to swap <field_ref> with an appropriate value):

 tls:
  source: file
  root-ca: ./ca.pem
  certificate: ./cert.pem
  key: ./key.pem
is:
  email:
    provider: "dir"
    dir: <dir_path> # (for example "./.env/emails/")
    sender-address: <sender_address>
    sender-name: <sender_name>
    templates:
      source: "dir"
      directory: "./pkg/email/templates"
  user-registration:
    email-validation:
      required: true
      retry-interval: 1h0m0s
      token-ttl: 48h0m0s

Follow the steps below:

  1. Create two users.
  2. Check the <dir_path> used in the config to validate if two emails were sent.
  3. Select one of the emails and use the link to validate the user's account
  4. Select the other email and use the reference and token to validate the account via the CLI.
  5. Validate if both users have their emails validated.
    • Can be done via CLI with the command: ttn-lw-cli usr get <usr_id> --primary-email-address --primary-email-address-validated-at
Regressions

N/A

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • The steps/process to test this feature are clearly explained including testing for regressions.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@nicholaspcr nicholaspcr added c/identity server This is related to the Identity Server ui/cli This is related to ttn-lw-cli compat/db This could affect Database compatibility bump/minor Needs new minor version for release ui/web This is related to a web interface labels Jan 16, 2024
@nicholaspcr nicholaspcr added this to the v3.29.0 milestone Jan 16, 2024
@nicholaspcr nicholaspcr self-assigned this Jan 16, 2024
@nicholaspcr nicholaspcr requested review from a team as code owners January 16, 2024 21:32
@nicholaspcr nicholaspcr force-pushed the issue/6567-remove-contact-info-validation branch 2 times, most recently from 6ef6178 to cf3b05c Compare January 16, 2024 22:00
@kschiffer
Copy link
Contributor

This broke the email validation. Please check the end to end tests.

@kschiffer kschiffer self-requested a review January 18, 2024 03:29
Copy link
Contributor

@kschiffer kschiffer left a comment

Choose a reason for hiding this comment

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

See above.

@nicholaspcr nicholaspcr force-pushed the issue/6567-remove-contact-info-validation branch 2 times, most recently from 8cad144 to e50c56d Compare January 19, 2024 15:33
@nicholaspcr nicholaspcr force-pushed the issue/6567-remove-contact-info-validation branch from e50c56d to e96b7ec Compare January 19, 2024 16:22
@nicholaspcr nicholaspcr requested a review from kschiffer January 19, 2024 16:45
@nicholaspcr nicholaspcr merged commit 7168af5 into v3.29 Jan 22, 2024
15 of 16 checks passed
@nicholaspcr nicholaspcr deleted the issue/6567-remove-contact-info-validation branch January 22, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump/minor Needs new minor version for release c/identity server This is related to the Identity Server compat/db This could affect Database compatibility ui/cli This is related to ttn-lw-cli ui/web This is related to a web interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants