sigv4 3.1.1 copy "sigv4: ^3.1.1" to clipboard
sigv4: ^3.1.1 copied to clipboard

discontinued
outdated

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

example/example.dart

import 'package:dio/dio.dart';
import 'package:http/http.dart';
import 'package:sigv4/sigv4.dart';

/// This sample contains several placeholders for otherwise secret keys
/// and values, and will not run before you provide valid values and
/// a valid endpoint.
void main() {
  final client = Sigv4Client(
    keyId: 'your_access_key_id',
    accessKey: 'your_access_key',
    region: 'eu-west-1',
    serviceName: 'execute-api',
  );

  // Some fictive endpoint
  final path = 'https://service.aws.com/endpoint/replace-this-placeholder';

  // Create the request
  var request = client.request(path);

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

  // A larger request
  final largeRequest = client.request(
    path,
    method: 'POST',
    query: {'key': 'value'},
    headers: {'header': 'value'},
    body: {'content': 'some-content'},
  );

  // POST request
  post(largeRequest.url, headers: largeRequest.headers, body: largeRequest.body);

  final query = {'key': 'value'};

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

  // GET request
  get(url, headers: headers);

  // Extensions on `http` Request objects
  Request('GET', Uri.parse(path)).sign(client);

  // Extensions on `dio` RequestOptions objects
  RequestOptions(method: 'GET', path: path).sign(client);
}
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

chopper, convert, crypto, dio, http, meta

More

Packages that depend on sigv4