This commit is contained in:
thosakwe 2017-02-28 17:21:36 -05:00
parent deff36ad36
commit e489525887
8 changed files with 8 additions and 8 deletions

View file

@ -1,5 +1,5 @@
# security # security
[![version 0.0.7](https://img.shields.io/badge/pub-v0.0.7-red.svg)](https://pub.dartlang.org/packages/angel_security) [![version 1.0.0](https://img.shields.io/badge/pub-v1.0.0-red.svg)](https://pub.dartlang.org/packages/angel_security)
[![build status](https://travis-ci.org/angel-dart/security.svg)](https://travis-ci.org/angel-dart/security) [![build status](https://travis-ci.org/angel-dart/security.svg)](https://travis-ci.org/angel-dart/security)
Angel middleware designed to enhance application security by patching common Web security Angel middleware designed to enhance application security by patching common Web security

View file

@ -1,7 +1,7 @@
import 'package:angel_framework/angel_framework.dart'; import 'package:angel_framework/angel_framework.dart';
/// Adds the authed user to `e.params`, only if present in `req.injections`. /// Adds the authed user to `e.params`, only if present in `req.injections`.
HookedServiceEventListener addUserToParams({String as, String userKey}) { HookedServiceEventListener addUserToParams({String as, userKey}) {
return (HookedServiceEvent e) { return (HookedServiceEvent e) {
var user = e.request?.grab(userKey ?? 'user'); var user = e.request?.grab(userKey ?? 'user');

View file

@ -11,7 +11,7 @@ import 'is_server_side.dart';
HookedServiceEventListener associateCurrentUser( HookedServiceEventListener associateCurrentUser(
{String idField, {String idField,
String ownerField, String ownerField,
String userKey, userKey,
String errorMessage, String errorMessage,
bool allowNullUserId: false, bool allowNullUserId: false,
getId(user), getId(user),

View file

@ -10,7 +10,7 @@ import 'is_server_side.dart';
HookedServiceEventListener queryWithCurrentUser( HookedServiceEventListener queryWithCurrentUser(
{String as, {String as,
String idField, String idField,
String userKey, userKey,
String errorMessage, String errorMessage,
bool allowNullUserId: false, bool allowNullUserId: false,
getId(user)}) { getId(user)}) {

View file

@ -4,7 +4,7 @@ import 'is_server_side.dart';
/// Restricts the service method to authed users only. /// Restricts the service method to authed users only.
HookedServiceEventListener restrictToAuthenticated( HookedServiceEventListener restrictToAuthenticated(
{String userKey, String errorMessage}) { {userKey, String errorMessage}) {
return (HookedServiceEvent e) async { return (HookedServiceEvent e) async {
var user = e.request?.grab(userKey ?? 'user'); var user = e.request?.grab(userKey ?? 'user');

View file

@ -7,7 +7,7 @@ import 'is_server_side.dart';
HookedServiceEventListener restrictToOwner( HookedServiceEventListener restrictToOwner(
{String idField, {String idField,
String ownerField, String ownerField,
String userKey, userKey,
String errorMessage, String errorMessage,
getId(user), getId(user),
getOwner(obj)}) { getOwner(obj)}) {

View file

@ -8,7 +8,7 @@ import '../permissions.dart';
HookedServiceEventListener variantPermission( HookedServiceEventListener variantPermission(
createPermission(HookedServiceEvent e), createPermission(HookedServiceEvent e),
{String errorMessage, {String errorMessage,
String userKey, userKey,
bool owner: false, bool owner: false,
getRoles(user), getRoles(user),
getId(user), getId(user),

View file

@ -1,5 +1,5 @@
name: angel_security name: angel_security
version: 0.0.7 version: 1.0.0
description: Angel middleware designed to enhance application security by patching common Web security holes. description: Angel middleware designed to enhance application security by patching common Web security holes.
author: Tobe O <thosakwe@gmail.com> author: Tobe O <thosakwe@gmail.com>
environment: environment: