http_auth 0.1.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 77

http_auth

An http middleware for HTTP authentication (Basic/Digest).

Usage

HTTP Basic authentication:

    import 'package:http_auth/http_auth.dart';

    main() async {
      var client = http_auth.BasicAuthClient('user', 'passwd');
      var response = client.get('http://httpbin.org/basic-auth/user/passwd');
    }

HTTP Digest authentication:

    import 'package:http_auth/http_auth.dart';

    main() async {
      var client = http_auth.DigestAuthClient('user', 'passwd');
      var response = client.get('http://httpbin.org/digest-auth/auth/user/passwd');
    }

Synchronous usage is also possible (see the example).

0.1.3

  • Upgraded dependencies

0.1.2

  • Fixed handling of requests with a body.

0.1.1

  • Fixed nonce counter.

0.1.0

  • Initial version.

example/http_auth_example.dart

// Copyright (c) 2018, Marco Esposito (marcoesposito1988@gmail.com).
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.

import 'package:http_auth/http_auth.dart';

main() {
  var client = new DigestAuthClient("user", "passwd");

  final url = 'http://httpbin.org/digest-auth/auth/user/passwd';

  client.get(url).then((r) => print(r.body));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  http_auth: "^0.1.3"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:http_auth/http_auth.dart';
  
Version Uploaded Documentation Archive
0.1.3 Jun 14, 2018 Go to the documentation of http_auth 0.1.3 Download http_auth 0.1.3 archive
0.1.2 Jun 11, 2018 Go to the documentation of http_auth 0.1.2 Download http_auth 0.1.2 archive
0.1.1 May 16, 2018 Go to the documentation of http_auth 0.1.1 Download http_auth 0.1.1 archive
0.1.0 May 3, 2018 Go to the documentation of http_auth 0.1.0 Download http_auth 0.1.0 archive

Analysis

We analyzed this package on Jul 13, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
56 / 100
Health:
Code health derived from static analysis. [more]
96 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
77
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:http_auth/http_auth.dart.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 7 hints.

    Run dartfmt to format lib/http_auth.dart.

    Run dartfmt to format lib/src/http_auth_basic.dart.

    Similar analysis of the following files failed:

    • lib/src/http_auth_digest.dart (hint)
    • lib/src/http_auth_utils.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
crypto ^2.0.3 2.0.5
cryptoutils ^0.3.0 0.3.0
http >=0.9.0 <0.12.0 0.11.3+17
Transitive dependencies
async 2.0.7
bignum 0.1.0
charcode 1.1.2
collection 1.14.10
convert 2.0.1
fixnum 0.10.7
http_parser 3.1.2
path 1.6.1
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
test ^0.12.0