CP-3829 Upgrade plugin passwords to new credentials object#269
Merged
rasantel merged 4 commits intodelphix:projects/password-vault-pluginsfrom Dec 10, 2020
Merged
CP-3829 Upgrade plugin passwords to new credentials object#269rasantel merged 4 commits intodelphix:projects/password-vault-pluginsfrom
rasantel merged 4 commits intodelphix:projects/password-vault-pluginsfrom
Conversation
35d5439 to
ecddbce
Compare
mothslaw
approved these changes
Dec 8, 2020
Contributor
mothslaw
left a comment
There was a problem hiding this comment.
Looks great. Sorry you had to deal with that Jython/unicode nonsense.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
As discussed on https://docs.google.com/document/d/11qMuv755UquN8a_D3PDukJDOacvNCOv_TK4bbbvkBos/edit#heading=h.enbe66druy0e, plugin writers should have an option to upgrade their existing password fields to the new, more general credentials provider type of field introduced in CP-3163 which adds the option to use password vaults.
Solution
App gate companion review: http://reviews.delphix.com/r/63226/
Added a new callback
upgrade_passwordthat plugin migrations can call to upgrade a payload's password fields to credentials supplier. Specifically,upgrade_passwordreturns a credentials supplier that "directly" supplies the password (i.e. a supplier that itself contains the password, rather than using a password vault).From a Delphix user's perspective, the field continues to provide the same password, so nothing changes immediately. The only difference is that, after the upgrade, the user can now modify the way in which the field supplies a password (e.g. fetch it from a password vault).
Two other optional parameters can be passed to
upgrade_password:username(a string) andexpectedSecretType(eitherANYorPASSWORD, used at runtime to validate the type of credentials returned by the credentials supplier).The credentials supplier returned by the new callback is a protobuf
Structof this form:This
Structconforms to Virtualization's JSON Schema definition of adirectPasswordCredentialsSupplierwhich is one of the possible forms thatcredentialsSuppliercan take: https://gitlab.delphix.com/app/dlpx-app-gate/blob/projects/password-vault-plugins/appliance/server/core/src/main/resources/json-schema/definitions.jsonUpdate
I had to patch protobuf's
json_format.pybecause Jython, unlike Python, cannot read Unicode's surrogate codes if they are not paired. See //github.com/protocolbuffers/protobuf/issues/7776 .Manual testing
credentialsSupplierdefinition.upgrade_passwordwith the password value and stores in that field the returned credentials supplier.Automated testing
Added unit tests.
dx-test: http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/dx-integration-tests/21976/
blackbox failed with dc timeout. Re-run: http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/blackbox-self-service/65826/consoleFull
appdata_basic APPDATA_PYTHON_DIRECT_CENTOS73: http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/blackbox-self-service/65689/
appdata_basic APPDATA_PYTHON_STAGED_CENTOS73: http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/blackbox-self-service/65690/
appdata_basic APPDATA_PYTHON_DIRECT_WIN2012: http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/blackbox-self-service/65691/
appdata_basic APPDATA_PYTHON_STAGED_WIN2012: http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/blackbox-self-service/65692/
appdata_plugin_upgrade from 1.0.0 to 2.1.0 using the VSDK change from PR 269: http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/blackbox-self-service/65687/