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

Make contact_info a read-only field for entities #6839

Merged
merged 30 commits into from
Jan 22, 2024

Conversation

nicholaspcr
Copy link
Contributor

Summary

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

Changes

  • Remove calls to contact info store in the following entities: [gateway,organization,user,application,client].
  • Add contact_info GET test, matches the values in the administrative/technical contacts.

Testing

Manual test, unit tests.

Test Steps

Follow the steps below:

  1. Login into Console
  2. Create one of each entity: user,application,gateway,client,organization.
    2.1. The administrative_contact and technical_contact are the user who created the entity.
    2.2. Command example: ttn-lw-cli <entity> create --<entity>-id <entity_name> --user-id <user_id>
  3. Perform the following steps for each entity:
    3.1. Get entity with --contact-info fieldmask. Command: ttn-lw-cli <entity> get <entity_id> --contact-info
    3.2. List entity with --contact-info fieldmask. Command: ttn-lw-cli <entity> list --contact-info
    3.3. Search entity with --contact-info fieldmask. Command: ttn-lw-cli <entity> search --contact-info
    3.4. Attempt to create an entity with a specified contact_info.
    • Contact Info should still be filled with admin/tech contacts when fetched. (same as step 3.1)

Example of an application with a different contact_info for the step 3.4:

{
  "ids": {
    "application_id": "app-1"
  },
  "contact_info": [
    {
      "contact_type": "CONTACT_TYPE_TECHNICAL",
      "contact_method": "CONTACT_METHOD_EMAIL",
      "value": "[email protected]"
    }
  ]
}

Observation:
For the user entity the ContactInfo returned is only composed of the user's primary email address.

Regressions

This removes the contact_info operations for all entities. Replacing the contact_info registry with the email_validation registry.

Notes for Reviewers

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 this to the v3.29.0 milestone Jan 19, 2024
@nicholaspcr nicholaspcr self-assigned this Jan 19, 2024
@github-actions github-actions bot added c/identity server This is related to the Identity Server compat/db This could affect Database compatibility labels Jan 19, 2024
@nicholaspcr nicholaspcr force-pushed the issue/6567-remove-contact-info-validation branch 2 times, most recently from e50c56d to e96b7ec Compare January 19, 2024 16:22
@nicholaspcr nicholaspcr force-pushed the issue/6515-remove-storage-of-contact-info branch from 8c183ac to 71182ac Compare January 19, 2024 16:42
@nicholaspcr nicholaspcr marked this pull request as ready for review January 22, 2024 10:22
@nicholaspcr nicholaspcr requested a review from a team as a code owner January 22, 2024 10:22
@nicholaspcr nicholaspcr requested review from adriansmares and removed request for a team January 22, 2024 10:22
@nicholaspcr nicholaspcr force-pushed the issue/6515-remove-storage-of-contact-info branch from 71182ac to 9fd031b Compare January 22, 2024 16:41
Base automatically changed from issue/6567-remove-contact-info-validation to v3.29 January 22, 2024 17:23
@nicholaspcr nicholaspcr merged commit ac8fb94 into v3.29 Jan 22, 2024
12 checks passed
@nicholaspcr nicholaspcr deleted the issue/6515-remove-storage-of-contact-info branch January 22, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/identity server This is related to the Identity Server compat/db This could affect Database compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants