Skip to content
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

Authentication #335

Merged
merged 42 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0fb1a88
Auth skeleton
FeodorFitsner Sep 9, 2022
aab1d77
GitHub Authorize - full cycle
FeodorFitsner Sep 12, 2022
ed5915d
Fix Python 3.7
FeodorFitsner Sep 12, 2022
8982a4d
Open popup in Python
FeodorFitsner Sep 14, 2022
4e76210
User/Group fetching simplified
FeodorFitsner Sep 15, 2022
638b144
OAuth almost complete
FeodorFitsner Sep 15, 2022
9c00b9e
Refresh token functionality
FeodorFitsner Sep 16, 2022
f4b2e4f
Save/restore auth token
FeodorFitsner Sep 16, 2022
d7e8481
SVG support
FeodorFitsner Sep 18, 2022
49c1cc2
SVG images from base64
FeodorFitsner Sep 18, 2022
a03386b
Merge branch 'main' into auth
FeodorFitsner Sep 18, 2022
8f0f224
Get back on Flutter stable channel
FeodorFitsner Sep 18, 2022
08d24e3
Fix pubspec
FeodorFitsner Sep 18, 2022
10ca3c9
generic page.invoke_method() method
FeodorFitsner Sep 19, 2022
a624d9c
Invoke method with result
FeodorFitsner Sep 19, 2022
4d1b692
Container.clip_behavior
FeodorFitsner Sep 20, 2022
2eb2352
Use MarkdownBody
FeodorFitsner Sep 20, 2022
ff0d041
Fix #359
FeodorFitsner Sep 20, 2022
c7aa5e2
Fix Python 3.7
FeodorFitsner Sep 20, 2022
5f3b417
LaunchUrl replaced with invoke_method()
FeodorFitsner Sep 21, 2022
c7561c0
Clipboard operations replaced with invoke_method()
FeodorFitsner Sep 21, 2022
3b331dd
Client storage with invoke_method()
FeodorFitsner Sep 21, 2022
ca33e8b
Merge branch 'main' into auth
FeodorFitsner Sep 22, 2022
1d94ab3
Update page.py
FeodorFitsner Sep 24, 2022
c930af6
Added page.window_bgcolor
FeodorFitsner Sep 24, 2022
432cca8
control.on_animation_end event
FeodorFitsner Sep 24, 2022
4d8b63e
Session storage
FeodorFitsner Sep 24, 2022
1fde285
page.window_to_front() that works
FeodorFitsner Sep 25, 2022
74e965b
Custom redirect URL and complete HTML
FeodorFitsner Sep 25, 2022
81b937e
page.logout
FeodorFitsner Sep 25, 2022
83bfa5a
Disable debug logging
FeodorFitsner Sep 26, 2022
5a5fdc7
Cleaunp
FeodorFitsner Sep 26, 2022
98c8842
Remove prefix in session.get_keys()
FeodorFitsner Sep 26, 2022
c72e0ef
Added cryptography encrypt/decrypt
FeodorFitsner Sep 26, 2022
578ef58
Generate Fernet key with KDF
FeodorFitsner Sep 26, 2022
090339b
Update __init__.py
FeodorFitsner Sep 27, 2022
1c82af2
Merge branch 'main' into auth
FeodorFitsner Sep 27, 2022
ac4b166
Call page.on_login handler with saved token
FeodorFitsner Sep 27, 2022
3af83d1
renamed to secret_key
FeodorFitsner Sep 27, 2022
2b65ce4
Fix token to support LinkedIn
FeodorFitsner Sep 27, 2022
0709db8
Ensure refresh_token
FeodorFitsner Sep 27, 2022
4d7f555
Image.gapless_playback
FeodorFitsner Sep 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ for:
install:
# Flutter SDK
- sudo snap install flutter --classic
- flutter channel beta
- flutter channel stable
- flutter upgrade
- flutter sdk-path

Expand All @@ -130,7 +130,7 @@ for:
install:
- ps: .\ci\install_flutter.ps1
- set PATH=C:\flutter\bin;%PATH%
- flutter channel beta
- flutter channel stable
- flutter upgrade

build_script:
Expand Down Expand Up @@ -170,10 +170,10 @@ for:

