Skip to content

Commit a3bb5f3

Browse files
Merge #451
451: Type casting for JWT claims in tenant token tests r=curquiza a=ahmednfwela # Pull Request ## Related issue Fixes #450 ## What does this PR do? - Fixes a breaking change that was made in jonasroussel/dart_jsonwebtoken#71 ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Improved type safety when verifying JWT token payloads in the test suite. * **Chores** * Updated development lint dependency constraint to the 6.x release line for dev tooling consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: ahmednfwela <[email protected]>
2 parents 422592d + d9e73e7 commit a3bb5f3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
dev_dependencies:
1919
test: ^1.0.0
2020
dart_jsonwebtoken: ">=2.12.2 <4.0.0"
21-
lints: ">=2.1.0 <7.0.0"
21+
lints: ^6.0.0
2222
json_serializable: ^6.7.1
2323
build_runner: ^2.4.6
2424
pub_semver: ^2.1.5

test/tenant_token_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ void main() {
131131
final key = sha1RandomString();
132132
final uid = sha1RandomString();
133133
final token = generateToken(uid, searchRules, key);
134-
final claims = JWT.verify(token, SecretKey(key)).payload;
135-
134+
final claims =
135+
JWT.verify(token, SecretKey(key)).payload as Map<String, Object?>;
136136
expect(claims['apiKeyUid'], equals(uid));
137137
expect(claims['searchRules'], equals(searchRules));
138138
});

0 commit comments

Comments
 (0)