-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cognito/userpool)!: MFA not always working
-add field SoftwareTokenMFAConfiguration -remove deprecated UnusedAccountValidityDays -enhance several controller parts Signed-off-by: Charel Baum <charel.baum@accenture.com>
- Loading branch information
Charel Baum
committed
Oct 19, 2022
1 parent
9825b1f
commit 1624b0a
Showing
11 changed files
with
413 additions
and
107 deletions.
There are no files selected for viewing
This file contains 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
10 changes: 5 additions & 5 deletions
10
apis/cognitoidentityprovider/v1alpha1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
Copyright 2021 The Crossplane Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package fake | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/aws/request" | ||
"github.com/aws/aws-sdk-go/service/cognitoidentityprovider" | ||
"github.com/aws/aws-sdk-go/service/cognitoidentityprovider/cognitoidentityprovideriface" | ||
) | ||
|
||
// MockCognitoIdentityProviderClient for testing | ||
type MockCognitoIdentityProviderClient struct { | ||
cognitoidentityprovideriface.CognitoIdentityProviderAPI | ||
|
||
MockGetUserPoolMfaConfig func(*cognitoidentityprovider.GetUserPoolMfaConfigInput) (*cognitoidentityprovider.GetUserPoolMfaConfigOutput, error) | ||
MockSetUserPoolMfaConfigWithContext func(context.Context, *cognitoidentityprovider.SetUserPoolMfaConfigInput, []request.Option) (*cognitoidentityprovider.SetUserPoolMfaConfigOutput, error) | ||
|
||
Called MockCognitoIdentityProviderClientCall | ||
} | ||
|
||
// CallGetUserPoolMfaConfig to log call | ||
type CallGetUserPoolMfaConfig struct { | ||
Ctx aws.Context | ||
I *cognitoidentityprovider.GetUserPoolMfaConfigInput | ||
Opts []request.Option | ||
} | ||
|
||
// GetUserPoolMfaConfig calls MockGetUserPoolMfaConfig | ||
func (m *MockCognitoIdentityProviderClient) GetUserPoolMfaConfig(i *cognitoidentityprovider.GetUserPoolMfaConfigInput) (*cognitoidentityprovider.GetUserPoolMfaConfigOutput, error) { | ||
m.Called.GetUserPoolMfaConfig = append(m.Called.GetUserPoolMfaConfig, &CallGetUserPoolMfaConfig{I: i}) | ||
|
||
return m.MockGetUserPoolMfaConfig(i) | ||
} | ||
|
||
// CallSetUserPoolMfaConfigWithContext to log call | ||
type CallSetUserPoolMfaConfigWithContext struct { | ||
Ctx aws.Context | ||
I *cognitoidentityprovider.SetUserPoolMfaConfigInput | ||
Opts []request.Option | ||
} | ||
|
||
// SetUserPoolMfaConfigWithContext calls MockSetUserPoolMfaConfigWithContext | ||
func (m *MockCognitoIdentityProviderClient) SetUserPoolMfaConfigWithContext(ctx context.Context, i *cognitoidentityprovider.SetUserPoolMfaConfigInput, opts ...request.Option) (*cognitoidentityprovider.SetUserPoolMfaConfigOutput, error) { | ||
m.Called.SetUserPoolMfaConfigWithContext = append(m.Called.SetUserPoolMfaConfigWithContext, &CallSetUserPoolMfaConfigWithContext{Ctx: ctx, I: i, Opts: opts}) | ||
|
||
return m.MockSetUserPoolMfaConfigWithContext(ctx, i, opts) | ||
} | ||
|
||
// MockCognitoIdentityProviderClientCall to log calls | ||
type MockCognitoIdentityProviderClientCall struct { | ||
GetUserPoolMfaConfig []*CallGetUserPoolMfaConfig | ||
SetUserPoolMfaConfigWithContext []*CallSetUserPoolMfaConfigWithContext | ||
} |
Oops, something went wrong.