install:
- brew install cocoapods
- curl https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.0.3-stable.zip -o flutter_macos_stable.zip
- curl https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.3.2-stable.zip -o flutter_macos_stable.zip
- unzip -qq flutter_macos_stable.zip
- export PATH="$PATH:`pwd`/flutter/bin"
- flutter channel beta
- flutter channel stable
- flutter upgrade
- flutter config --enable-macos-desktop
- flutter doctor
Expand Down Expand Up @@ -207,7 +207,7 @@ for:
install:
# Flutter SDK
- sudo snap install flutter --classic
- flutter channel beta
- flutter channel stable
- flutter upgrade
- flutter sdk-path

Expand Down Expand Up @@ -240,7 +240,7 @@ for:
install:
# Flutter SDK
- sudo snap install flutter --classic
- flutter channel beta
- flutter channel stable
- flutter upgrade
- flutter sdk-path

Expand Down Expand Up @@ -275,7 +275,7 @@ for:
- curl https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.0.3-stable.zip -o flutter_macos_stable.zip
- unzip -qq flutter_macos_stable.zip
- export PATH="$PATH:`pwd`/flutter/bin"
- flutter channel beta
- flutter channel stable
- flutter upgrade
- flutter doctor

Expand Down Expand Up @@ -317,7 +317,7 @@ for:
install:
# Flutter SDK
- sudo snap install flutter --classic
- flutter channel beta
- flutter channel stable
- flutter upgrade
- flutter sdk-path

Expand Down
2 changes: 1 addition & 1 deletion ci/install_flutter.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$distPath = "$env:TEMP\flutter_windows_stable.zip"

Write-Host "Downloading Flutter SDK..."
(New-Object Net.WebClient).DownloadFile("https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.0.3-stable.zip", $distPath)
(New-Object Net.WebClient).DownloadFile("https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.3.2-stable.zip", $distPath)

Write-Host "Unpacking Flutter SDK..."
7z x $distPath -o"$env:SystemDrive\" | Out-Null
59 changes: 59 additions & 0 deletions client/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,79 @@
PODS:
- DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.4)
- DKImagePickerController/PhotoGallery (4.3.4):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.4)
- DKPhotoGallery (0.0.17):
- DKPhotoGallery/Core (= 0.0.17)
- DKPhotoGallery/Model (= 0.0.17)
- DKPhotoGallery/Preview (= 0.0.17)
- DKPhotoGallery/Resource (= 0.0.17)
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Core (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Preview
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Model (0.0.17):
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Preview (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Resource
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Resource (0.0.17):
- SDWebImage
- SwiftyGif
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0)
- SDWebImage (5.13.2):
- SDWebImage/Core (= 5.13.2)
- SDWebImage/Core (5.13.2)
- shared_preferences_ios (0.0.1):
- Flutter
- SwiftyGif (5.4.3)
- url_launcher_ios (0.0.1):
- Flutter

DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)

SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- SDWebImage
- SwiftyGif

EXTERNAL SOURCES:
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
Flutter:
:path: Flutter
shared_preferences_ios:
:path: ".symlinks/plugins/shared_preferences_ios/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
SDWebImage: 72f86271a6f3139cc7e4a89220946489d4b9a866
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
Expand Down
4 changes: 4 additions & 0 deletions client/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <screen_retriever/screen_retriever_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>
#include <window_to_front/window_to_front_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
Expand All @@ -20,4 +21,7 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) window_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");
window_manager_plugin_register_with_registrar(window_manager_registrar);
g_autoptr(FlPluginRegistrar) window_to_front_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowToFrontPlugin");
window_to_front_plugin_register_with_registrar(window_to_front_registrar);
}
1 change: 1 addition & 0 deletions client/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
screen_retriever
url_launcher_linux
window_manager
window_to_front
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
2 changes: 2 additions & 0 deletions client/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import screen_retriever
import shared_preferences_macos
import url_launcher_macos
import window_manager
import window_to_front

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
WindowToFrontPlugin.register(with: registry.registrar(forPlugin: "WindowToFrontPlugin"))
}
6 changes: 6 additions & 0 deletions client/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ PODS:
- FlutterMacOS (1.0.0)
- screen_retriever (0.0.1):
- FlutterMacOS
- shared_preferences_macos (0.0.1):
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS
- window_manager (0.2.0):
Expand All @@ -10,6 +12,7 @@ PODS:
DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
- shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)

