-
This is continuation of discussion from #283. I'll attempt to document all the known use cases surrounding the ContextBefore v2.3.1, the password attribute was optional and the provider would automatically generate a password up to and including v2.2.15. From v2.3.1 (August 2021), password is made required. Auto password generation was removed. Validation was added to ensure it is valid for RT. In v2.3.3 (September, 2021), password requirement is removed. In v2.9.1 (January 2022), password is made required again. Validation is removed. Use cases
Any other use cases? In all cases, users may or may not reset their passwords in UI. Provider should not see changes and attempts to update the user resource. GitHub IssuesAffected Resources
Any other resources? Possible Solutions
User resourceKeep the current How to prevent state drift with passwordIn both resources, we can store the hash (SHA256?) of the supplied/generated password in the state file because we don’t get password back from Artifactory, and thus state is ‘null’. This will allow Terraform to detect drift correctly from the HCL side. Provider will not update the state when reading from Artifactory. When password is updated ( |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 25 replies
-
@jcogilvie @blyles @ShreyasNBS @tjstansell @vasanthig21 @korjek @michael-sabrnak-swi Please help us with your use cases (if not already in here) as well as any suggestions. We are hoping we can come to a solution that satisfy most of you. |
Beta Was this translation helpful? Give feedback.
-
There's also a use case for I am pinned to a version before 2.9.1 because of the change to the So, when the ultimate solution to this is released, in order to opt in, I should not have to go add a password field to an object that doesn't have one (the case of an imported user pre-2.9.1). In order to coexist with As to creating a new user, I think creating and then discarding a one-time password within the provider if one is not provided is the right play here. Or otherwise give me a flag to generate a user without a password and initiate a reset flow to their email (that'd be nice!). And then maybe if that flag is set we ignore the entire password field (which works well with my suggestion for import). |
Beta Was this translation helpful? Give feedback.
-
Here's my thinking:
I think being as loose as possible in TF and delegating almost all decisions to RT and our users is the way to go. In a nutshell, make it be like 2.9.1, except we don't generate the password if none is supplied; we will sense a blank password along. |
Beta Was this translation helpful? Give feedback.
-
According to the JFrog REST API for Users, the I also agree that this does affect the ability to import existing users into terraform. Ideally the password can be provided so that importing existing users doesn't force the password to get changed. Of course, if you know/manage the password yourself you could just provide that to terraform and it would set the password to the same thing. If you don't want to manage the password with terraform, use the |
Beta Was this translation helpful? Give feedback.
-
FYI I'm taking some time off starting tomorrow. So this issue will not be fixed for at least 3-4 weeks. In the meantime, the JFrog crew (@chb0github, @dasmanas, @maheshjfrog) will try to enumerate the solution and plan for the implementation. |
Beta Was this translation helpful? Give feedback.
-
@alexhung @chb0github However, I am not sure if the above will work for single replication config and ldap manager password? I believe there was a bug raised for the latter where the manager password for not being set? |
Beta Was this translation helpful? Give feedback.
-
So I now realize this is also affecting So, as others have stated in other issues related to this that I'm now browsing through, it seems that passwords should be handled as unverifiable inside of the terraform provider. If you specify a password in the config, it should store it internally (probably hashed) and will only notice if the parameter value changes. No verification on the artifactory side would be able to be done because even if you have an API that can return a password, it's encrypted with a rotating salt that you can't verify anyway. |
Beta Was this translation helpful? Give feedback.
-
I'm back from my leave and will start work on this ASAP. The fixes to this problem will involve multiple iteration/major releases. The top priority is to unblock some of you from unable to use the Here's our game plan:
|
Beta Was this translation helpful? Give feedback.
-
All, let me ask this question: Would you be willing to do some beta testing on various iterations of this while we experiment with the correct approach? We can push to a branch - all you would have to do is pull the code and build it - it will install a bumped version into your local cache to use. We currently test on mac and linux - we know there is no windows build (volunteers, anyone?). There are a lot of competing ideas, a lot of divergent cases, and it still isn't 100% clear how to please everyone. We would love some testing volunteers before making a release. If you're willing to test and give feedback, we can incorporate it into the next release |
Beta Was this translation helpful? Give feedback.
-
@chb0github @alexhung Sorry, but can you make sure that the password rollback mentioned in step 1 (1st major release) is released before this PR? https://github.com/jfrog/terraform-provider-artifactory/pull/380/files There are a lot of breaking changes in this one, and if the above is merged before the password change, then we will be unable to upgrade to latest provider version with the password fixes, unless we do a host of other refactoring around repository resource types. |
Beta Was this translation helpful? Give feedback.
-
I will create a discussion for 380 |
Beta Was this translation helpful? Give feedback.
-
All, the first password update has been released in a major version bump. Please see the CHANGELOG.md Please let us know if this helps. We will be moving on to the next set of changes |
Beta Was this translation helpful? Give feedback.
I'm back from my leave and will start work on this ASAP.
The fixes to this problem will involve multiple iteration/major releases. The top priority is to unblock some of you from unable to use the
artifactory_user
resource, or upgrade the provider to later version.Here's our game plan:
Validation will be updated to match current/latest Artifactory policy.In addition, if password attribute is omitted in the HCL, a password will be generated automatically based on Artifactory policy. The provider will ignore the password state from theread()
(implementation TBD) so avoid unnecessary state drift.