Skip to content

Conversation

@speto
Copy link

@speto speto commented Feb 12, 2025

I believe part of the problem with the credential category lies in if f.ID == "credential" && item.Category == "API_CREDENTIAL" where "credential" is checked against f.ID.

I'm not sure if I'm following correctly everything, but I believe the correct f field for this comparison should be Label not ID. Leaving it like rest of the fields on 350-362 should be sufficient.

I followed discussion in the original PR but I don't feel much clearer on it. Just think this shouldn't have been merged without tests.

So, first I added a test for credential category, which successfully failed. Then I tried fixing the issue and discovered the f.ID problem. Afterwards I added additional credential fields based on what 1password returns for that category and updated the docs. The type field is shared between both database and credential category.

This is also related to #52

@github-actions
Copy link
Contributor

⚠️ This PR contains unsigned commits. To get your PR merged, please sign those commits (git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}) and force push them to this branch (git push --force-with-lease).

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.

Learn how to use 1Password to sign your commits.

Watch the demo

- Introduced TestAccItemDataSourceApiCredential to verify the retrieval of API credential as an item from the data source.
- Added utility functions for generating test API credential items and fields.
- Correctly assigns credential field values during item data source processing.
- Removes redundant logic that incorrectly parsed "credential" fields.
Add support for `valid_from`, `expires`, and `filename` fields in the `API_CREDENTIAL` category. Update documentation and internal descriptions to reflect these additions, ensuring consistent handling of API credential metadata.
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.

1 participant