-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat/document on plugin framework #171
feat/document on plugin framework #171
Conversation
e89fc62
to
f33a1e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
Thank you so much for your effort in making this contribution. This is much appreciated and it looks pretty solid.
Functional review: ✅
I've validated the following scenarios and can confirm that they work as expected:
- A Document item with a file attached to it
- An item of different category (e.g. Login) with multiple files attached to it.
One thing that would be nice to do here is to put the files in their appropriate section, since this is a possibility through the 1Password app. I don't think it's possible via the CLI though.
I also ran the acceptance tests and they all pass.
Code review: ✅
The code is straight forward and easy to follow. I've left comments in how to make it better.
The thing to call out code-wise is related to file attachments being able to belong to sections as well. This is something that might require some changes to ensure we include this scenario as well.
348568d
to
de30fa6
Compare
@edif2008 The review comments should be adressed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional review: ✅
Tested and validated that files from sections are placed in the appropriate sections in the Terraform state.
Code review: ✅
Code looks much cleaner now. Thank you for addressing the feedback.
Other notes
/docs/data-sources/item.md
file is not properly updated. Re-running go generate
and pushing the changes to that file should fix it.
Once that is addressed, this PR is good to be merged. 😄
@edif2008 done |
@edif2008 fixed |
This is a re-implementation of #161 due to the upgrading to the new plugin framework.
I have have only tested this with acceptance and cli, as I do not have a connect.
Roundtrip test:
data "onepassword_item" "foo" {
vault = var.demo_vault
uuid = "..."
}
resource "local_file" "truststore" {
filename = "truststore.jks"
content_base64 = data.onepassword_item.foo.file.2.content_base64
}
(where 2 is the third file for that item, added via the UI)
I had to use the op read approach rather than op document get (unless I am missing an undocumented feature) to be able to handle multiple files.
I have not tried to implement a resource, since as far as I understood connect cannot support it. I added a validation that you cannot create a new
onepassword_item
with categorydocument
. But the error message does not say why you cannot do it.(While it sucks a bit having to reimplement this out of the blue, I must say that the first impressions of the newer framework feels nicer to work with.)
Relates: #51