atsign-foundation / at_libraries

Support libraries & dependencies for Atsign's technology
https://pub.dev/publishers/atsign.org/packages
BSD 3-Clause "New" or "Revised" License
38 stars 11 forks source link

fix: APKAM keys expiry feature changes in at_onboarding_cli #644

Closed sitaram-kalluri closed 3 weeks ago

sitaram-kalluri commented 1 month ago

- What I did

- How I did it

- How to verify it

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.

sitaram-kalluri commented 1 month ago

Looks fine except for

1. the dependency overrides which as you note we will not merge to trunk

2. 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.

sitaram-kalluri commented 1 month ago

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.