Closed sitaram-kalluri closed 3 weeks ago
is there any test which covers these changes?
is there any test which covers these changes?
Created a git issue, working on the changes.
is there any test which covers these changes?
Created a git issue, working on the changes.
Completed adding of unit tests.
Please add tests which explicitly assert behaviour of LocalSecondary.isEnrollmentAuthorizedForOperation for a variety of verbs and keys
e.g. llookup for
cached:@alice:shared_key@bob
,cached:@alice:key.in.any.name.space@bob
,cached:@alice:foo@bob
as well as their non-cached equivalents; and also add tests for updates and deletes and notifyI suggest you modify LocalSecondary renaming _enrollment to enrollment and making it
@visibleForTesting
to make it possible to write many small test cases like thistest('test llookup on cached:@alice:shared_key@bob', () async { final testEnrollmentId = 'aaa111'; LocalSecondary ls = <do setup of a LocalSecondary in a test setup function> ls.enrollment = Enrollment() ..enrollmentId = testEnrollmentId ..appName = 'testApkamAuthCachedLLookup' ..deviceName = 'testDevice' ..namespace = {"fubar": "rw"}; final bool authorized = await ls.isEnrollmentAuthorizedForOperation( 'cached:@alice:shared_key@bob', LLookupVerbBuilder()); expect (authorized, true); });
Added unit tests to assert the "isEnrollmentAuthorizedForOperation" method.
…uthorization check
- What I did
sharedkey
andencryption public key
because these keys lack a namespace for validation.- How I did it In local_secondary.dart, modify the existing method which excludes the local keys from enrollment authorization check to also exclude the cached
sharedkey
andencryption public key
.- How to verify it
Attaching the test logs srvd.log sshnp.log sshnpd.log
Pending work: