sigv4 2.1.0+1 copy "sigv4: ^2.1.0+1" to clipboard
sigv4: ^2.1.0+1 copied to clipboard

discontinued
outdated

Library for signing AWS requests with Signature Version 4, with both convenience wrappers/classes and cryptography methods

sigv4 #

A Dart library for signing AWS requests with Signature Version 4.

Usage #

Create a Sigv4Client. This will hold your secrets and configuration. Some omitted default values:

  • region defaults to eu-west-1
  • serviceNamedefaults to execute-api
final client = Sigv4Client(
  accessKey: 'your_access_key',
  secretKey: 'your_secret_key',
);

The easier way to create a request is by getting a package:http request object:

// A simple GET-request
final request = client.request('https://service.aws.com/endpoint');

get(request.url, headers: request.headers);

// A larger request
final request = client.request(
  'https://service.aws.com/endpoint',
  method: 'POST',
  queryParameters: {'key': 'value'},
  headers: {'header': 'value'},
  body: {'content': 'some-content'},
);

post(request.url, headers: request.headers, body: request.body);

Alternatively, you can get the canonical string and signed headers separately:

final path = 'https://service.aws.com/endpoint';
final queryParameters = {'key': 'value'};

final url = client.canonicalUrl(path, queryParameters: queryParameters);
final headers = client.signedHeaders(
  path,
  queryParameters: queryParameters,
);

get(url, headers: headers);
7
likes
0
pub points
79%
popularity

Publisher

verified publisherarnemolland.com

Library for signing AWS requests with Signature Version 4, with both convenience wrappers/classes and cryptography methods

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

convert, crypto, http

More

Packages that depend on sigv4