Skip to content

Conversation

@bjorkert
Copy link
Contributor

@bjorkert bjorkert commented May 4, 2024

Summary

This PR enhances the SettingsViewController by allowing users to paste a URL that includes a token, automatically populating both the URL and token fields. This improvement aims to streamline the testing process.

Changes

  1. New functionality:
    • Added support for handling URLs with embedded tokens.
    • Automatically extracts and populates the token if found.
    • Cleans up the URL accordingly.
  2. Code refactoring:
    • Improved URL filtering and normalization logic.
    • Removed redundant code and improved formatting.

Testing

  1. Manual Testing:
    • Verified that pasting a URL with a token correctly populates the fields.
    • Ensured that normal URL input behavior remains unchanged.
  2. Automated Testing:
    • Added relevant unit tests for the new functionality.

Notes

This update primarily facilitates easier testing scenarios where tokens are used in the URL. It should not affect normal usage but enhances the workflow for testers and developers.

@bjorkert bjorkert requested a review from marionbarker May 4, 2024 09:46
@marionbarker
Copy link
Collaborator

Tested both in the way @bjorkert intended plus added a password in my Apple Keychain. That worked as well.
Create a new password by typing + in the password tool and give it a name (e.g., LF for NS 1) and then add:

  1. website (see notes below)
  2. username (This is your URL without the token, e.g., https://yoursite.nightscout.com)
  3. password (This is your token, it only needs the alpha numeric string after the hyphen - the descriptive text before that is optional)

Hints about the website:

  • Don't put in the https:
  • It doesn't have to have anything to do with your Nightscout site
    • if you have another password set where you followed the LoopDocs directions for setting it up, this website has to be something different from what you used for the password that has the API_SECRET;
    • it does not need to be a valid URL, but can't appear in any of your other passwords.
      • for example fake.org is accepted, but can only be used once
      • pick a different fake website if you follow more than one person and want to set up this information in your keychain

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.

3 participants