From fa25803e50389cca4a473e27b2e106ef97cac198 Mon Sep 17 00:00:00 2001 From: thomashii Date: Sat, 26 Jun 2021 19:02:51 +0800 Subject: [PATCH] Published security --- packages/security/CHANGELOG.md | 11 +++-- packages/security/README.md | 12 +++-- packages/security/example/cookie_signer.dart | 8 +-- packages/security/example/rate_limit.dart | 8 +-- .../security/example/rate_limit_redis.dart | 8 +-- ...gel_security.dart => angel3_security.dart} | 0 packages/security/lib/src/cookie_signer.dart | 2 +- packages/security/lib/src/csrf_filter.dart | 2 +- .../lib/src/in_memory_rate_limiter.dart | 2 +- packages/security/lib/src/rate_limiter.dart | 4 +- .../lib/src/service_rate_limiter.dart | 2 +- packages/security/pubspec.yaml | 49 ++++--------------- 12 files changed, 44 insertions(+), 64 deletions(-) rename packages/security/lib/{angel_security.dart => angel3_security.dart} (100%) diff --git a/packages/security/CHANGELOG.md b/packages/security/CHANGELOG.md index d6ce5745..7a416335 100644 --- a/packages/security/CHANGELOG.md +++ b/packages/security/CHANGELOG.md @@ -1,9 +1,14 @@ -# 3.0.0 +# Change Log + +## 3.0.0 + * Migrated to support Dart SDK 2.12.x NNBD -# 2.0.0-alpha.1 +## 2.0.0-alpha.1 + * Make `ServiceRateLimiter` more fail-proof. -# 2.0.0-alpha +## 2.0.0-alpha + * Angel 2 updates. Remove previous functionality. * Add `CookieSigner`, `RateLimiter`/`InMemoryRateLimiter`/`ServiceRateLimiter`. \ No newline at end of file diff --git a/packages/security/README.md b/packages/security/README.md index 53339b5f..c9857d2b 100644 --- a/packages/security/README.md +++ b/packages/security/README.md @@ -1,8 +1,12 @@ -# security -[![Pub](https://img.shields.io/pub/v/angel_security.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) +# Angel3 Security -Angel middleware designed to enhance application security by patching common Web security +[![version](https://img.shields.io/badge/pub-v3.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_security) +[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) +[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) + +[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/security/LICENSE) + +Angel3 middleware designed to enhance application security by patching common Web security holes. **This package is currently going through a major overhaul, for version 2.** \ No newline at end of file diff --git a/packages/security/example/cookie_signer.dart b/packages/security/example/cookie_signer.dart index 9c7ec421..d8430c54 100644 --- a/packages/security/example/cookie_signer.dart +++ b/packages/security/example/cookie_signer.dart @@ -1,10 +1,10 @@ import 'dart:io'; import 'dart:math'; -import 'package:angel_framework/angel_framework.dart'; -import 'package:angel_framework/http.dart'; -import 'package:angel_security/angel_security.dart'; +import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_framework/http.dart'; +import 'package:angel3_security/angel3_security.dart'; import 'package:logging/logging.dart'; -import 'package:pretty_logging/pretty_logging.dart'; +import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; void main() async { // Logging boilerplate. diff --git a/packages/security/example/rate_limit.dart b/packages/security/example/rate_limit.dart index 60d52465..96fc0902 100644 --- a/packages/security/example/rate_limit.dart +++ b/packages/security/example/rate_limit.dart @@ -1,8 +1,8 @@ -import 'package:angel_framework/angel_framework.dart'; -import 'package:angel_framework/http.dart'; -import 'package:angel_security/angel_security.dart'; +import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_framework/http.dart'; +import 'package:angel3_security/angel3_security.dart'; import 'package:logging/logging.dart'; -import 'package:pretty_logging/pretty_logging.dart'; +import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; void main() async { // Logging boilerplate. diff --git a/packages/security/example/rate_limit_redis.dart b/packages/security/example/rate_limit_redis.dart index 504bdfe5..63f1cc1c 100644 --- a/packages/security/example/rate_limit_redis.dart +++ b/packages/security/example/rate_limit_redis.dart @@ -1,7 +1,7 @@ -import 'package:angel_redis/angel_redis.dart'; -import 'package:angel_framework/angel_framework.dart'; -import 'package:angel_production/angel_production.dart'; -import 'package:angel_security/angel_security.dart'; +import 'package:angel3_redis/angel3_redis.dart'; +import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_production/angel3_production.dart'; +import 'package:angel3_security/angel3_security.dart'; import 'package:resp_client/resp_client.dart'; import 'package:resp_client/resp_commands.dart'; import 'package:resp_client/resp_server.dart'; diff --git a/packages/security/lib/angel_security.dart b/packages/security/lib/angel3_security.dart similarity index 100% rename from packages/security/lib/angel_security.dart rename to packages/security/lib/angel3_security.dart diff --git a/packages/security/lib/src/cookie_signer.dart b/packages/security/lib/src/cookie_signer.dart index d49ea282..9816cbe5 100644 --- a/packages/security/lib/src/cookie_signer.dart +++ b/packages/security/lib/src/cookie_signer.dart @@ -1,6 +1,6 @@ import 'dart:convert'; import 'dart:io'; -import 'package:angel_framework/angel_framework.dart'; +import 'package:angel3_framework/angel3_framework.dart'; import 'package:crypto/crypto.dart'; /// A utility that signs, and verifies, cookies using an [Hmac]. diff --git a/packages/security/lib/src/csrf_filter.dart b/packages/security/lib/src/csrf_filter.dart index c7abd87b..acc4fece 100644 --- a/packages/security/lib/src/csrf_filter.dart +++ b/packages/security/lib/src/csrf_filter.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'package:angel_framework/angel_framework.dart'; +import 'package:angel3_framework/angel3_framework.dart'; import 'cookie_signer.dart'; class CsrfToken { diff --git a/packages/security/lib/src/in_memory_rate_limiter.dart b/packages/security/lib/src/in_memory_rate_limiter.dart index 298652b1..c3da41fc 100644 --- a/packages/security/lib/src/in_memory_rate_limiter.dart +++ b/packages/security/lib/src/in_memory_rate_limiter.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'package:angel_framework/angel_framework.dart'; +import 'package:angel3_framework/angel3_framework.dart'; import 'rate_limiter.dart'; import 'rate_limiting_window.dart'; diff --git a/packages/security/lib/src/rate_limiter.dart b/packages/security/lib/src/rate_limiter.dart index 4ceb748e..357db2ba 100644 --- a/packages/security/lib/src/rate_limiter.dart +++ b/packages/security/lib/src/rate_limiter.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:angel_framework/angel_framework.dart'; -import 'package:angel_security/angel_security.dart'; +import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_security/angel3_security.dart'; import 'rate_limiting_window.dart'; /// A base class that facilitates rate limiting API's or endpoints, diff --git a/packages/security/lib/src/service_rate_limiter.dart b/packages/security/lib/src/service_rate_limiter.dart index c009747e..2ac413fd 100644 --- a/packages/security/lib/src/service_rate_limiter.dart +++ b/packages/security/lib/src/service_rate_limiter.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'package:angel_framework/angel_framework.dart'; +import 'package:angel3_framework/angel3_framework.dart'; import 'rate_limiter.dart'; import 'rate_limiting_window.dart'; diff --git a/packages/security/pubspec.yaml b/packages/security/pubspec.yaml index 03554664..b2437ee0 100644 --- a/packages/security/pubspec.yaml +++ b/packages/security/pubspec.yaml @@ -1,47 +1,18 @@ -name: angel_security +name: angel3_security version: 3.0.0 -description: Angel infrastructure for improving security, rate limiting, and more. -homepage: https://github.com/angel-dart/security -publish_to: none +description: Angel infrastructure for improving security, rate limiting, and more +homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/security environment: sdk: '>=2.12.0 <3.0.0' dependencies: - angel_framework: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/framework + angel3_framework: ^4.0.0 crypto: ^3.0.1 dev_dependencies: - angel_auth: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/auth - angel_production: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/production - angel_redis: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/redis - angel_test: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/test - angel_validate: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/validate - pretty_logging: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/pretty_logging + angel3_auth: ^4.0.0 + angel3_production: ^3.0.0 + angel3_redis: ^2.0.0 + angel3_test: ^4.0.0 + angel3_validate: ^4.0.0 + angel3_pretty_logging: ^3.0.0 pedantic: ^1.11.1 test: ^1.17.8