Fixed linter warnings

This commit is contained in:
thomashii@dukefirehawk.com 2022-11-18 21:52:12 +08:00
parent 529d2d20ad
commit bfc94d94eb
16 changed files with 70 additions and 35 deletions

View file

@ -1,5 +1,9 @@
# Change Log
## 7.0.1
* Fixed linter warnings
## 7.0.0
* Require Dart >= 2.17

View file

@ -25,7 +25,7 @@ RequestHandler forceBasicAuth<User>({String? realm}) {
RequestHandler requireAuthentication<User>() {
return (RequestContext req, ResponseContext res,
{bool throwError = true}) async {
bool _reject(ResponseContext res) {
bool reject(ResponseContext res) {
if (throwError) {
res.statusCode = 403;
throw AngelHttpException.forbidden();
@ -42,10 +42,10 @@ RequestHandler requireAuthentication<User>() {
await reqContainer.makeAsync<User>();
return true;
} else {
return _reject(res);
return reject(res);
}
} else {
return _reject(res);
return reject(res);
}
};
}

View file

@ -1,6 +1,6 @@
name: angel3_auth
description: A complete authentication plugin for Angel3. Includes support for stateless JWT tokens, Basic Auth, and more.
version: 7.0.0
version: 7.0.1
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/auth
environment:

View file

@ -1,5 +1,9 @@
# Change Log
## 7.0.1
* Updated example
## 7.0.0
* Require Dart >= 2.17

View file

@ -113,12 +113,9 @@ void main() async {
}
class User extends Model {
@override
String? id;
int? githubId;
User({this.id, this.githubId});
User({super.id, this.githubId});
static User parse(Map<String, dynamic> map) =>
User(id: map['id'] as String?, githubId: map['github_id'] as int?);

View file

@ -1,5 +1,5 @@
name: angel3_auth_oauth2
version: 7.0.0
version: 7.0.1
description: Angel3 library for authenticating users with external identity providers via OAuth2.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/auth_oauth2

View file

@ -0,0 +1,38 @@
# Change Log
## 7.0.1
* Upgraded dependencies
* Fixed deprecation
## 7.0.0
* Require Dart >= 2.17
## 6.0.1
* Skipped release
## 6.0.0
* Skipped release
## 5.0.0
* Skipped release
## 4.0.0
* Skipped release
## 3.0.0
* Skipped release
## 2.0.0
* Skipped release
## 1.0.0
* Skipped release

View file

@ -7,7 +7,7 @@ import 'package:analyzer/dart/element/type.dart';
import 'package:build/build.dart';
import 'package:code_builder/code_builder.dart';
import 'package:file/file.dart';
import 'package:path/src/context.dart';
import 'package:path/path.dart';
/// Converts a [DartType] to a [TypeReference].
TypeReference convertTypeReference(DartType? t) {
@ -21,7 +21,7 @@ TypeReference convertTypeReference(DartType? t) {
}
bool isRequiredParameter(ParameterElement e) {
return e.isNotOptional;
return e.isRequired;
}
bool isOptionalParameter(ParameterElement e) {
@ -233,19 +233,6 @@ class BuildSystemFile extends File {
throw UnimplementedError();
}
/*
@override
Future<List<int>> readAsBytes() {
var assetId = AssetId(package, path);
return reader.readAsBytes(assetId);
}
@override
List<int> readAsBytesSync() => throw _unsupported();
@override
Future<List<String>> readAsLines({Encoding encoding = utf8}) =>
throw _unsupported();
*/
@override
List<String> readAsLinesSync({Encoding encoding = utf8}) =>
throw _unsupported();

View file

@ -1,13 +1,16 @@
name: jael3_web
version: 7.0.0
version: 7.0.1
description: Experimental virtual DOM/SPA engine built on Jael3. Supports SSR.
publish_to: none
environment:
sdk: '>=2.17.0 <3.0.0'
dependencies:
analyzer: ^5.2.0
build: ^2.0.2
build_config: ^1.0.0
code_builder: ^4.0.0
file: ^6.1.4
path: ^1.8.2
jael3: ^7.0.0
jael3_preprocessor: ^7.0.0
source_gen: ^1.0.2

View file

@ -6,7 +6,7 @@
## 7.0.1
* Fixed issue #82: Fixed issue #82: Removed casting for numeric fields
* Fixed issue #82: Removed casting for numeric fields
## 7.0.0

View file

@ -226,7 +226,6 @@ class VirtualDirectory {
type = '[Link]';
stub = p.basename(entity.path);
} else {
//TODO: Handle unknown type
_log.severe('Unknown file entity. Not a file, directory or link.');
type = '[]';
stub = '';

View file

@ -34,7 +34,6 @@ void main() {
// propagate to app2.
var ws = req.container!.make<AngelWebSocket>();
// TODO: body retuns void
//var body = await req.parseBody();
var body = {};
await ws.batchEvent(WebSocketEvent(

View file

@ -1,8 +1,8 @@
import 'dart:io';
//import 'dart:io';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_framework/http.dart';
import 'package:angel3_user_agent/angel3_user_agent.dart';
import 'package:user_agent_analyzer/user_agent_analyzer.dart';
//import 'package:angel3_user_agent/angel3_user_agent.dart';
//import 'package:user_agent_analyzer/user_agent_analyzer.dart';
void main() async {
var app = Angel();

View file

@ -1,5 +1,9 @@
# Change Log
## 7.0.1
* Fixed linter warnings
## 7.0.0
* Require Dart >= 2.17

View file

@ -83,15 +83,15 @@ class Validator extends Matcher {
schema[keys] is Iterable ? schema[keys] : [schema[keys]];
var iterable = [];
void _addTo(x) {
void addTo(x) {
if (x is Iterable) {
x.forEach(_addTo);
x.forEach(addTo);
} else {
iterable.add(x);
}
}
tmpIterable.forEach(_addTo);
tmpIterable.forEach(addTo);
for (var rule in iterable) {
if (rule is Matcher) {

View file

@ -1,6 +1,6 @@
name: angel3_validate
description: Cross-platform request body validation library based on `matcher`.
version: 7.0.0
version: 7.0.1
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/validate
environment: