Skip to content
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

feat(Auth): provide AuthConfiguration from plugin #3566

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lawmicha
Copy link
Contributor

@lawmicha lawmicha commented Mar 13, 2024

Issue #

Description

AWSCognitoAuthPlugin currently provides the amplifyconfiguration.json file through the jsonConfiguration property. This PR deprecates that and provides the SPI public AuthConfiguration type. By only deprecating it and not removing the jsonConfiguration object provides a non-breaking change to Authenticator that uses it.

Related aws-amplify/amplify-ui-swift-authenticator#58

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@lawmicha lawmicha requested a review from a team as a code owner March 13, 2024 19:09
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 72.85714% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 68.41%. Comparing base (c49d836) to head (44ad12b).
Report is 4 commits behind head on main.

Files Patch % Lines
...thPlugin/Support/Helpers/ConfigurationHelper.swift 82.35% 9 Missing ⚠️
...ugin/StateMachine/CodeGen/Data/UserAttribute.swift 0.00% 8 Missing ⚠️
.../StateMachine/CodeGen/Data/AuthConfiguration.swift 50.00% 1 Missing ⚠️
...e/CodeGen/Data/IdentityPoolConfigurationData.swift 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3566      +/-   ##
==========================================
- Coverage   68.42%   68.41%   -0.01%     
==========================================
  Files        1077     1079       +2     
  Lines       36287    36359      +72     
==========================================
+ Hits        24829    24875      +46     
- Misses      11458    11484      +26     
Flag Coverage Δ
API_plugin_unit_test 67.50% <ø> (ø)
AWSPluginsCore 66.90% <ø> (ø)
Amplify 48.18% <ø> (+0.08%) ⬆️
Analytics_plugin_unit_test 81.16% <ø> (ø)
Auth_plugin_unit_test 78.90% <72.85%> (-0.13%) ⬇️
CoreMLPredictions_plugin_unit_test 59.44% <ø> (ø)
DataStore_plugin_unit_test 82.33% <ø> (-0.06%) ⬇️
Geo_plugin_unit_test 70.75% <ø> (ø)
Logging_plugin_unit_test 62.87% <ø> (ø)
Predictions_plugin_unit_test 37.10% <ø> (ø)
PushNotifications_plugin_unit_test 87.13% <ø> (ø)
Storage_plugin_unit_test 77.61% <ø> (ø)
unit_tests 68.41% <72.85%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -25,7 +26,7 @@ extension IdentityPoolConfigurationData: CustomDebugDictionaryConvertible {
}

extension IdentityPoolConfigurationData: CustomDebugStringConvertible {
var debugDescription: String {
public var debugDescription: String {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing @spi

Suggested change
public var debugDescription: String {
@_spi(InternalAmplifyConfiguration)
public var debugDescription: String {

@harsh62
Copy link
Member

harsh62 commented Mar 18, 2024

It would be nice if we can write some tests around the parsing logic, just to make sure everything works as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants