-
Notifications
You must be signed in to change notification settings - Fork 16
feat: Noports desktop cram auth #2001
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
base: trunk
Are you sure you want to change the base?
Conversation
1c17e15
to
ef503f6
Compare
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.
renamed to activate_otp_dialog.dart, with some minor modifications to reflect the changes in 'constants.dart'
builder: (context) => (root?.registrarUrl == null || apiKey == null) | ||
? ActivateCramDialog( | ||
atSign: atsign, | ||
config: util.config, | ||
onboardingUtil: util, | ||
) | ||
: ActivateOtpDialog( | ||
atSign: atsign, | ||
apiKey: apiKey, | ||
config: util.config, | ||
registrarUrl: root!.registrarUrl!, | ||
onboardingUtil: util, | ||
waitForTeapot: initialStatus != AtSignStatus.teapot, | ||
), |
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.
Here's where we pick the activation screen based on whether apikey & reg url are known or not.
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 localization:
I sorted with the unix sort command, which has changed the order in instances where: "yaml" and "yamlRecommended" occur. However it was previously sorted, had a different sort order for "
vs alpha.
The three new entries are:
- "orSpace"
- "activateUsingLicense"
- "typePasteLicense"
@@ -1,5 +1,5 @@ | |||
# Project-level configuration. |
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.
regenerated the linux directory with flutter create.
${TARGET} | ||
PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>" | ||
) | ||
target_compile_options(${TARGET} PRIVATE -Wno-error=deprecated-declarations) # Allow deprecated warnings for tray_manager package |
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.
This line is added to allow builds despite usage of a deprecated libadwaita api in the tray_manager plugin.
@@ -0,0 +1,20 @@ | |||
#!/usr/bin/env bash |
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.
This script isn't 100% finished, but my changeset for this was mixed in with the cram auth work, so I'm pushing with intention to complete at a later point.
@@ -0,0 +1,42 @@ | |||
id: com.atsign.NoPortsDesktop |
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.
spec to generate a flatpak manifest from.
Converted back to draft to test a few more edge cases. |
ffb81d6
to
0a6c599
Compare
Related commit in at_onboarding_flutter: atsign-foundation/at_widgets@1e244eb |
{ | ||
"name": "NoPorts Desktop Staging", | ||
"type": "dart", | ||
"request": "launch", | ||
"program": "packages/dart/npt_flutter/lib/main.dart", | ||
"args": [ | ||
"--debug", | ||
"-a", | ||
"--register-root", | ||
"-a", | ||
"domain:root.atsign.wtf;description:Staging", | ||
"-a", | ||
"--register-root", | ||
"-a", | ||
"domain:fake.atsign.wtf;description:fake", | ||
"-a", | ||
"--no-include-default-roots" | ||
] |
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.
Debugging profile against staging for NoPorts Desktop
builder: (context) => (root?.registrarUrl == null || apiKey == null) | ||
? ActivateCramDialog( | ||
atSign: atsign, | ||
config: util.config, | ||
) | ||
: ActivateOtpDialog( | ||
atSign: atsign, | ||
apiKey: apiKey, | ||
config: util.config, | ||
registrarUrl: root!.registrarUrl!, | ||
onboardingUtil: util, | ||
waitForTeapot: initialStatus != AtSignStatus.teapot, | ||
), |
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.
Where we determine whether to show OTP or CRAM screen immediately
if (_showCram) { | ||
return ActivateCramDialog( | ||
atSign: widget.atSign, | ||
config: widget.config, | ||
); | ||
} |
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.
OTP screen has an internal switch to show the cram screen instead
ref: at_onboarding_flutter_layers | ||
resolved-ref: "3b22ed2d8608b11203d7a3fa767d5a64406eef01" | ||
ref: "1e244eb5f522d31d9d0eb3c67990d7d6bd612446" | ||
resolved-ref: "1e244eb5f522d31d9d0eb3c67990d7d6bd612446" |
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.
New commit in at_onboarding_flutter layers, I've switched to using the commit ref, because pub doesn't check the remote for new changes on a branch, nor should it to be fair. Pinning to a commit is safer, and ensures that pub fetches new changes when we tell it to.
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.
Whoops, please ignore this, deprecated app, so it doesn't really matter. I accidentally ran pub get in this package.
@@ -9,6 +9,8 @@ import 'package:at_onboarding_flutter/src/utils/at_onboarding_response_status.da | |||
import 'package:at_server_status/at_server_status.dart'; | |||
import 'package:http/http.dart'; | |||
import 'package:http/io_client.dart'; | |||
// ignore: implementation_imports | |||
import 'package:at_onboarding_flutter/src/utils/at_onboarding_app_constants.dart'; |
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.
This is exposed so we can set the root domain in one of the places in at_onboarding_flutter
0a6c599
to
9e3f5eb
Compare
f0673ba
to
0396443
Compare
3adaccf
to
ef2c682
Compare
0b97b1f
to
e74d0e8
Compare
d0a48f1
to
b689a3b
Compare
- What I did
(root.atsign.org & vip.ve.atsign.zone)
atsign-foundation/at_widgets@1e244eb
Try test profile
widget when not onboarded with a prod atSign.When registering a root it is useful to note that only the domain and description are required. When registrarUrl / apiKey is missing for a root, the app will fallback to the new cram screen.
- How I did it
- How to verify it
Tested cram activation with prod. Tested register-root via staging.
How to test this branch:
cd packages/dart/npt_flutter && flutter pub get
flutter build <OS> --release
npt_flutter --register-root 'domain:root.atsign.wtf;description:Staging'
You may also replace the root's values with a private environment or add another, comma separated:
npt_flutter --register-root 'domain:my.private.root.wtf;description:My private root'
or
npt_flutter --register-root \ 'domain:root.atsign.wtf;description:Staging,domain:my.private.root.wtf;description:My private root'
5.1. Enter an unactivated prod atSign with prod root-domain set
5.2. Click the option below the pin code form to "use a license key instead"
5.3. Copy the cram key from the registrar
5.4. Paste the cram key
5.5. Ensure activation was successful
6.1. Enter an unactivated staging atSign with staging root-domain set
6.2. Copy the cram key from the registrar
6.3. Paste the cram key
6.4. Ensure activation was successful
Note that as of this update, there is no code in NoPorts Desktop that implies staging should work, thus staging serves as a suitable test for a private environment. There are some uses of the staging url in other dependencies, but they should be ignored at this point, since NoPorts should be passing explicit values in all of these places.
- Description for the changelog
feat: Noports desktop cram auth