Skip to content

Commit

Permalink
fix(core): Always set login methods when parsing Gen2 config files (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblanc committed May 2, 2024
1 parent 5f34186 commit f65cae2
Show file tree
Hide file tree
Showing 8 changed files with 247 additions and 120 deletions.
2 changes: 1 addition & 1 deletion packages/aws-amplify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
"name": "[Analytics] record (Pinpoint)",
"path": "./dist/esm/analytics/index.mjs",
"import": "{ record }",
"limit": "17.02 kB"
"limit": "17.05 kB"
},
{
"name": "[Analytics] record (Kinesis)",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/__mocks__/configMocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This directory contains equivalent Gen1 & Gen2 configurations which are used to validate interoperability between
different config versions/schemas. Make sure that any updates applied to one are applied to the other.
78 changes: 78 additions & 0 deletions packages/core/__mocks__/configMocks/amplify_outputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"$schema": "adipisicing cillum",
"version": "1",
"auth": {
"aws_region": "us-west-2",
"user_pool_id": "mock-cup-id",
"user_pool_client_id": "mock-cup-client-id",
"identity_pool_id": "mock-idp-id",
"oauth": {
"identity_providers": ["FACEBOOK", "SIGN_IN_WITH_APPLE", "GOOGLE"],
"domain": "mock-oauth-domain",
"scopes": ["phone"],
"redirect_sign_in_uri": ["mock-sign-in-uri"],
"redirect_sign_out_uri": ["mock-sign-out-uri"],
"response_type": "token"
},
"standard_required_attributes": [
"address",
"locale",
"email"
],
"username_attributes": ["phone_number", "email"],
"user_verification_types": ["email"],
"unauthenticated_identities_enabled": true,
"mfa_configuration": "OPTIONAL",
"mfa_methods": ["TOTP", "SMS"],
"password_policy": {
"require_lowercase": true,
"require_numbers": true,
"require_uppercase": true,
"require_symbols": true,
"min_length": 6
}
},
"data": {
"aws_region": "us-west-2",
"url": "mock-data-url",
"api_key": "mock-data-api-key",
"default_authorization_type": "API_KEY",
"authorization_types": []
},
"geo": {
"aws_region": "us-west-2",
"search_indices": {
"items": [
"mock-geo-search-item",
"mock-geo-search-item-alt"
],
"default": "mock-geo-search-item"
},
"geofence_collections": {
"items": [
"mock-geo-fence-item",
"mock-geo-fence-item-alt"
],
"default": "mock-geo-fence-item"
}
},
"custom": {
"custom-prop": -51806024,
"custom-prop-alt": 87599986
},
"notifications": {
"aws_region": "us-west-2",
"amazon_pinpoint_app_id": "mock-pinpoint-app-id",
"channels": ["IN_APP_MESSAGING", "APNS"]
},
"analytics": {
"amazon_pinpoint": {
"app_id": "mock-pinpoint-app-id",
"aws_region": "us-west-2"
}
},
"storage": {
"bucket_name": "mock-storage-bucket",
"aws_region": "us-west-2"
}
}
69 changes: 69 additions & 0 deletions packages/core/__mocks__/configMocks/amplifyconfiguration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"aws_project_region": "us-west-2",
"aws_cognito_identity_pool_id": "mock-idp-id",
"aws_cognito_username_attributes": ["PHONE_NUMBER", "EMAIL"],
"aws_cognito_signup_attributes": ["EMAIL", "ADDRESS", "LOCALE"],
"aws_cognito_mfa_configuration": "OPTIONAL",
"aws_cognito_mfa_types": ["TOTP", "SMS"],
"aws_cognito_password_protection_settings": {
"passwordPolicyMinLength": 6,
"passwordPolicyCharacters": [
"REQUIRES_SYMBOLS",
"REQUIRES_UPPERCASE",
"REQUIRES_LOWERCASE",
"REQUIRES_NUMBERS"
]
},
"oauth": {
"domain": "mock-oauth-domain",
"scope": ["phone"],
"redirectSignIn": "mock-sign-in-uri",
"redirectSignOut": "mock-sign-out-uri",
"responseType": "token"
},
"aws_cognito_verification_mechanisms": ["EMAIL"],
"aws_cognito_social_providers": ["FACEBOOK", "APPLE", "GOOGLE"],
"aws_mobile_analytics_app_id": "mock-pinpoint-app-id",
"aws_mobile_analytics_app_region": "us-west-2",
"aws_user_files_s3_bucket": "mock-storage-bucket",
"aws_user_files_s3_bucket_region": "us-west-2",
"aws_user_pools_id": "mock-cup-id",
"aws_user_pools_web_client_id": "mock-cup-client-id",
"geo": {
"amazon_location_service": {
"search_indices": {
"items": [
"mock-geo-search-item",
"mock-geo-search-item-alt"
],
"default": "mock-geo-search-item"
},
"geofenceCollections": {
"items": [
"mock-geo-fence-item",
"mock-geo-fence-item-alt"
],
"default": "mock-geo-fence-item"
},
"region": "us-west-2"
}
},
"aws_appsync_graphqlEndpoint": "mock-data-url",
"aws_appsync_apiKey": "mock-data-api-key",
"aws_appsync_region": "us-west-2",
"aws_appsync_authenticationType": "API_KEY",
"Notifications": {
"InAppMessaging": {
"AWSPinpoint": {
"appId": "mock-pinpoint-app-id",
"region": "us-west-2"
}
},
"Push": {
"AWSPinpoint": {
"appId": "mock-pinpoint-app-id",
"region": "us-west-2"
}
}
}
}
72 changes: 0 additions & 72 deletions packages/core/__tests__/amplify_outputs.json

This file was deleted.

0 comments on commit f65cae2

Please sign in to comment.