High-level APIs for Amazon Web Services (AWS) in Dart

Overview

Build Status

High-level APIs for Amazon Web Services (AWS) in Dart

Published generated packages

TODO

  • Implement EC2 protocol

Maintenance

Update travis config:

# run only once:
# pub global activate mono_repo

# if there is an update in mono_pkg.yaml
pub global run mono_repo travis
Comments
  • [BUG] Error When Flattening MessageAttributeValue and MessageSystemAttributeValue

    [BUG] Error When Flattening MessageAttributeValue and MessageSystemAttributeValue

    When sending an SQS message, the library attempts to flatten the extra parameters from sendMessage() at sqs-2012-11-15.dart:1681 in the auto generated package. The optional parameters are for the messageAttributes (Map<String, MessageAttribute>) and messageSystemAttributes (Map<String, MessageSystemAttribute>). Somewhere down the line, send() gets called at query.dart:42 in the shared auto generated package which calls _buildRequest() > flatQueryParams() > _flatten() all in the same file. _flatten checks for the type to flatten it for the request but fails because there is no case to handle MessageAttribute or MessageSystemAttribute. I would fix and submit another PR but I don't really have the time. Here is the error:

    [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: Invalid argument(s): Unknown type at "MessageAttributes.entry.1.value": MessageAttributeValue (Instance of 'MessageAttributeValue')
    #0      _flatten (package:shared_aws_api/src/protocol/query.dart:140:3)
    #1      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:146:12)
    #2      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:139:32)
    #3      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:139:32)
    #4      MapMixin.addEntries (dart:collection/maps.dart:172:23)
    #5      new Map.fromEntries (dart:core/map.dart:187:17)
    #6      flatQueryParams (package:shared_aws_api/src/protocol/query.dart:89:14)
    #7      QueryProtocol._buildRequest (package:shared_aws_api/src/protocol/query.dart:74:26)
    #8      QueryProtocol.send (package:shared_aws_api/src/protocol/query.dart:49:16)
    #9      SQS.sendMessage (package:aws_sqs_api/sqs-2012-11-05.dart:1705:37)
    

    EDIT: Here is my code causing the error:

        sqs.sendMessage(
            messageBody: unsentEntries[i].toJson().toString(),
            queueUrl: sqsUrl,
            messageGroupId: unsentEntries[i].company.shortName.replaceAll(' ', ''),
            messageDeduplicationId: utils.getUuid(),
            messageAttributes: <String, MessageAttributeValue>{
              'companyId': new MessageAttributeValue(dataType:'string', stringValue: unsentEntries[i].company.id)
            });
    
    opened by lucasdina 17
  • Write a full-featured SDK based on code generation and predefined API definitions

    Write a full-featured SDK based on code generation and predefined API definitions

    Suggestion

    I suggest a discussion about a general solution in order to make a feature complete Dart AWS SDK.

    What has been done

    I made an attempt to generate all AWS services, statically typed, by building a general source code generator. This seemed promising until I realised all nuances and the complexity of AWS services in aggregate.

    Idea

    Why not copy the JS SDK architecture, and just type it statically at the bounds of the API.

    TypedClassInputArgument -> serviceFunction() -> TypedClassInputArgument.toJson() -> JS SDK implemented in Dart -> JSON -> TypedClassOutput.fromJson()

    By this design, the architecture and reference implementation would be given. Most of the specifics of Dart, such as signing requests, etc, is already solved. The underlying architecture would need to be implemented, such as the core and protocols.

    It would then be as easy as to prepend a JSON defined API with final Map<String, dynamic> definition = and rename the file to .dart in order to have a statically compilable Dart Map to load in runtime.

    opened by Schwusch 16
  • Headers are not sent with a RestXmlRequest

    Headers are not sent with a RestXmlRequest

    Hello,

    The headers map passed to the send() function of the RestXmlProtocol is not passed to the _buildRequest() method and are not sent to the server. As a result, S3 object metadatas cannot be uploaded.

    opened by thomas94100 15
  • Invoking a lambda function does not return payload

    Invoking a lambda function does not return payload

    try {
          CognitoAuthSession session = await Amplify.Auth.fetchAuthSession(
              options: CognitoSessionOptions(getAWSCredentials: true));
    
          AwsClientCredentials cred = AwsClientCredentials(
              accessKey: session.credentials.awsAccessKey,
              secretKey: session.credentials.awsSecretKey,
              sessionToken: session.credentials.sessionToken);
    
          final service = Lambda(region: region, credentials: cred);
    
          try {
            List<int> list =
                '{"key1": "value1","key2": "value2","key3": "value3"}'.codeUnits;
    
            InvocationResponse updateItemOutput = await service.invoke(
                functionName: "amplify-lambda-invoke-test",
                invocationType: InvocationType.event,
                payload: Uint8List.fromList(list));
            print(updateItemOutput.payload);
          } catch (e) {
            print("asd");
            print(e);
          }
        } on AuthError catch (e) {
          print(e);
        }
    
    
    

    This code snippet successfully invokes a lambda function but it returns a catch error "202 UnknownError: 202". Whereas this functions response should be "Hello from lambda". What am I doing wrong?

    opened by omchiii 13
  • Improve enum parameters

    Improve enum parameters

    I would like better type safety and user ergonomics for enumerated parameters.

    A suggestion would be enums with extensions:

    enum AttributeAction {
      ADD,
      PUT,
      DELETE
    }
    
    extension on AttributeAction {
      String get name {
        switch (this) {
          case AttributeAction.ADD:
            return 'ADD';
          case AttributeAction.PUT:
            return 'PUT';
          case AttributeAction.DELETE:
            return 'DELETE';
        }
        throw Exception('This will never throw');
      }
    }
    

    This would be received as such:

    foo(AttributeAction action) {
      bar(action.name)
    }
    

    And the call foo() would be:

    foo(AttributeAction.ADD) ;
    

    @isoos, what do you think?

    opened by Schwusch 12
  • One package vs. multiple packages for generated code.

    One package vs. multiple packages for generated code.

    /cc @Schwusch

    The current aws_client/lib/generated directory is 28MB. package:googleapis is a similar package, it is generated from service definitions, and it already had issues on pub.dev with dartdoc-generation or analysis timing out.

    Should we aim for N smaller packages instead of one big "everything-in-it" package?

    opened by isoos 12
  • Add generated services

    Add generated services

    I've made an AWS SDK generator and I thought I'd show one of the services it generates for you to give your thoughts on. If there is interest, I can provide the other AWS services as well.

    opened by Schwusch 10
  • putObject working but throws error

    putObject working but throws error

    Hello, s3 upload successful but throws error return error message = ""<" expected"

    My code:

    try {
      await service.putObject(
        bucket: bucketName,
        key: fileName,
        body: imageFile.readAsBytesSync(),
        acl: ObjectCannedACL.publicRead,
      );
    } catch (ex) {
      var error= ex;
    }
    
    opened by recepal 9
  • MalformedInput Sender: timestamp must follow ISO8601

    MalformedInput Sender: timestamp must follow ISO8601

    When using CloudWatch.putMetricData(), this error is observed:

    MalformedInput Sender: timestamp must follow ISO8601
    #0 QueryProtocol.send (package:shared_aws_api/src/protocol/query.dart:100:7)
    <asynchronous suspension>
    #1 CloudWatch.putMetricData (package:aws_cloudwatch_api/monitoring-2010-08-01.dart:2605:5)
    <asynchronous suspension>
    #2 FutureExtensions.onError.<anonymous closure> (dart:async/future.dart:1014:15)
    <asynchronous suspension>
    
    opened by cbatson 7
  • aws_cognito_idp_api username validation fails

    aws_cognito_idp_api username validation fails

    Username validation seems to be incorrect. I'm getting an error on adminDisableUser and adminDeleteUser with the username: 79fa9100-69d0-4fa0-aeef-68c6e7bf5d66

    Invalid argument (username): Argument does not conform to [\p{L}\p{M}\p{S}\p{N}\p{P}]+: "79fa9100-69d0-4fa0-aeef-68c6e7bf5d66"

    bug 
    opened by chirag729 7
  • Updated flattening in shared query protocol.

    Updated flattening in shared query protocol.

    It seems that #144 requires a breaking change in the protocol library. I've a related change in the code generator that would update how the attribute's toJson() is called, and together with this PR they seem to generate the required format for SQS.

    opened by isoos 7
  • Incompatilibty with `amplify_flutter`

    Incompatilibty with `amplify_flutter`

    Hi! I did some tests here with aws_lambda_api: ^1.2.0 and the amplify_flutter: ^1.0.0-next.1+1 the future version of the amplify_flutter seems to be incompatible with the aws_lambda_api at the moment we do the login and use the session key via aws_lambda_api. When we try to use it with logged user seems to be invalid. Do you'll intend to make the lib compatible in the next release?

    opened by raphaelbarbosaqwerty 0
  • Unable to access S3 via IAM role

    Unable to access S3 via IAM role

    Presently there is no out-of-the-box way to use this package from a container instance to access S3 via an IAM role. I am no expert, but I believe this may be due to there not being a credential provider making use of the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable.

    (Edited to correct description.)

    opened by cbatson 5
  • Include x-amz-security-token in set of signed headers

    Include x-amz-security-token in set of signed headers

    When sending a request using this signing scheme from ECS tasks on fargate, I get the following response:

    <Error><Code>AccessDenied</Code><Message>There were headers present in the request which were not signed</Message><HeadersNotSigned>x-amz-security-token</HeadersNotSigned>
    

    Moving the addition of the X-Amz-Security-Token header before the canonicalization of headers resolved this error for me.

    opened by dmosdallas 0
  • Refused to set unsafe header

    Refused to set unsafe header "Host"

    final service = S3(
        region: getAWSRegion(),
        credentials: AwsClientCredentials(
          accessKey: getAWSAccessKey(),
          secretKey: getAWSSecretKey(),
        ),
    );
    
    await service.putObject(
        bucket: getAWSS3Bucket(),
        key: path,
        body: await file.readAsBytes(),
        contentType: 'application/octet-stream',
    );
    
    opened by Kakukaho 2
  • Default providers in services

    Default providers in services

    This adds all the credential providers available in aws_credential_providers as a default argument in the service constructors.

    That means that services now, by default, can resolve assumed role credentials and from IMDS as well.

    opened by Schwusch 0
Owner
null
Building an app using AWS Amplify and Flutter

aws-amplify-flutter This repository is for building an app using AWS Amplify and Flutter. Module 0 - prerequisites [✓] Flutter (Channel stable, 2.5.3,

Adrian Mudzwiti 0 Oct 31, 2021
Just an application that creates a photo gallery which integrates both Flutter for front-end and AWS Amplify for back-end.

flutter_amplify A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

null 0 Nov 24, 2021
A smart farming application that makes agriculture more efficient and effective with the help of high-precision algorithms.

Submission by Titans for Bit-by-Bit(IIIT Bhagalpur) Entry of Titans, from SRM Institute of Science and Technology, Kattankulathur, to Bit-by-Bit(IIIT

Abhijeet Gupta 15 Oct 13, 2022
Project Dev.Quiz, developed in Next Level Week for Rocketseat.

DevQuiz ✅ Liftoff ?? ✅ Maximum Speed ??‍♂️ ✅ In Orbit ??‍?? ✅ Landing ?? ✅ Surface Exploration ⚡ ✅ Accelerating your Career ?? Topics ?? About ?? Prev

Felipe Sales 26 Sep 19, 2022
Um Quiz sobre a tecnologias, desenvolvido em Flutter, durante a semana NLW#5 - Next Level Week.

Descrição do projeto ⭐ Um aplicativo desenvolvido durante a semana Next Level Week#5 da Rocketseat. Um Quiz com informações sobre tecnologias em geral

Thaís Silveira 7 May 11, 2022
:atom: 🚀 NLW Quiz Dev - Flutter (a simple flutter quiz app built in Rocketseat Next Level Week)

Que tal acompanhar live codings de projetos reais ao vivo? Segue lá na twitch: Wilson Neto Dev na Twitch Next Level Week - Dev Quiz (NLW) Dev Quiz is

Wilson Neto B.R. 12 Jul 13, 2022
Aplicação mobile com Flutter produzida durante o Next Level Week #05

✨ Tecnologias Esse projeto foi desenvolvido com as seguintes tecnologias: Flutter Dart ?? Projeto O devquiz é um jogo de perguntas para avaliar os seu

Rocketseat Education 47 Nov 12, 2022
A Flutter starter-kit for production-level apps.

Flutter Starter Introduction We wanted to take Flutter a step further and accelerate the process of building production-level apps. Presenting our sol

GeekyAnts 374 Dec 30, 2022
Next Level Week 05 - Flutter - DevQuiz

devquiz A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Jardel Urban 2 Jun 5, 2022
O projeto PayFlow foi desenvolvido na Next Level Week Together 💜 💚

Tópicos ?? Sobre ?? Layout ?? Arquivos no Notion ?? Como Usar ?? Sobre ?? O projeto PayFlow foi desenvolvido na Next Level Week Together ?? ?? . Nosso

Rocketseat Education 386 Nov 29, 2022
(Complete flutter application) Exam and training app as social media, prepared with Firebase backend services, Bloc State management, Singleton design pattern, Unit and widget tests, firebase mocking, Custom local libraries, etc.

(Complete flutter application) Exam and training app as social media, prepared with Firebase backend services, Bloc State management, Singleton design pattern, Unit and widget tests, firebase mocking, Custom local libraries, etc.

Ismael Shakverdiev 45 Jul 14, 2022
ReverseHand is a mobile application that was created with the vision of helping to reduce any power imbalances that consumers may face when seeking trade services.

ReverseHand is a mobile application that was created with the vision of helping to reduce any power imbalances that consumers may face when seeking trade services. To achieve this, the mobile application allows consumers to make their needs for services known in the form of job listings, where tradesmen are able to place bids in order to be chosen and hired.

COS 301 - 2022 7 Nov 2, 2022
Flutterbase taxi - A large variety of apps depend on map services.

Flutterbase taxi A large variety of apps depend on map services. The purpose of this project was to test Google Map Services in connection with Flutte

Yakiv Galkin 110 Dec 29, 2022
A simple shopping application made with Flutter utilizing Firebase REST APIs as a backend.

A simple shopping application made with Flutter (MVVM Architecture) utilizing Firebase (REST APIs) as a backend.

Syed Mohsin Raza 11 Aug 5, 2022
Flutter shopping app with Getx for State management, Dio for APIs and Hive for the local database.

Created By Sajjad Javadi Email: [email protected] Show some ❤️ and star the repo to support the project Flutter Shopping app example In this pr

null 17 Nov 23, 2022
💙 A simple Flutter app sample with hooks_riverpod, includes HTTP requests by dio using GitHub APIs.

?? A simple Flutter app sample with hooks_riverpod, includes HTTP requests by dio using GitHub APIs.

Kosuke Saigusa 16 Oct 13, 2022
Beautiful Nike Web Design Concept With Flutter Beautiful Nike Web Design Concept With Flutter

flutter_web_nike A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Pawan Kumar 23 Jan 28, 2022
Web example for the ApolloVM Dart package.

ApolloVM - Web Example This is a Web example for the ApolloVM Dart package. Live Example You can see a live example at: https://apollovm.github.io/apo

null 1 Nov 7, 2021
Udacity UI Clone made with Flutter Web (Flutter 2.0).

Udacity UI Clone Flutter Web 2.0 Description: Udacity UI Clone made with Flutter Web (Flutter 2.0). ScreenShots: Tools & languages: Android studio (ID

Benotmane Mohammed 19 Oct 13, 2022