-
Notifications
You must be signed in to change notification settings - Fork 247
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(logging): default remote config #3643
feat(logging): default remote config #3643
Conversation
ee65c89
to
d8e84a6
Compare
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add unit tests
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/local_storage/io_storage.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/local_storage/web_storage.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.vm.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.vm.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.vm.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.web.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml
Outdated
Show resolved
Hide resolved
5514bd8
to
5085ed1
Compare
chore: moved declarations to improve dart syntax chore: use logger instead of print statement chore: added sigv4signer to sign the http request chore: switched Future.delayed to Timer and implemented jsonserializable chore: roll back unnecessary changes from cloudwatch_logger_plugin chore: removed an extra line of fetchAndCacheConstraintFromEndpoint chore: moved saveConstraintLocally out of fetchConstraintFromEndpoint and moved into fetchAndCacheFromEndpoint fix: seeing if moving the queued_item_store_test.dart file into main test directory will fix testing issue Revert "fix: seeing if moving the queued_item_store_test.dart file into main test directory will fix testing issue" This reverts commit f033713. chore: added ignore line for try catch block and removed unnecessary method chore: added web implementation of remote_constraint_provider fix: try changing path provider dependency to fix test fix: added flutter sdk to dependencies chore: generated workflows after adding dependencies fix: fixed indentation issue in pubspec chore: generate new workflows chore: changed file and folder names for file_storage chore: fix import for renamed files, added region as a required field to DefaultRemoteConfiguration and fixed scope variable to adjust for that. Also moved scope variable to inside fetchConstraintFromEndpoint method replaced AmplifyLogger with AWSLoggerMixin instead. chore: made signer private and used AWSHttpRequest.get method directly rather than calling it through AWSHttpRequest use stoppable timer instead of while loop chore: updated LoggingConstraint class to match the remote config file chore: added AWSHeaders.accept to the headers for the request chore: added public documentation and trailing comma chore: removed unnecessary time checks in the getter if statement chore: removed initialize() method and put it into the constructor chore: removed unnecessary lastUpdate variable now that it is no longer checked in the getter chore: added a comment and removed flutter plugin files chore: fixed some formatting chore: removed the InSeconds part of the refreshIntervalInSeconds property because it's a Duration, which isn't specific to seconds chore: fixed comment to reflect change in fetchInterval and flushInterval property name change chore: make isRunning variable privatge chore: corrected error handling in the fetchAndCacheConstraintFromEndpoint method chore: add license headers to storage implementations chore: added path for join() method to ensure windows compatibility chore: removed dart:io dependency, changed HttpHeaders.acceptHeader to AWSHeaders.accept, changed getter to just retrieve from cache chore: remove flutter dependency chore: removed http and replaced with AWSHttpClient chore: removed unnecessary stop method chore: remove .flutter-plugins files chore: moved constructor initializers into a separate init function so that I can use async await chore: added local storage check before fetching in the initialize function chore: refactored DefaultRemoteLoggingConstraintProvider to separate createRequest from the rest of the class, allowing for signed and unsigned requests to be sent chore: used private global variable for local storage key chore: refacted fileStore dart implementation
447deec
to
53ef002
Compare
import 'package:aws_common/aws_common.dart'; | ||
import 'package:amplify_core/amplify_core.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: not sure what this change is for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump^
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
equals(json.decode(updatedJson)), | ||
); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: add a test for invalid json config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump^
packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Outdated
Show resolved
Hide resolved
…ependency is removed
…oved flutter plugin gitignore
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Show resolved
Hide resolved
…removed credentials provider from base class and only added to defaultconstraintprovider, changed fileStorage to use FileStorage instead of just FileStorageImpl, removed isRunning since it is never false after the first run, added completer so that delay isn't needed for tests, removed the catching of errors, added credentials provider parameter to awssigv4signer,
…gin_config.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com>
…gin_config.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com>
…e_storage/file_storage.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com>
…e_storage/file_storage.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com>
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart
Show resolved
Hide resolved
…ote_constraint_provider.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com>
…ote_constraint_provider.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com>
…ote_constraint_provider.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com>
…ote_constraint_provider.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com>
import 'package:aws_common/aws_common.dart'; | ||
import 'package:amplify_core/amplify_core.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump^
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart
Show resolved
Hide resolved
_credentialsProvider = credentialsProvider; | ||
FileStorageImpl? fileStorage, | ||
AWSHttpClient? awsHttpClient, | ||
}) : _fileStorage = fileStorage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump^
packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart
Outdated
Show resolved
Hide resolved
equals(json.decode(updatedJson)), | ||
); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump^
packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart
Outdated
Show resolved
Hide resolved
packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.dart
Outdated
Show resolved
Hide resolved
…_constraint_provider_test.dart Co-authored-by: NikaHsn <nika.hasani@gmail.com>
…_constraint_provider_test.dart Co-authored-by: NikaHsn <nika.hasani@gmail.com>
…e_storage/file_storage.dart Co-authored-by: NikaHsn <nika.hasani@gmail.com>
79725fb
into
feat/logging/cloudwatch
* feat(logging): add cloudwatch logger plugin * feat(logging): default remote config chore: moved declarations to improve dart syntax chore: use logger instead of print statement chore: added sigv4signer to sign the http request chore: switched Future.delayed to Timer and implemented jsonserializable chore: roll back unnecessary changes from cloudwatch_logger_plugin chore: removed an extra line of fetchAndCacheConstraintFromEndpoint chore: moved saveConstraintLocally out of fetchConstraintFromEndpoint and moved into fetchAndCacheFromEndpoint fix: seeing if moving the queued_item_store_test.dart file into main test directory will fix testing issue Revert "fix: seeing if moving the queued_item_store_test.dart file into main test directory will fix testing issue" This reverts commit f033713. chore: added ignore line for try catch block and removed unnecessary method chore: added web implementation of remote_constraint_provider fix: try changing path provider dependency to fix test fix: added flutter sdk to dependencies chore: generated workflows after adding dependencies fix: fixed indentation issue in pubspec chore: generate new workflows chore: changed file and folder names for file_storage chore: fix import for renamed files, added region as a required field to DefaultRemoteConfiguration and fixed scope variable to adjust for that. Also moved scope variable to inside fetchConstraintFromEndpoint method replaced AmplifyLogger with AWSLoggerMixin instead. chore: made signer private and used AWSHttpRequest.get method directly rather than calling it through AWSHttpRequest use stoppable timer instead of while loop chore: updated LoggingConstraint class to match the remote config file chore: added AWSHeaders.accept to the headers for the request chore: added public documentation and trailing comma chore: removed unnecessary time checks in the getter if statement chore: removed initialize() method and put it into the constructor chore: removed unnecessary lastUpdate variable now that it is no longer checked in the getter chore: added a comment and removed flutter plugin files chore: fixed some formatting chore: removed the InSeconds part of the refreshIntervalInSeconds property because it's a Duration, which isn't specific to seconds chore: fixed comment to reflect change in fetchInterval and flushInterval property name change chore: make isRunning variable privatge chore: corrected error handling in the fetchAndCacheConstraintFromEndpoint method chore: add license headers to storage implementations chore: added path for join() method to ensure windows compatibility chore: removed dart:io dependency, changed HttpHeaders.acceptHeader to AWSHeaders.accept, changed getter to just retrieve from cache chore: remove flutter dependency chore: removed http and replaced with AWSHttpClient chore: removed unnecessary stop method chore: remove .flutter-plugins files chore: moved constructor initializers into a separate init function so that I can use async await chore: added local storage check before fetching in the initialize function chore: refactored DefaultRemoteLoggingConstraintProvider to separate createRequest from the rest of the class, allowing for signed and unsigned requests to be sent chore: used private global variable for local storage key chore: refacted fileStore dart implementation * chore: dart FileStorage refactor and unit tests added * chore: made the Future.delayed more explicit * chore: added flutter path provider to amplify_logging_cloudwatch * chore: removed fluter dependency * chore: remove flutter plugin files from git ignore now that flutter dependency is removed * chore: changed names of file storage functions, logger level, and removed flutter plugin gitignore * chore: remove flutter plugin .gitignore * chore: Added completer, removed conditional import, added closeable, removed credentials provider from base class and only added to defaultconstraintprovider, changed fileStorage to use FileStorage instead of just FileStorageImpl, removed isRunning since it is never false after the first run, added completer so that delay isn't needed for tests, removed the catching of errors, added credentials provider parameter to awssigv4signer, * chore: updated aft workflows * Update packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com> * Update packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/plugin_config.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com> * chore: removed manual toJson and replace jsonSerializable with zAmplifySerializable * Update packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com> * Update packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com> * chore: use factory constructor and _fileStorage might be null in remoteConstraint * chore: fixed local storage variable and method name and also added and fixed tests * Update packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com> * Update packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com> * Update packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com> * Update packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com> * chore: add AWSSerializable and added comment to test to address Future.delayed * chore: fixed some formatting and removed todo comment * chore: removed unnecessary comments * Update packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart Co-authored-by: NikaHsn <nika.hasani@gmail.com> * Update packages/logging_cloudwatch/aws_logging_cloudwatch/test/remote_constraint_provider_test.dart Co-authored-by: NikaHsn <nika.hasani@gmail.com> * Update packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/file_storage/file_storage.dart Co-authored-by: NikaHsn <nika.hasani@gmail.com> --------- Co-authored-by: Nika Hassani <nikaws@amazon.com> Co-authored-by: Dillon Nys <24740863+dnys1@users.noreply.github.com> Co-authored-by: NikaHsn <nika.hasani@gmail.com>
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.