-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add enrollment setup and run tests with APKAM authentication #1321
feat: Add enrollment setup and run tests with APKAM authentication #1321
Conversation
… before the test start
… atSign pointing to canary version of server.
…ests-for-apkam-enrolled-clients
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work @sitaram-kalluri. Just one change I see as necessary right now, see review comment
appName: 'wavi-$random', | ||
deviceName: 'iphone', | ||
otp: 'ABC123', | ||
namespaces: {'wavi': 'rw', 'buzz': 'rw'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should clean up enrollments from previous test runs. In apkam_setup.sh the NoPorts e2e tests we do the following before submitting the new enrollment request for this test run:
logInfo "Denying any pending enrollment requests for $atSign with apkamAppName $apkamApp and apkamDeviceName $apkamDev"
$authBinary deny -r "$atDirectoryHost" -a "$atSign" --arx "$apkamApp" --drx "$apkamDev" || return $?
logInfo "Revoking any approved enrollment requests for $atSign with apkamAppName $apkamApp and apkamDeviceName $apkamDev"
$authBinary revoke -r "$atDirectoryHost" -a "$atSign" --arx "$apkamApp" --drx "$apkamDev" || return $?
where $apkamApp
has been set to "e2e_all"
For these tests I suggest
- use an apkam appName of 'e2e_test'
- before submitting the new enrollment request:
- fetch all pending enrollment requests where the appName is 'e2e_test', and deny all of them
- fetch all approved enrollment requests where the appName is 'e2e_test', and revoke all of them
@@ -16,17 +19,32 @@ class TestSuiteInitializer { | |||
return _singleton; | |||
} | |||
|
|||
Future<void> testInitializer(String atSign, String namespace) async { | |||
Future<void> testInitializer(String atSign, String namespace, | |||
{String authType = 'pkam'}) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity in the test cases which use this function, would it be better to make authType
a required parameter so that it's always explicit in the test code which authType is being used?
…ests-for-apkam-enrolled-clients
…ure debugging purpose
Currently, the E2E tests are running successfully. The unit tests are failing with dart beta version due to following dart issue: dart-lang/sdk#55911 (comment). Pending work is to update the dependencies and check if the issue is resolved. |
…ests-for-apkam-enrolled-clients
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Thank you @sitaram-kalluri
- What I did
- How I did it
Upon approval of the request, the authentication keys are written to the atKeys file which are used by the tests for authentication.
- How to verify it
- Description for the changelog