Skip to content

Commit

Permalink
Merge pull request #547 from atsign-foundation/remove_enable_enrollme…
Browse files Browse the repository at this point in the history
…nt_flag_cli

fix: remove enable enrollment flag
  • Loading branch information
murali-shris authored Apr 9, 2024
2 parents fd8ed97 + 282b598 commit 85796c7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
6 changes: 3 additions & 3 deletions packages/at_onboarding_cli/example/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
List of steps to run the examples for checking apkam enrollment

1. Onboard an atsign which has privilege to approve/deny enrollments:<br>
1. Onboard an atsign which will get the privilege to approve/deny enrollments:<br>
- run: `dart example/onboard.dart -a <atsign> -c <CRAM secret> -k <path_store_keys_file>`<br>
- e.g. `dart example/onboard.dart -a @alice -k /home/alice/.atsign/@alice_wavikey.atKeys -c b26455a907582760ebf35bc4847de549bc41c24b25c8b1c58d5964f7b4f8a43bc55b0e9a601c9a9657d9a8b8bbc32f88b4e38ffaca03c8710ebae1b14ca9f364`<br/>
- If you do not already have the CRAM Secret for your atsign
run: `dart example/get_cram_key.dart -a <@atsign>`
2. Authenticate using the onboarded atsign:<br>
- run: `dart example/apkam_authenticate.dart -a <atsign> -k <path_of_keys_file_from_#1>`<br>
- run: `dart example/apkam_examples/apkam_authenticate.dart -a <atsign> -k <path_of_keys_file_from_#1>`<br>
- e.g. `dart example/apkam_examples/apkam_authenticate.dart -a @alice -k /home/alice/.atsign/@alice_wavikey.atKeys`
3. Run client to approve enrollments:<br>
- run: `dart example/enroll_app_listen.dart -a <atsign> -k <path_of_keys_file_from_#1>`<br>
- run: `dart example/apkam_examples/enroll_app_listen.dart -a <atsign> -k <path_of_keys_file_from_#1>`<br>
- e.g `dart example/apkam_examples/enroll_app_listen.dart -a @alice -k /home/alice/.atsign/@alice_wavikey.atKeys`
4. Get OTP for enrollment
- 4.1 Perform a PKAM authentication through the ssl client
Expand Down
4 changes: 1 addition & 3 deletions packages/at_onboarding_cli/example/onboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ Future<void> main(List<String> args) async {
..atKeysFilePath = argResults['atKeysPath']
..appName = 'wavi'
..deviceName = 'pixel'
..rootDomain = 'vip.ve.atsign.zone'
..enableEnrollmentDuringOnboard = true;

..rootDomain = 'vip.ve.atsign.zone';
AtOnboardingService? onboardingService =
AtOnboardingServiceImpl(atSign, atOnboardingPreference);
await onboardingService.onboard();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ class AtOnboardingServiceImpl implements AtOnboardingService {

@override
Future<bool> onboard() async {
if (atOnboardingPreference.enableEnrollmentDuringOnboard &&
(atOnboardingPreference.appName == null ||
atOnboardingPreference.deviceName == null)) {
throw AtOnboardingException(
'appName and deviceName are mandatory for onboarding. Please set the params in AtOnboardingPreference');
}
// cram auth doesn't use at_chops. So create at_lookup here.
AtLookupImpl atLookUpImpl = AtLookupImpl(_atSign,
atOnboardingPreference.rootDomain, atOnboardingPreference.rootPort);
Expand Down Expand Up @@ -120,8 +114,6 @@ class AtOnboardingServiceImpl implements AtOnboardingService {
var atOnboardingRequest = at_auth.AtOnboardingRequest(_atSign);
atOnboardingRequest.rootDomain = atOnboardingPreference.rootDomain;
atOnboardingRequest.rootPort = atOnboardingPreference.rootPort;
atOnboardingRequest.enableEnrollment =
atOnboardingPreference.enableEnrollmentDuringOnboard;
atOnboardingRequest.appName = atOnboardingPreference.appName;
atOnboardingRequest.deviceName = atOnboardingPreference.deviceName;
atOnboardingRequest.publicKeyId = atOnboardingPreference.publicKeyId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,4 @@ class AtOnboardingPreference extends AtClientPreference {
String? deviceName;

int apkamAuthRetryDurationMins = 30;

/// This enables apkamEnabledAuthentication. Creates default enrollmentId with
/// super user access.
///
/// Disabled by default. Set to true to enable
bool enableEnrollmentDuringOnboard = false;
}

0 comments on commit 85796c7

Please sign in to comment.