getMFAValidationRequired checks to see if the secret exists and has an MFA requirement. If MFA is required and the number of constraints is greater than 1, we can assert that interactive validation is not required.
(secret *api.Secret)
| 310 | // requirement. If MFA is required and the number of constraints is greater than |
| 311 | // 1, we can assert that interactive validation is not required. |
| 312 | func (c *BaseCommand) getMFAValidationRequired(secret *api.Secret) bool { |
| 313 | if secret != nil && secret.Auth != nil && secret.Auth.MFARequirement != nil { |
| 314 | if c.flagMFA == nil && len(secret.Auth.MFARequirement.MFAConstraints) == 1 { |
| 315 | return true |
| 316 | } else if len(secret.Auth.MFARequirement.MFAConstraints) > 1 { |
| 317 | return true |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | return false |
| 322 | } |
| 323 | |
| 324 | // getInteractiveMFAMethodInfo returns MFA method information only if operating |
| 325 | // in interactive mode and one MFA method is configured. |
no outgoing calls
no test coverage detected