-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amplify Configure passwordPolicyMinLength expected int but is string #9655
Comments
Hi @jody-schering thank you for bringing this issue to our attention. This appears to be an issue with Amplify-cli setting the "passwordPolicyMinLength" field to a string instead of an int. Let's move your issue to their repo and ask them to help out. Current:
Expected:
|
Please note, it seems amplify-cli used to generate just the integer with no quotes (based on the older amplifyconfiguration.json files we have in our repo) so having Amplify-flutter change to accept quotes could break existing user configurations. |
I've opened a PR with a fix. @jody-schering - can you share which version of the CLI you're using so I can add a test case? |
I'm currently using 7.6.13 |
It appears that this issue is resolved by aws-amplify/amplify-flutter#1323, so I'm going to close this. Please let me know if additional action is required. |
Describe the bug
On 0.3.2 when calling Amplify.configure() passing in the generated amplify configuration and with the auth plugin added I get the following exception:
flutter: type 'String' is not a subtype of type 'int?' in type cast
flutter: #0 _$PasswordProtectionSettingsFromJson
package:amplify_flutter/…/cognito/password_protection_settings.g.dart:27
aws-amplify/amplify-flutter#1 new PasswordProtectionSettings.fromJson
package:amplify_flutter/…/cognito/password_protection_settings.dart:39
aws-amplify/amplify-flutter#2 _$CognitoAuthConfigFromJson
package:amplify_flutter/…/cognito/auth.g.dart:45
aws-amplify/amplify-flutter#3 new CognitoAuthConfig.fromJson
package:amplify_flutter/…/cognito/auth.dart:76
aws-amplify/amplify-flutter#4 _$CognitoPluginConfigFromJson.
package:amplify_flutter/…/auth/cognito_config.g.dart:49
aws-amplify/amplify-flutter#5 _$AWSConfigMapFromJson.
package:amplify_flutter/…/config/config_map.g.dart:30
aws-amplify/amplify-flutter#6 MapMixin.map (dart:collection/maps.dart:170:28)
aws-amplify/amplify-flutter#7 _$AWSConfigMapFromJson
package:amplify_flutter/…/config/config_map.g.dart:29
aws-amplify/amplify-flutter#8 new AWSConfigMap.fromJson
package:amplify_flutter/…/config/config_map.dart:82
aws-amplify/amplify-flutter#9 _$CognitoPluginConfigFromJson <…>
amplify creates the config with auth password protection settings passwordPolicyMinLength as a string, but from the error above it is expecting it to be an int?. Manually changing passwordPolicyMinLength to an int fixes the error. However since its generated it always gets overridden.
"passwordProtectionSettings": {
"passwordPolicyMinLength": "10",
"passwordPolicyCharacters": [
"REQUIRES_LOWERCASE",
"REQUIRES_UPPERCASE",
"REQUIRES_NUMBERS",
"REQUIRES_SYMBOLS"
]
},
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Amplify.configure does not throw a cast exception.
Screenshots
N/A
Platform
Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply):
[] Android
[x] iOS
Output of
Generated by pub
See https://dart.dev/tools/pub/glossary#lockfile
packages:
amplify_analytics_pinpoint:
dependency: "direct main"
description:
name: amplify_analytics_pinpoint
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_analytics_plugin_interface:
dependency: transitive
description:
name: amplify_analytics_plugin_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_api:
dependency: "direct main"
description:
name: amplify_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_api_plugin_interface:
dependency: transitive
description:
name: amplify_api_plugin_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_auth_cognito:
dependency: "direct main"
description:
name: amplify_auth_cognito
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_auth_plugin_interface:
dependency: transitive
description:
name: amplify_auth_plugin_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_core:
dependency: "direct main"
description:
name: amplify_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_datastore:
dependency: "direct main"
description:
name: amplify_datastore
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_datastore_plugin_interface:
dependency: transitive
description:
name: amplify_datastore_plugin_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_flutter:
dependency: "direct main"
description:
name: amplify_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
amplify_storage_plugin_interface:
dependency: transitive
description:
name: amplify_storage_plugin_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
another_flushbar:
dependency: transitive
description:
name: another_flushbar
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.28"
another_transformer_page_view:
dependency: transitive
description:
name: another_transformer_page_view
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
bloc:
dependency: transitive
description:
name: bloc
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
cross_file:
dependency: transitive
description:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
date_time_format:
dependency: transitive
description:
name: date_time_format
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
equatable:
dependency: "direct main"
description:
name: equatable
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_bloc:
dependency: "direct main"
description:
name: flutter_bloc
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.1"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
flutter_login:
dependency: "direct main"
description:
name: flutter_login
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
flutter_signin_button:
dependency: transitive
description:
name: flutter_signin_button
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: transitive
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "9.2.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.4"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.4+4"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.0"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
nested:
dependency: transitive
description:
name: nested
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
provider:
dependency: transitive
description:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.1"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1+1"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
url_launcher:
dependency: transitive
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.17"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.13"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.13"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
uuid:
dependency: transitive
description:
name: uuid
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.5"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
sdks:
dart: ">=2.15.0 <3.0.0"
flutter: ">=2.5.0"
The text was updated successfully, but these errors were encountered: