Skip to content

Commit

Permalink
Merge branch 'trunk' into apkam_notification_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gkc authored May 22, 2024
2 parents 17fdab8 + b4aae86 commit 2ded30d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import 'dart:collection';
import 'dart:convert';

import 'package:at_commons/at_commons.dart';
import 'package:at_persistence_secondary_server/at_persistence_secondary_server.dart';
import 'package:at_secondary/src/connection/inbound/inbound_connection_metadata.dart';
import 'package:at_secondary/src/constants/enroll_constants.dart';
import 'package:at_secondary/src/enroll/enroll_datastore_value.dart';
import 'package:at_secondary/src/server/at_secondary_impl.dart';
import 'package:at_secondary/src/utils/handler_util.dart' as handler_util;
import 'package:at_secondary/src/utils/secondary_util.dart';
import 'package:at_secondary/src/verb/handler/sync_progressive_verb_handler.dart';
import 'package:at_secondary/src/verb/manager/response_handler_manager.dart';
import 'package:at_server_spec/at_server_spec.dart';
import 'package:at_server_spec/at_verb_spec.dart';
import 'package:at_utils/at_logger.dart';
import 'package:at_secondary/src/utils/secondary_util.dart';

final String paramFullCommandAsReceived = 'FullCommandAsReceived';

Expand Down Expand Up @@ -190,8 +191,13 @@ abstract class AbstractVerbHandler implements VerbHandler {
}
}
// set passed namespace. If passed namespace is null, get namespace from atKey
final keyNamespace =
namespace ?? (atKey != null ? AtKey.fromString(atKey).namespace : null);
String? keyNamespace;
try {
keyNamespace = namespace ??
(atKey != null ? AtKey.fromString(atKey).namespace : null);
} catch (e) {
throw AtEnrollmentException('AtKey.toString($atKey) failed: $e');
}
if (keyNamespace == null && atKey == null) {
logger.shout('Both AtKey and namespace are null');
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,14 @@ class NotifyListVerbHandler extends AbstractVerbHandler {
var filteredResponseList = [];
for (Notification notification in responseList) {
var notificationKey = notification.notification;
if (await super
.isAuthorized(atConnectionMetadata, atKey: notificationKey!)) {
filteredResponseList.add(notification);
try {
if (await super
.isAuthorized(atConnectionMetadata, atKey: notificationKey!)) {
filteredResponseList.add(notification);
}
} on AtEnrollmentException catch (e) {
logger.finer(
'Failed to authorize the key with enrollment ID ${atConnectionMetadata.enrollmentId} caused by ${e.toString()}');
}
}
responseList.clear();
Expand Down
2 changes: 1 addition & 1 deletion tools/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ packages = [{include = "at_server_tools"}]

[tool.poetry.dependencies]
python = "^3.8"
requests = "2.32.1"
requests = "2.32.2"
dnspython = "2.6.1"


Expand Down
6 changes: 3 additions & 3 deletions tools/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ dnspython==2.6.1 ; python_version >= "3.8" and python_version < "4.0" \
idna==3.7 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \
--hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0
requests==2.32.1 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:21ac9465cdf8c1650fe1ecde8a71669a93d4e6f147550483a2967d08396a56a5 \
--hash=sha256:eb97e87e64c79e64e5b8ac75cee9dd1f97f49e289b083ee6be96268930725685
requests==2.32.2 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289 \
--hash=sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c
urllib3==2.2.1 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d \
--hash=sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19

0 comments on commit 2ded30d

Please sign in to comment.