Skip to content
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

Fix panic while importing MFA Duo resource #1669

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

vinay-gopalan
Copy link
Contributor

@vinay-gopalan vinay-gopalan commented Nov 16, 2022

Relates OR Closes #1606 #1527

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestMFADuoBasic'
=== RUN   TestMFADuoBasic
--- PASS: TestMFADuoBasic (1.42s)
PASS

Copy link
Contributor

@benashz benashz left a comment

Choose a reason for hiding this comment

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

Looking good. I noticed a small issue in mfaDuoRead(). We should probably address that before merging.

}

name := d.Get("name").(string)
name := d.Id()

resp, err := client.Logical().Read(mfaDuoPath(name))
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably be handling the case where resp is nil. In that case we would return nil to denote that resource does not exist in Vault.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call! Added this check on L121

Copy link
Contributor

@benashz benashz left a comment

Choose a reason for hiding this comment

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

LGTM!

@vinay-gopalan vinay-gopalan merged commit 0ab86b5 into main Nov 16, 2022
@vinay-gopalan vinay-gopalan deleted the VAULT-4825/fix-duo-import branch November 16, 2022 18:00
@vinay-gopalan vinay-gopalan added this to the 3.11.0 milestone Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic importing vault_mfa_duo
2 participants