-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: APKAM keys expiry feature changes in at_onboarding_cli #644
fix: APKAM keys expiry feature changes in at_onboarding_cli #644
Conversation
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.
Looks fine except for
- the dependency overrides which as you note we will not merge to trunk
- the expiry time being in granularity of minutes, which will result in duration of the functional tests being increased by a minute
On the second point above, please use the approach which is being used in the npt program now (see packages/dart/sshnoports/bin/npt.dart in the noports repo) where the timeout
argument is expected to be supplied in human-readable string form e.g. 3d,1h,20s for three days, 1 hour and 20 seconds. npt parses the supplied arg using the parseDuration
function from the pub.dev/packages/duration package
You could also take this opportunity to add ttl arg to the spp and otp commands in auth_cli and again use the same approach of taking input in human-readable form
Modified code to accept expiry in human readable format. Also extended expiry feature to OTP and SPP commands. Updated the PR description accordingly. |
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.
One small suggestion, otherwise LGTM @sitaram-kalluri thank you
// If apkam Keys expiry is not set, then APKAM keys should lives forever. | ||
// Therefore set to 0ms (0 milliseconds) and TTL will not be set. | ||
? '0ms' | ||
: argResults[AuthCliArgs.argNameExpiry]; |
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.
Use ??
syntax i.e. String apkamKeysExpiry = argResults[AuthCliArgs.argNameExpiry] ?? '0ms'
The changes related to at_commons and at_auth are merged to trunk branch with the below PR's The changes in at_onboarding_cli will be merged to trunk once the server changes are in-place. |
…rth-features-for-apkam-keys
- What I did
- How I did it
Changes in at_auth package
Duration apkamKeysExpiryDuration
in "EnrollmentRequest" as an optional argument which represents the APKAM keys expiry duration, which accepts value from the user.Changes in at_commons package
apkamKeysExpiryDuration
inenroll_verb_builder.dart
. The expiry duration from the "enrollment_request" in at_auth package is set to theenroll_verb_builder.dart
to propagate it to the at_secondary_serverChanges in at_onboarding_cli
apkamKeysExpiryDuration
to set the expiry duration.- How to verify it
Manually tested the changes. From the on-boarding cli, send an enrollment request to secondary server with expiry duration set. Once the enrollment is approved, the APKAM keys can be used for authentication. After the duration, an exception stating keys are expired is returned when trying to authenticate.
Test OTP with expiry duration:
- Description for the changelog
NOTE: For easy of review, adding all the changes in this PR. Will move the changes to the respective packages before merging to trunk.
Pending work : Add functional tests in onboarding cli once the secondary server changes are merged.