aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.32k stars 248 forks source link

Feature Request: Export UnmetPasswordRequirements #5435

Open JoseAlba opened 1 month ago

JoseAlba commented 1 month ago

Description

Need to export UnmetPasswordRequirements as developers can not currently override class: InputResolver method: passwordRequires.

Amplify_authenticator is exporting auth_strings_resolver and auth_strings_resolver exports input_resolver. Input resolver has a few methods that are meant to be exposed to the public to be overriden.

file:amplify_authenticator.dart export 'src/l10n/auth_strings_resolver.dart' hide ButtonResolverKeyType;

file: auth_string_resolver.dart export 'input_resolver.dart';

In method passwordRequires one of the parameters is of type UnmetPasswordRequirements. Previously the API was called PasswordProtectionSettings which was exported for developer usage.

  String passwordRequires(
    BuildContext context,
    UnmetPasswordRequirements requirements,
  ) 

The solution here is exporting the UnmetPasswordRequirements so that developers can override the InputResolver class. If Amplify doesn't want to continue extending this API, I recommend using the dart keyword sealed so that the class can't be extended.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Categories

Steps to Reproduce

Try to override UnmetPasswordRequirements in passwordRequires method

Screenshots

No response

Platforms

Flutter Version

3.24.1

Amplify Flutter Version

2.4.1

Deployment Method

Amplify Gen 2

Schema

No response

JoseAlba commented 1 month ago

This PR fixe this issue: https://github.com/aws-amplify/amplify-flutter/pull/5403

Equartey commented 1 month ago

Hi @JoseAlba, thanks for taking the time to open this issue and PR.

Please address the feedback on the PR and we will get this merged

JoseAlba commented 1 month ago

Thank you Elijah, I addressed your comment

tyllark commented 1 month ago

Hi @JoseAlba, I created PR #5437 to address some additional linter errors. This will also simply the CI permission process that was causing checks to fail on your PR. I will let you know once it get's merged!

JoseAlba commented 1 month ago

LGTM

tyllark commented 1 month ago

@JoseAlba We just merged the PR, so the changes will be available with our next release. We will post an update here when we deploy the release!