]> git.proxmox.com Git - flutter/proxmox_login_manager.git/log
flutter/proxmox_login_manager.git
7 months agotree wide: check if build context is still valid after async call
Thomas Lamprecht [Tue, 9 Apr 2024 05:42:55 +0000 (07:42 +0200)]
tree wide: check if build context is still valid after async call

> Storing BuildContext for later usage can easily lead to difficult
> to diagnose crashes. Asynchronous gaps are implicitly storing
> BuildContext and are some of the easiest to overlook when writing
> code.
>
> When a BuildContext is used, a mounted property must be checked
> after an asynchronous gap, depending on how the BuildContext is
> accessed:
>
> * When using a State's context property, the State's mounted
>   property must be checked.
> * For other BuildContext instances (like a local variable or
>   function argument), the BuildContext's mounted property must be
>   checked.

-- https://dart.dev/tools/linter-rules/use_build_context_synchronously

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agotree wide: use SizedBox over Container if just done for whitespace
Thomas Lamprecht [Tue, 9 Apr 2024 05:25:33 +0000 (07:25 +0200)]
tree wide: use SizedBox over Container if just done for whitespace

Container are much heavier w.r.t. performacne impact, as per the
sized_box_for_whitespace lint.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agotree wide: avoid unnecessary new keyword
Thomas Lamprecht [Tue, 9 Apr 2024 05:21:44 +0000 (07:21 +0200)]
tree wide: avoid unnecessary new keyword

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agotree wide: prefer const constructors
Thomas Lamprecht [Tue, 9 Apr 2024 05:17:08 +0000 (07:17 +0200)]
tree wide: prefer const constructors

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agotree wide: avoid unnecessary this
Thomas Lamprecht [Tue, 9 Apr 2024 05:16:49 +0000 (07:16 +0200)]
tree wide: avoid unnecessary this

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agotree wide: various small lint auto-fixes
Thomas Lamprecht [Wed, 3 Apr 2024 14:08:31 +0000 (16:08 +0200)]
tree wide: various small lint auto-fixes

fix the following lints:
- prefer_is_empty
- sort_child_properties_last
- prefer_const_literals_to_create_immutables
- prefer_const_constructors

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agotree wide: avoid unused imports
Thomas Lamprecht [Wed, 3 Apr 2024 10:27:33 +0000 (12:27 +0200)]
tree wide: avoid unused imports

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agotree wide: use 'const' with the constructor to improve performance
Thomas Lamprecht [Wed, 3 Apr 2024 10:26:34 +0000 (12:26 +0200)]
tree wide: use 'const' with the constructor to improve performance

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoadd flutter lints to dev-dependencies and enable in new analysis options
Thomas Lamprecht [Wed, 3 Apr 2024 10:25:47 +0000 (12:25 +0200)]
add flutter lints to dev-dependencies and enable in new analysis options

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agopubspec: mark package as not for publishing
Thomas Lamprecht [Wed, 3 Apr 2024 10:24:06 +0000 (12:24 +0200)]
pubspec: mark package as not for publishing

we use path based dependencies for this proxmox specific libraries
that we do not plan to publish to a official dart package registry
like pub.dev so just mark them as not-for publishing for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agodrop depreacated author field from pubspec
Thomas Lamprecht [Wed, 3 Apr 2024 10:23:54 +0000 (12:23 +0200)]
drop depreacated author field from pubspec

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agopubspec: track collection dependency as per dart fix recommendation
Thomas Lamprecht [Wed, 3 Apr 2024 06:14:22 +0000 (08:14 +0200)]
pubspec: track collection dependency as per dart fix recommendation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoadapt to toggleableActiveColor property having been deprecated
Thomas Lamprecht [Wed, 3 Apr 2024 06:11:06 +0000 (08:11 +0200)]
adapt to toggleableActiveColor property having been deprecated

ThemeData's toggleableActiveColor property has been deprecated [0].
This fix was done by `dart fix --apply` and thus is naturally a
relative broad automatic fix where we might only require a subset
from, but for now just trust the linter to do the safe thing.

[0]: https://docs.flutter.dev/release/breaking-changes/toggleable-active-color

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoupdate dependencies
Thomas Lamprecht [Tue, 2 Apr 2024 15:05:03 +0000 (17:05 +0200)]
update dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agotfa: use number keyboard input type for totp
Thomas Lamprecht [Wed, 5 Jul 2023 10:20:07 +0000 (12:20 +0200)]
tfa: use number keyboard input type for totp

and try visiblePassword otherwise (i.e., recovery keys), which should
present a keyboard with both letters and the top-bar numberline
shown.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agologin form: set TextInputAction.next for origin field
Thomas Lamprecht [Wed, 5 Jul 2023 10:11:17 +0000 (12:11 +0200)]
login form: set TextInputAction.next for origin field

changes the "enter" button in the virtual keyboard on iOS and
Android to a next arrow

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agologin form: make onOriginSubmitted a required callback
Thomas Lamprecht [Wed, 5 Jul 2023 10:08:51 +0000 (12:08 +0200)]
login form: make onOriginSubmitted a required callback

as an user can hit enter on the field to start a submission even if
the submit button is disabled, e.g., due to no origin value being
entered at all yet.

Basically we already had that as contract, as forced dereferencing
via ! for accessing the callback.

As the callback already checks the validation state itself we do not
need to change anything there.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agotfa form: wrap in SafeArea
Thomas Lamprecht [Wed, 5 Jul 2023 10:07:30 +0000 (12:07 +0200)]
tfa form: wrap in SafeArea

to avoid that the submit button is cut-off halfway

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agopubspec: upgrade dependencies, most for dart 3 compat
Thomas Lamprecht [Tue, 4 Jul 2023 15:28:54 +0000 (17:28 +0200)]
pubspec: upgrade dependencies, most for dart 3 compat

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agotfa: allow closing tfa form
Dominik Csapak [Tue, 4 Jul 2023 13:53:18 +0000 (15:53 +0200)]
tfa: allow closing tfa form

abort the login when the form returns null. This happens if the user
presses 'X' in the tfa form.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
16 months agosaved login: don't give outdated ticket to login form
Dominik Csapak [Tue, 4 Jul 2023 13:53:17 +0000 (15:53 +0200)]
saved login: don't give outdated ticket to login form

if the user was logged in in the past, but that ticket expired, we still
gave the expired ticket to the login form which tried to login with
that, producing a login error the first time the user pressed login.

we already get the correct ticket in a variable, so use that.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
16 months agotfa: only open tfa form when there is at least one type available
Dominik Csapak [Tue, 4 Jul 2023 13:27:37 +0000 (15:27 +0200)]
tfa: only open tfa form when there is at least one type available

Otherwise the tfa form will error out trying to access an index in the
array that does not exist (it assumes there is at least one type).
This can happen e.g. if there is only webauthn for a user configured

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
16 months agotfa: adapt test in loading-overlay, we can have non-totp now
Thomas Lamprecht [Mon, 3 Jul 2023 10:30:55 +0000 (12:30 +0200)]
tfa: adapt test in loading-overlay, we can have non-totp now

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agoupdate to new-format TFA login
Thomas Lamprecht [Mon, 3 Jul 2023 10:19:32 +0000 (12:19 +0200)]
update to new-format TFA login

use the initState method to avoid that we override the initial
selected TFA method on every re-build and also to avoid running into
a transitive error when TFA login suceeded, as the handler for that
in the API dart lib will set tfa to null then, causing a null
dereference error if we'd get that in the (re)build method.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agologin selector: read saved password when session expired
Dominik Csapak [Tue, 2 May 2023 08:54:12 +0000 (10:54 +0200)]
login selector: read saved password when session expired

by only reading the ticket when it's an active session

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
18 months agologin form: use wrapper function for biometric interface
Dominik Csapak [Tue, 2 May 2023 08:53:06 +0000 (10:53 +0200)]
login form: use wrapper function for biometric interface

since we already have it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
18 months agologin connection test: avoid the word test
Thomas Lamprecht [Fri, 28 Apr 2023 11:26:51 +0000 (13:26 +0200)]
login connection test: avoid the word test

Rather use "Connecting...", which is a similar wording for what
happens on login button press ("Authenticating...").

Could be actually nice to mention the host and the (currently tried)
port in that message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agologin form: restructure _tryGetAccessDomains
Dominik Csapak [Tue, 25 Apr 2023 11:47:16 +0000 (13:47 +0200)]
login form: restructure _tryGetAccessDomains

by splitting it into two functions:
_tryLoadAccessDomains
_loadAccessDomains

where the _try variant never throws an exception, but shows a
ConnectionErrorDialog on failure.

this also reorders the code a bit to not need the 'hasPort' variable
at all

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
18 months agologin form: factor out the ConnectionErrorDialog
Dominik Csapak [Tue, 25 Apr 2023 11:16:20 +0000 (13:16 +0200)]
login form: factor out the ConnectionErrorDialog

the implementations are nearly identical, but we actually always want to show
some context there.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
18 months agologin form: fix port autodetection
Aaron Lauterer [Tue, 25 Apr 2023 09:15:02 +0000 (11:15 +0200)]
login form: fix port autodetection

The port 443 check was not triggered as 'hasPort' was already false.

Only add the port 443 to the IP/Url is the check was successful, otherwise
we leave the entered IP/Url as is. The use will need to fix it before we
can try to connect again.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
18 months agopubspec.lock: update dependencies
Dominik Csapak [Mon, 24 Apr 2023 07:35:08 +0000 (09:35 +0200)]
pubspec.lock: update dependencies

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
19 months agologin form: try port 8006 and 443 if none is given
Dominik Csapak [Thu, 20 Apr 2023 13:59:53 +0000 (15:59 +0200)]
login form: try port 8006 and 443 if none is given

but only if we really have any error that we cannot parse and would show
the 'could not connect' dialog

since the Uri object does not print the ':443' when calling 'toString()'
on the origin, we have to manually add when we read from the storage,
otherwise we'd retry 8006 every time instead of only once

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
19 months agooptionally save passwords with biometric storage
Dominik Csapak [Tue, 13 Sep 2022 13:11:30 +0000 (15:11 +0200)]
optionally save passwords with biometric storage

uses 'biometric_storage' to save passwords secured by the platform
biometric method (e.g. fingerprint).

fingerprint is necessary when saving the password, as well as everytime
we need to read the password, e.g. selecting a login with a saved
password from the list.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
19 months agologin form: count the loading progresses
Dominik Csapak [Thu, 20 Apr 2023 12:18:06 +0000 (14:18 +0200)]
login form: count the loading progresses

instead of using a bool flag for that. in case the login and realm
selector both start, but one is finished before the other, the loading
mask vanished without explanation.

this way, we remove the mask only when both are finished

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
19 months agologin form: move condition into handler
Dominik Csapak [Tue, 13 Sep 2022 09:45:13 +0000 (11:45 +0200)]
login form: move condition into handler

move the if(snapshot.hasData) check into the onPressed handler instead
of generating a new widget, that way the widget is not recreated
every time the condition changes and the code gets much shorter

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
20 months agologin form: dart fmt
Thomas Lamprecht [Wed, 15 Mar 2023 08:39:19 +0000 (09:39 +0100)]
login form: dart fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agopubspec.lock: update dependencies
Thomas Lamprecht [Wed, 15 Mar 2023 08:38:47 +0000 (09:38 +0100)]
pubspec.lock: update dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agologin: fix login for saved ipv6 addresses
Dominik Csapak [Thu, 1 Dec 2022 09:27:34 +0000 (10:27 +0100)]
login: fix login for saved ipv6 addresses

Since we only string concatenated the host + port, ipv6 addresses were
invalid because their missing [] around the ip. To fix that, use
'Uri's 'toString' method but strip the 'https://' prefix when creating
an Uri object again

This now also allows to enter the 'https://' prefix manually

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopubspec: update dependencies
Thomas Lamprecht [Thu, 8 Sep 2022 14:32:16 +0000 (16:32 +0200)]
pubspec: update dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoimprove colors of login screen
Dominik Csapak [Thu, 8 Sep 2022 09:55:40 +0000 (11:55 +0200)]
improve colors of login screen

default primary color was a purple hue that did not really fit with our
theme. That was used on highlighting form fields and the progress
indicator. I replaced it with orange since that fits nicely with
the rest of the look and feel

also removed the use of accentColor int he ProxmoxProgressOverlay, so
that the text appears now white instead of some shade of cyan.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agomigrate from FlatButton to TextButton
Dominik Csapak [Thu, 8 Sep 2022 09:55:39 +0000 (11:55 +0200)]
migrate from FlatButton to TextButton

since flutter 3 removed FlatButton. For this we have to do the colors a
little different, so i moved the color/disabledColor into the
textButtonTheme, which does not modify anything else here.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agologin_form: keep Continue button above Android softnav
Aaron Lauterer [Thu, 8 Sep 2022 09:55:38 +0000 (11:55 +0200)]
login_form: keep Continue button above Android softnav

By placing the items in a SafeArea we avoid having the "Continue" button
behind the Android soft navigation buttons.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopub: upgrade depednecies
Thomas Lamprecht [Fri, 4 Feb 2022 09:21:49 +0000 (10:21 +0100)]
pub: upgrade depednecies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoTFA: improve color-readabillity for input
Dominik Csapak [Mon, 20 Dec 2021 11:35:09 +0000 (12:35 +0100)]
TFA: improve color-readabillity for input

with the recent changes, the input field was invisible, adapting like
the login dialog - note this is still not using the correct colors that
the actual main app theme defines, as its always derived from the dark
default theme now.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
[ Thomas: clarified/extended commit message ]
Signed-off-by: Thomas Lamprecht <thomas@lamprecht.org>
2 years agocolors and stuff
Thomas Lamprecht [Tue, 14 Dec 2021 20:32:58 +0000 (21:32 +0100)]
colors and stuff

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopubspec: update dependencies
Thomas Lamprecht [Thu, 9 Dec 2021 08:13:21 +0000 (09:13 +0100)]
pubspec: update dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoTFA: fix awaiting TOTP verification page
Thomas Lamprecht [Thu, 10 Jun 2021 09:54:15 +0000 (11:54 +0200)]
TFA: fix awaiting TOTP verification page

The cast to the FutureOr<> type confuses dart/flutter nowadays:

flutter: type 'Future<dynamic>' is not a subtype of type 'FutureOr<ProxmoxApiClient>' in type cast
flutter: #0      _ProxmoxLoginPageState._onLoginButtonPressed (package:proxmox_login_manager/proxmox_login_form.dart:406:12)
<asynchronous suspension>

just drop it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoupdate dependencies
Thomas Lamprecht [Sat, 29 May 2021 12:06:12 +0000 (14:06 +0200)]
update dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomigrate to sound null safety
Thomas Lamprecht [Fri, 12 Mar 2021 14:12:26 +0000 (15:12 +0100)]
migrate to sound null safety

tried to strike a balance between auto migration and checking what
can actually get null, or improve that by promoting some variables.

