Skip to content

Conversation

@JillRegan
Copy link
Contributor

@JillRegan JillRegan commented Dec 8, 2025

✨ Summary

The category comparison was failing to set the API Credential Category because in new item conversions whic hwere implemented with the migration to SDK we did not handle for this category as support here is not official. This type comparison issue prevented the credential field from being populated.

I have added a API Credential category and added it to the mapping helpers. I also moved the field setting logic for credential to the field switch case. E2E test has been added.

🔗 Resolves:

Resolves: #287

✅ Checklist

  • 🖊️ Commits are signed
  • 🧪 Tests added/updated: (See the Testing Guide for when to use each type and how to run them)
    • 🔹 Unit /🔸 Integration
    • 🌐 E2E
  • 📚 Docs updated (if behavior changed)

🕵️ Review Notes & ⚠️ Risks

The bug can reproduced manually using v3.0.0 by attempting to access the credential field in an API Credential Item. The value ends up being null as we never set the category on the item.

data "onepassword_item" "api_credential" {
  vault = data.onepassword_vault.test.uuid
  title = "Jill Test Api Credential"
}

# The bug: credential should contain the API credential value but it's null (also no Category set)
output "api_credential_item" {
  value     = data.onepassword_item.api_credential
  sensitive = true
}

@JillRegan JillRegan changed the title [DRAFT] Add API Credential logic to model conversions Add API Credential logic to model conversions Dec 8, 2025
@JillRegan JillRegan marked this pull request as ready for review December 8, 2025 16:35
Copy link
Contributor

@volodymyrZotov volodymyrZotov left a comment

Choose a reason for hiding this comment

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

🔥 Nice! Approved!

@JillRegan JillRegan merged commit 5b651d9 into main Dec 8, 2025
8 checks passed
@JillRegan JillRegan deleted the jill/fix-credential-item branch December 8, 2025 19:09
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.

API credential items cannot be read with v3

3 participants