-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Adding Credential Input Source Export for Exporting Credentials using awxkit #14798
base: devel
Are you sure you want to change the base?
Conversation
Hello, I finished working on this PR. |
@neevnuv Ok, here's what I think. After sitting down and experimenting with an input source for a bit, I see that the related endpoint off of Instead, I think you should just add Yes, this has the downside that users will need to remember to explicitly export their credential input sources (unless they are exporting everything), but I think it will be simpler all around. |
As of now, I made it possible to access the credential_input_sources using:
and allow the credentials that use input sources to export them when using:
Now I am researching on payload functions and how they are used. |
@@ -48,6 +49,7 @@ | |||
('Inventory', 'Host'), | |||
('Inventory', 'Label'), | |||
('WorkflowJobTemplateNode', 'WorkflowApprovalTemplate'), | |||
('Credential', 'CredentialInputSource'), |
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.
You probably don't want this here.
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.
won't this allow to export the credential input sources when imoprting a credential with an input source?
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.
No. As I explained before, DEPENDENT_EXPORT
doesn't quite work with how this relationship is being exposed in the API. You'll have to leave this out, and in order to correctly export a user will need to do both --credentials
and --credential_input_sources
.
6908d92
to
888e3b2
Compare
I keep getting this when importing
any idea what is going on? |
@neevnuv The above traceback is because you don't have the HasCreate mixin class as one of the bases for your new page type. Please include everything in api/mixins/ that seems relevant for this type of API endpoint. |
Thanks for the feedback, I added only HasCreate. Reasons: |
* testing on credential_input_source output * testing2 * change from usage of credential_input_source to related_input_source * fix change * Add natural key * remove description from natural key
* testing on credential_input_source output * testing2 * change from usage of credential_input_source to related_input_source * fix change * Add natural key * remove description from natural key
cc @fosterseth |
Quality Gate passedIssues Measures |
@fosterseth @jbradberry @djyasin I'm currently encountering the same issue (#14738) with TSS SecureVault secrets. AWX instance credentials are setup to pull username/passwords from TSS SecureVault instead of storing in plaintext/encrypted in the username/password fields. Was going through export/import AWX process, and attempting to inject secrets back into credentials during the import process. Attempted to add the TSS JSON inside of the inputs block like so: "inputs": {
"password": {
"secret_field": "password",
"secret_id": "#####"
},
"username": {
"secret_field": "username",
"secret_id": "#####"
}
}, But met with this error message: After diving into the AWX instance with credentials objects that are setup correctly, inputs and input_sources block are missing even before export/import is attempted: // using awx-manage shell_plus for below- https://github.com/ansible/awx/blob/989a4387df6cf802a0f00c0251669ff6116889c0/docs/credentials/extract_credentials.md?plain=1#L23C1-L23C105
Seems to me that this PR would possibly address this issue. Are there plans to merge this? Any other guidence would be much appreciated, thanks! |
@lukewestervelt I'm afraid I'm no longer on this team and have no further say in what happens on this project. Hopefully @fosterseth will be able to make that call. My recollection was that this PR is ready or close to it. |
SUMMARY
When exporting credentials using awxkit, if the credential had input sources, they would not be exported.
This PR will add the ability to export those values and import them afterwards. #14738
ISSUE TYPE
COMPONENT NAME
AWX VERSION
ADDITIONAL INFORMATION