rikulo_security 1.1.1

Rikulo Security #

Rikulo Security is a lightweight and highly customizable authentication and access-control framework for Rikulo Stream.

Stream is distributed under an Apache 2.0 License.

Build Status

Installation #

Add this to your pubspec.yaml (or create it):

dependencies:
  rikulo_security:

Then run the Pub Package Manager (comes with the Dart SDK):

pub install

Usage #

First, you have to implement Authenticator. For sake of description, we use a dummy implementation here called DummyAuthenticator:

 final authenticator = new DummyAuthenticator()
   ..addUser("john", "123", ["user"])
   ..addUser("peter", "123", ["user", "admin"]);

Second, you can use SimpleAccessControl or implement your own access control (AccessControl):

 final accessControl = new SimpleAccessControl({
   "/admin/.*": ["admin"],
   "/member/.*": ["user", "admin"]
 });

Finally, instantiate Security with the authenticator and access control you want:

 final security = new Security(authenticator, accessControl);
 new StreamServer(uriMapping: {
   "/s_login": security.login,
   "/s_logout": security.logout
 }, filterMapping: {
   "/.*": security.filter
 }).start();

Please refer to this sample application for more information.

Notes to Contributors #

Fork Rikulo Security #

If you'd like to contribute back to the core, you can fork this repository and send us a pull request, when it is ready.

Please be aware that one of Rikulo Security's design goals is to keep the sphere of API as neat and consistency as possible. Strong enhancement always demands greater consensus.

If you are new to Git or GitHub, please read this guide first.

Who Uses #

  • Quire - a simple, collaborative, multi-level task management tool.
  • Keikai - a sophisticated spreadsheet for big data

Use this package as a library

1. Depend on it

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


dependencies:
  rikulo_security: ^1.1.1

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:rikulo_security/plugin.dart';
import 'package:rikulo_security/security.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
57
Health:
Code health derived from static analysis. [more]
73
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
64
Learn more about scoring.

We analyzed this package on Aug 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: other

Platform components identified in package: io, mirrors.

Health suggestions

Fix lib/src/security/security_api.dart. (-16.51 points)

Analysis of lib/src/security/security_api.dart reported 36 hints, including:

line 7 col 1: Prefer using /// for doc comments.

line 14 col 5: DO use curly braces for all flow control structures.

line 16 col 5: DO use curly braces for all flow control structures.

line 19 col 1: Prefer using /// for doc comments.

line 61 col 1: Prefer using /// for doc comments.

Fix lib/src/security/security_impl.dart. (-9.08 points)

Analysis of lib/src/security/security_impl.dart reported 19 hints, including:

line 13 col 1: Prefer using /// for doc comments.

line 39 col 11: DO use curly braces for all flow control structures.

line 47 col 39: Use = to separate a named parameter from its default value.

line 48 col 43: Use = to separate a named parameter from its default value.

line 63 col 13: DO use curly braces for all flow control structures.

Fix lib/src/plugin/access_control.dart. (-2.96 points)

Analysis of lib/src/plugin/access_control.dart reported 6 hints, including:

line 7 col 1: Prefer using /// for doc comments.

line 20 col 3: Prefer using /// for doc comments.

line 46 col 13: DO use curly braces for all flow control structures.

line 47 col 15: DO use curly braces for all flow control structures.

line 63 col 26: Use contains instead of indexOf

Fix lib/src/plugin/authenticator.dart. (-1 points)

Analysis of lib/src/plugin/authenticator.dart reported 2 hints:

line 7 col 1: Prefer using /// for doc comments.

line 22 col 7: DO use curly braces for all flow control structures.

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Documentation URL is insecure. (-5 points)

Update the documentation field and use a secure (https) URL.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and rikulo_security.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
rikulo_commons >=3.0.0 <4.0.0 3.2.1
stream >=1.0.0 <3.0.0 2.2.1
Transitive dependencies
args 1.5.2
async 2.3.0
charcode 1.1.2
collection 1.14.12
http 0.12.0+2
http_parser 3.1.3
logging 0.11.3+2
meta 1.1.7
mime 0.9.6+3
path 1.6.4
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6