auth/aws: Make disallow_reauthentication and allow_instance_migration mutually exclusive #3291
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.
I was browsing through the Vault docs and source code (as I am wont to do...) and realized this was a small thing.
The semantics of disallow_reauthentication and allow_instance_migration
are mutually exclusive; the former says to never allow reauthentication
while the latter says to relax the conditions under which you allow
reauthentication. disallow_reauthentication takes precedence upon login
time, but it is probably better UX to call out to users at role CRUD
time that the role they are creating has contradictory semantics.
The specific way I'm doing this could cause backwards incompatibilities, both in scripts that create/update roles as well as breaking the ability to modify existing roles with both of these set to true. I'm not sure how big of a deal it would be. Instead of erroring out, I could just return a warning and set allow_instance_migration to false; I could also add in code that detects both of these being set to true in an existing role and sets allow_instance_migration to false so I don't break existing roles. For the time being, I went with the simpler approach and would appreciate your feedback on the best way to handle this.
I'm also throwing in some typo fixes in docs from a previous PR :)