Learnt that for class fields dart cannot promote nullable fields to
null-safe after a if (field == null) return 'early'; check, so we
need to introduce a intermediate varibable and check on that - a bit
of a bummer..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoupgrade dependencies
Thomas Lamprecht [Thu, 11 Mar 2021 18:21:02 +0000 (19:21 +0100)]
upgrade dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoupdate dependencies
Tim Marx [Wed, 23 Sep 2020 11:34:17 +0000 (13:34 +0200)]
update dependencies

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoinform user about unsupported pve version
Tim Marx [Wed, 23 Sep 2020 11:13:38 +0000 (13:13 +0200)]
inform user about unsupported pve version

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agofix issue when 443 port is used
Thomas Lamprecht [Wed, 23 Sep 2020 08:20:16 +0000 (10:20 +0200)]
fix issue when 443 port is used

The reason for this issue was that the dart Uri.hasPort[0] property
is queried when checking if the passed URL has no port added and thus
the implied 8006 port should be added. For https and port 443 the
port is detected as "default" and omitted, thus this is always false
for that, argh!

Just use a simple regex on the original trimmed origin text.
IPv6 must be wrapped in brackets so [::1] or [::1]:443 is also
correctly detected.

[0]: https://api.dart.dev/stable/2.9.1/dart-core/Uri/hasPort.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd autofill group to login form
Tim Marx [Tue, 22 Sep 2020 12:10:03 +0000 (14:10 +0200)]
add autofill group to login form

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agocatch expired sessions before login
Tim Marx [Tue, 22 Sep 2020 10:48:47 +0000 (12:48 +0200)]
catch expired sessions before login

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoadd multi session usage
Tim Marx [Fri, 18 Sep 2020 10:56:49 +0000 (12:56 +0200)]
add multi session usage

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agochange proxmox logo styles
Tim Marx [Fri, 18 Sep 2020 08:34:51 +0000 (10:34 +0200)]
change proxmox logo styles

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoadd autofill hints to form fields
Tim Marx [Mon, 14 Sep 2020 10:42:23 +0000 (12:42 +0200)]
add autofill hints to form fields

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoadd close button to login form
Tim Marx [Wed, 9 Sep 2020 12:12:52 +0000 (14:12 +0200)]
add close button to login form

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoadd onsubmitted handler for origin & password field
Tim Marx [Wed, 9 Sep 2020 11:56:07 +0000 (13:56 +0200)]
add onsubmitted handler for origin & password field

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoadd product name to header
Tim Marx [Mon, 7 Sep 2020 10:01:15 +0000 (12:01 +0200)]
add product name to header

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agologin form: ensure textfields are visibile when keyboard is shown
Tim Marx [Mon, 7 Sep 2020 09:46:08 +0000 (11:46 +0200)]
login form: ensure textfields are visibile when keyboard is shown

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoupdate dependencies
Tim Marx [Mon, 31 Aug 2020 11:46:02 +0000 (13:46 +0200)]
update dependencies

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agotrim form fields
Tim Marx [Thu, 27 Aug 2020 10:32:42 +0000 (12:32 +0200)]
trim form fields

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoadd message if no account is configured
Tim Marx [Tue, 25 Aug 2020 09:52:37 +0000 (11:52 +0200)]
add message if no account is configured

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoadd delete account button
Tim Marx [Tue, 25 Aug 2020 09:43:21 +0000 (11:43 +0200)]
add delete account button

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoadd meta data
Tim Marx [Tue, 25 Aug 2020 08:38:53 +0000 (10:38 +0200)]
add meta data

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoupgrade packages
Tim Marx [Thu, 20 Aug 2020 11:34:16 +0000 (13:34 +0200)]
upgrade packages

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoupdate readme
Tim Marx [Tue, 28 Jul 2020 10:43:30 +0000 (12:43 +0200)]
update readme

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoinitial commit
Tim Marx [Thu, 23 Jul 2020 12:43:51 +0000 (14:43 +0200)]
initial commit

Signed-off-by: Tim Marx <t.marx@proxmox.com>