CognitoIdentity: Allow public actions even if IAM auth is enabled (#7335)
This commit is contained in:
parent
f2e51d18ae
commit
0ba2561539
@ -144,6 +144,8 @@ class ActionAuthenticatorMixin(object):
|
|||||||
request_count: ClassVar[int] = 0
|
request_count: ClassVar[int] = 0
|
||||||
|
|
||||||
PUBLIC_OPERATIONS = [
|
PUBLIC_OPERATIONS = [
|
||||||
|
"AWSCognitoIdentityService.GetId",
|
||||||
|
"AWSCognitoIdentityService.GetOpenIdToken",
|
||||||
"AWSCognitoIdentityProviderService.ConfirmSignUp",
|
"AWSCognitoIdentityProviderService.ConfirmSignUp",
|
||||||
"AWSCognitoIdentityProviderService.GetUser",
|
"AWSCognitoIdentityProviderService.GetUser",
|
||||||
"AWSCognitoIdentityProviderService.ForgotPassword",
|
"AWSCognitoIdentityProviderService.ForgotPassword",
|
||||||
|
@ -10,6 +10,7 @@ from botocore.exceptions import ClientError
|
|||||||
from moto import mock_aws, settings
|
from moto import mock_aws, settings
|
||||||
from moto.cognitoidentity.utils import get_random_identity_id
|
from moto.cognitoidentity.utils import get_random_identity_id
|
||||||
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
|
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
|
||||||
|
from moto.core import set_initial_no_auth_action_count
|
||||||
|
|
||||||
|
|
||||||
@mock_aws
|
@mock_aws
|
||||||
@ -153,6 +154,8 @@ def test_get_random_identity_id():
|
|||||||
|
|
||||||
|
|
||||||
@mock_aws
|
@mock_aws
|
||||||
|
# Verify we can call this operation without Authentication
|
||||||
|
@set_initial_no_auth_action_count(1)
|
||||||
def test_get_id():
|
def test_get_id():
|
||||||
conn = boto3.client("cognito-identity", "us-west-2")
|
conn = boto3.client("cognito-identity", "us-west-2")
|
||||||
identity_pool_data = conn.create_identity_pool(
|
identity_pool_data = conn.create_identity_pool(
|
||||||
@ -217,6 +220,7 @@ def test_get_open_id_token_for_developer_identity_when_no_explicit_identity_id()
|
|||||||
|
|
||||||
|
|
||||||
@mock_aws
|
@mock_aws
|
||||||
|
@set_initial_no_auth_action_count(0)
|
||||||
def test_get_open_id_token():
|
def test_get_open_id_token():
|
||||||
conn = boto3.client("cognito-identity", "us-west-2")
|
conn = boto3.client("cognito-identity", "us-west-2")
|
||||||
result = conn.get_open_id_token(IdentityId="12345", Logins={"someurl": "12345"})
|
result = conn.get_open_id_token(IdentityId="12345", Logins={"someurl": "12345"})
|
||||||
|
Loading…
Reference in New Issue
Block a user