rikulo_security 1.1.1+1

  • Readme
  • Changelog
  • Installing
  • 69

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

#CHANGES

1.1.1

  • Security.switchLogin supports the resetSession argument

1.1.0

  • Security.switchLogin and switchBack added

1.0.0

  • Upgrade to Dart 2

0.8.7

  • Authenticator.isSessionExpired introduced to invalidate a session if necessary

0.8.6

  • AccessControl.canAcess() returns FutureOr<bool>
  • onLogin and onLogout callbacks return FutureOr

0.8.3

  • Security.setLogin() introduces additional argument: resetSession

0.8.1

  • #6: AccessControl.canAccess() became asynchronous

0.8.0

  • #5: Able to pass the original URI as parameter of the login page

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+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]
63
Health:
Code health derived from static analysis. [more]
67
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.13.1+4

Health suggestions

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

Analysis of lib/src/security/security_api.dart reported 39 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. (-10.89 points)

Analysis of lib/src/security/security_impl.dart reported 23 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. (-4.89 points)

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

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

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

line 25 col 18: Unnecessary new keyword.

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.

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

Analysis of lib/src/plugin/authenticator.dart reported 7 hints, including:

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

line 11 col 22: Unnecessary new keyword.

line 15 col 28: Unnecessary new keyword.

line 15 col 47: Unnecessary new keyword.

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

Maintenance suggestions

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 <5.0.0 4.0.1
stream >=1.0.0 <3.0.0 2.2.1+1
Transitive dependencies
args 1.5.2
async 2.4.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.8
mime 0.9.6+3
path 1.6.4
pedantic 1.9.0
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6