Expand All @@ -18,6 +21,8 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral
screen_retriever:
:path: Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos
shared_preferences_macos:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
window_manager:
Expand All @@ -26,6 +31,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811
screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
shared_preferences_macos: a64dc611287ed6cbe28fd1297898db1336975727
url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8

Expand Down
30 changes: 29 additions & 1 deletion client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.0"
flutter_svg:
dependency: transitive
description:
name: flutter_svg
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.5"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -226,6 +233,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
path_drawing:
dependency: transitive
description:
name: path_drawing
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
path_parsing:
dependency: transitive
description:
name: path_parsing
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -490,6 +511,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.6"
window_to_front:
dependency: transitive
description:
name: window_to_front
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.3"
xdg_directories:
dependency: transitive
description:
Expand All @@ -512,5 +540,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=2.18.1 <3.0.0"
flutter: ">=3.0.0"
2 changes: 1 addition & 1 deletion client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=2.16.1 <3.0.0"
sdk: ">=2.18.1 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand Down
3 changes: 3 additions & 0 deletions client/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <screen_retriever/screen_retriever_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>
#include <window_manager/window_manager_plugin.h>
#include <window_to_front/window_to_front_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
ScreenRetrieverPluginRegisterWithRegistrar(
Expand All @@ -17,4 +18,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WindowManagerPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowManagerPlugin"));
WindowToFrontPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowToFrontPlugin"));
}
1 change: 1 addition & 0 deletions client/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
screen_retriever
url_launcher_windows
window_manager
window_to_front
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
9 changes: 5 additions & 4 deletions package/lib/src/actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import 'protocol/app_become_active_payload.dart';
import 'protocol/app_become_inactive_payload.dart';
import 'protocol/append_control_props_request.dart';
import 'protocol/clean_control_payload.dart';
import 'protocol/invoke_method_payload.dart';
import 'protocol/page_controls_batch_payload.dart';
import 'protocol/register_webclient_response.dart';
import 'protocol/remove_control_payload.dart';
import 'protocol/replace_page_controls_payload.dart';
import 'protocol/session_crashed_payload.dart';
import 'protocol/signout_payload.dart';
import 'protocol/update_control_props_payload.dart';
import 'web_socket_client.dart';

Expand Down Expand Up @@ -71,9 +71,10 @@ class SessionCrashedAction {
SessionCrashedAction(this.payload);
}

class SignoutAction {
final SignoutPayload payload;
SignoutAction(this.payload);
class InvokeMethodAction {
final InvokeMethodPayload payload;
final WebSocketClient ws;
InvokeMethodAction(this.payload, this.ws);
}

class AddPageControlsAction {
Expand Down
7 changes: 3 additions & 4 deletions package/lib/src/controls/animated_switcher.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import 'error.dart';
import '../utils/animations.dart';
import '../utils/gradient.dart';
import 'package:flutter/material.dart';

import '../models/control.dart';
import '../utils/borders.dart';
import '../utils/animations.dart';
import 'create_control.dart';
import 'error.dart';

class AnimatedSwitcherControl extends StatelessWidget {
final Control? parent;
Expand Down Expand Up @@ -41,6 +39,7 @@ class AnimatedSwitcherControl extends StatelessWidget {
var child = createControl(control, contentCtrls.first.id, disabled);

return constrainedControl(
context,
AnimatedSwitcher(
duration: Duration(milliseconds: duration),
reverseDuration: Duration(milliseconds: reverseDuration),
Expand Down
1 change: 1 addition & 0 deletions package/lib/src/controls/card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class CardControl extends StatelessWidget {
bool disabled = control.isDisabled || parentDisabled;

return constrainedControl(
context,
Card(
elevation: control.attrDouble("elevation"),
margin: parseEdgeInsets(control, "margin"),
Expand Down
3 changes: 2 additions & 1 deletion package/lib/src/controls/checkbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ class _CheckboxControlState extends State<CheckboxControl> {
: Row(children: [labelWidget, checkbox])));
}

return constrainedControl(result, widget.parent, widget.control);
return constrainedControl(
context, result, widget.parent, widget.control);
});
}
}
2 changes: 1 addition & 1 deletion package/lib/src/controls/circle_avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ class CircleAvatarControl extends StatelessWidget {
? createControl(control, contentCtrls.first.id, disabled)
: null);

return constrainedControl(avatar, parent, control);
return constrainedControl(context, avatar, parent, control);
}
}
Loading