authing 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 12

Authing.dart #

Pub Package style: effective dart

Authing

Authing —— 一个所有人可用的身份管理平台

Authing 是什么? #

Authing 提供身份认证和授权服务,我们提供跨平台的 SDK(Android、iOS 和 Web),帮助开发者和企业使用六行代码拥有邮箱/密码、短信/验证码、扫码登录、社会化登录等功能。

当用户发起授权请求时,Authing 会帮助你认证他们的身份和返回必要的用户信息到你的应用中。

https://github.com/Authing/authing/blob/master/imgs/authing.png?raw=true

开发计划路线图:Authing Roadmap

Installation #

To install authing.dart, Add this to your pubspec.yaml:

dependencies:
  authing: ^0.1.0

Then install:

pub get

Usage #

import 'package:authing/authing.dart';

main() async {
	Options opts = Options(
		userPoolId: '...',
		secret: '...',
	);
	
	/// init authing client
	Authing authing = Authing(opts);
	
	/// handle res
	var res = await authing.register(
		username: 'David Bowie',
		email: 'bowie@mars.uni',
		password: 'hallo-spaceboy'
	);
	
	if (res.hasErrors) {
		print(res.errors);
	} else {
		print(res.data);
	}
}

Style Guide

v0.2.0 #

  • Add full API

example/main.dart

import 'package:authing/authing.dart';

final String pool = '5e0489a3b6cbc91087ac82ae';
final String user = '5e048b98b6cbc957baac8c94';
final String role = '5e048ad3b6cbc953a0ac88f7';

main() async {
	Options opts = Options(
		userPoolId: '5e0489a3b6cbc91087ac82ae',
		secret: 'fd5ba7fa24036a33e9c85630c2e02b75',
	);
	
	/// init authing client
	Authing authing = Authing(opts);

  /// handle res
	var res = await authing.queryInvitationState(
    client: pool,
	);
	
	if (res.hasErrors){
    print(res.errors);
  } else {
    print(res.data);
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  authing: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:authing/authing.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
12
Learn more about scoring.

We analyzed this package on Mar 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Analysis issues and suggestions

Make sure dartfmt successfully runs on your package's source files.

Running dartfmt -n . failed with the following output:

Exception: dartfmt on lib/ failed with exit code 65
Could not format because the source could not be parsed:

line 211, column 7 of lib/authing.dart: Expected to find '}'.
    ╷
211 │       String operator,
    │       ^^^^^^
    ╵
line 438, column 7 of lib/authing.dart: Expected to find '}'.
    ╷

Health issues and suggestions

Fix lib/authing.dart. (-76.27 points)

Analysis of lib/authing.dart failed with 5 errors:

line 211 col 7: Expected to find '}'.

line 217 col 23: Undefined name 'operator'.

line 438 col 7: Expected to find '}'.

line 445 col 19: Undefined name 'page'.

line 446 col 20: Undefined name 'count'.

Fix lib/queries/change_mfa.dart.

Analysis of lib/queries/change_mfa.dart reported :

line 0 col 0: is a part and cannot be analyzed.

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (encrypt, graphql).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
encrypt ^3.2.0 3.3.1 4.0.0
graphql ^2.0.0 2.1.0 3.0.0
meta ^1.1.8 1.1.8
pointycastle ^1.0.2 1.0.2
Transitive dependencies
args 1.6.0
asn1lib 0.5.15 0.6.4
async 2.4.1
charcode 1.1.3
clock 1.0.1
collection 1.14.12
convert 2.1.1
crypto 2.1.4
graphql_parser 1.1.4
http 0.12.0+4
http_parser 3.1.4
mime 0.9.6+3
path 1.6.4
pedantic 1.9.0
rxdart 0.22.6 0.23.1
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
uuid_enhanced 3.0.2
websocket 0.0.5
Dev dependencies
effective_dart ^1.1.0