Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 26 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
flutter: '3.x'
ios-simulator: iPhone 17
java: 17
vcpkg-commit: 66c0373dc7fca549e5803087b9487edfe3aca0a1

jobs:

Expand Down Expand Up @@ -333,21 +334,32 @@ jobs:
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # pin@v11.6
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: '66c0373dc7fca549e5803087b9487edfe3aca0a1'
vcpkgGitCommitId: '${{ env.vcpkg-commit }}'

- name: Cache vcpkg packages and binaries
- name: Cache vcpkg installed tree
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # pin@v6.1.0
with:
path: |
${{ github.workspace }}/vcpkg/installed
${{ github.workspace }}/vcpkg-binary-cache
key: vcpkg-${{ runner.os }}-${{ hashFiles('auth0_flutter/windows/vcpkg.json') }}
path: ${{ github.workspace }}/vcpkg/installed
key: vcpkg-installed-${{ runner.os }}-${{ env.vcpkg-commit }}-${{ hashFiles('auth0_flutter/windows/vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-
vcpkg-installed-${{ runner.os }}-${{ env.vcpkg-commit }}-

# Keyed by the pinned vcpkg commit (stable across runs) rather
# than github.run_id, so this cache keeps accumulating per-port
# binaries across runs instead of saving a fresh, ever-growing
# entry every run that evicts other jobs' caches once the repo
# is near the per-repo cache limit.
- name: Cache vcpkg binary cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # pin@v6.1.0
with:
path: ${{ github.workspace }}/vcpkg-binary-cache
key: vcpkg-binary-cache-${{ runner.os }}-${{ env.vcpkg-commit }}
restore-keys: |
vcpkg-binary-cache-${{ runner.os }}-

- name: Install vcpkg dependencies
run: |
${{ github.workspace }}\vcpkg\vcpkg install cpprestsdk:x64-windows openssl:x64-windows boost-system:x64-windows boost-date-time:x64-windows boost-regex:x64-windows
${{ github.workspace }}\vcpkg\vcpkg install --recurse "cpp-httplib[core,openssl]:x64-windows" nlohmann-json:x64-windows openssl:x64-windows
shell: cmd
env:
VCPKG_BINARY_SOURCES: 'clear;files,${{ github.workspace }}/vcpkg-binary-cache,readwrite'
Expand All @@ -356,10 +368,10 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # pin@v6.1.0
with:
path: auth0_flutter/example/build/windows
key: win-example-build-${{ runner.os }}-${{ hashFiles('auth0_flutter/windows/**/*.cpp', 'auth0_flutter/windows/**/*.h', 'auth0_flutter/windows/CMakeLists.txt', 'auth0_flutter/windows/vcpkg.json') }}-${{ hashFiles('auth0_flutter/example/lib/**/*.dart') }}
key: win-example-build-${{ runner.os }}-${{ env.vcpkg-commit }}-${{ hashFiles('auth0_flutter/windows/**/*.cpp', 'auth0_flutter/windows/**/*.h', 'auth0_flutter/windows/CMakeLists.txt', 'auth0_flutter/windows/vcpkg.json') }}-${{ hashFiles('auth0_flutter/example/lib/**/*.dart') }}
restore-keys: |
win-example-build-${{ runner.os }}-${{ hashFiles('auth0_flutter/windows/**/*.cpp', 'auth0_flutter/windows/**/*.h', 'auth0_flutter/windows/CMakeLists.txt', 'auth0_flutter/windows/vcpkg.json') }}-
win-example-build-${{ runner.os }}-
win-example-build-${{ runner.os }}-${{ env.vcpkg-commit }}-${{ hashFiles('auth0_flutter/windows/**/*.cpp', 'auth0_flutter/windows/**/*.h', 'auth0_flutter/windows/CMakeLists.txt', 'auth0_flutter/windows/vcpkg.json') }}-
win-example-build-${{ runner.os }}-${{ env.vcpkg-commit }}-

- name: Build Windows example app
working-directory: auth0_flutter/example
Expand All @@ -377,15 +389,15 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # pin@v6.1.0
with:
path: auth0_flutter/windows/build
key: win-test-build-${{ runner.os }}-${{ hashFiles('auth0_flutter/windows/**/*.cpp', 'auth0_flutter/windows/**/*.h', 'auth0_flutter/windows/CMakeLists.txt', 'auth0_flutter/windows/test/**', 'auth0_flutter/windows/vcpkg.json') }}
key: win-test-build-${{ runner.os }}-${{ env.vcpkg-commit }}-${{ hashFiles('auth0_flutter/windows/**/*.cpp', 'auth0_flutter/windows/**/*.h', 'auth0_flutter/windows/CMakeLists.txt', 'auth0_flutter/windows/test/**', 'auth0_flutter/windows/vcpkg.json') }}
restore-keys: |
win-test-build-${{ runner.os }}-
win-test-build-${{ runner.os }}-${{ env.vcpkg-commit }}-

- name: Build Windows unit tests
working-directory: auth0_flutter/windows
run: |
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DAUTH0_FLUTTER_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
cmake --build build --config Debug --parallel
shell: cmd

- name: Run Windows unit tests with coverage
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ The default `flutter test` suites (Dart) run without credentials — they need o

### Naming Conventions

Dart defaults: `UpperCamelCase` for classes/enums, `lowerCamelCase` for members/variables, `lowercase_with_underscores` for files — enforced by `flutter_lints` plus repo-specific rules in `analysis_options.yaml` (identical in both packages).
Dart defaults: `UpperCamelCase` for classes/enums, `lowerCamelCase` for members/variables, `lowercase_with_underscores` for files — enforced by `flutter_lints` plus repo-specific rules in `analysis_options.yaml` (identical in both packages, except `avoid_final_parameters`/`prefer_final_parameters` below).

**CI-enforced rules** (from `analysis_options.yaml`, `flutter analyze` fails otherwise):
- `prefer_single_quotes`, `lines_longer_than_80_chars`, `always_declare_return_types`, `type_annotate_public_apis`
- `prefer_final_locals`, `prefer_final_parameters`, `prefer_final_in_for_each`
- `prefer_final_locals`, `prefer_final_in_for_each` — plus `avoid_final_parameters` in `auth0_flutter` (newer Dart SDKs reject `final` on non-constructor parameters); `auth0_flutter_platform_interface` still has the deprecated `prefer_final_parameters` pending the same cleanup
- `strict-casts`, `strict-inference`, `strict-raw-types` (analyzer language modes), `unawaited_futures: error`, `missing_required_param: error`

See [references/code-style.md](references/code-style.md) for good/bad examples and the dominant options/models pattern.
Expand Down
10 changes: 8 additions & 2 deletions auth0_flutter/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,13 @@ cd C:\vcpkg
setx VCPKG_ROOT "C:\vcpkg"
```

The plugin's `vcpkg.json` manifest automatically pulls the required packages (`cpprestsdk`, `openssl`, `boost-system`, `boost-date-time`, `boost-regex`) at build time — no manual `vcpkg install` is needed.
The plugin's `vcpkg.json` manifest (`auth0_flutter/windows/vcpkg.json`) lists the required packages (`cpp-httplib`, `nlohmann-json`, `openssl`), but because it lives in the plugin's own directory rather than your app's `windows/` root, vcpkg's manifest mode won't auto-install them. Install them explicitly into your vcpkg instance:

```powershell
C:\vcpkg\vcpkg install --recurse "cpp-httplib[core,openssl]:x64-windows" nlohmann-json:x64-windows openssl:x64-windows
```

> 💡 **Upgrading from an older auth0_flutter version?** Previous versions depended on `cpprestsdk` and `boost-system`/`boost-date-time`/`boost-regex`. If your vcpkg instance was already set up for those, run the command above to install the new packages (the old ones can be left installed or removed with `vcpkg remove cpprestsdk boost-system boost-date-time boost-regex`).

#### 2. Configure your app's CMakeLists.txt

Expand All @@ -526,7 +532,7 @@ project(your_app LANGUAGES CXX)
# ... rest of your CMakeLists.txt ...
```

> ⚠️ The `CMAKE_TOOLCHAIN_FILE` line **must** appear before `project()`. If it appears after, CMake will have already configured the compiler and vcpkg packages will not be found, resulting in build errors like `Could not find a package configuration file provided by "cpprestsdk"`.
> ⚠️ The `CMAKE_TOOLCHAIN_FILE` line **must** appear before `project()`. If it appears after, CMake will have already configured the compiler and vcpkg packages will not be found, resulting in build errors like `Could not find a package configuration file provided by "httplib"`.

#### 3. Register the custom URL scheme (protocol handler)

Expand Down
2 changes: 1 addition & 1 deletion auth0_flutter/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ linter:
avoid_double_and_int_checks: true
avoid_equals_and_hash_code_on_mutable_classes: true
avoid_escaping_inner_quotes: true
avoid_final_parameters: true
avoid_implementing_value_types: true
avoid_js_rounded_ints: true
avoid_positional_boolean_parameters: true
Expand All @@ -63,7 +64,6 @@ linter:
prefer_expression_function_bodies: true
prefer_final_in_for_each: true
prefer_final_locals: true
prefer_final_parameters: true
prefer_if_elements_to_conditional_expressions: true
prefer_interpolation_to_compose_strings: true
prefer_mixin: true
Expand Down
2 changes: 0 additions & 2 deletions auth0_flutter/example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>14.0</string>
</dict>
</plist>
3 changes: 1 addition & 2 deletions auth0_flutter/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '14.0'
platform :ios, '15.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
24 changes: 12 additions & 12 deletions auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -810,7 +810,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -838,7 +838,7 @@
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -867,7 +867,7 @@
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.sdks.Flutter.Tests;
Expand All @@ -893,7 +893,7 @@
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.sdks.Flutter.Tests;
Expand All @@ -918,7 +918,7 @@
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -947,7 +947,7 @@
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.sdks.Flutter.RunnerUITests;
Expand All @@ -973,7 +973,7 @@
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.sdks.Flutter.RunnerUITests;
Expand Down Expand Up @@ -1032,7 +1032,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -1081,7 +1081,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -1104,7 +1104,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -1128,7 +1128,7 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
2 changes: 1 addition & 1 deletion auth0_flutter/example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '11.0'
platform :osx, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
18 changes: 9 additions & 9 deletions auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@
buildSettings = {
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.example.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -786,7 +786,7 @@
buildSettings = {
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.example.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -801,7 +801,7 @@
buildSettings = {
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.example.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -848,7 +848,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down Expand Up @@ -928,7 +928,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -975,7 +975,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down Expand Up @@ -1061,7 +1061,7 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GENERATE_INFOPLIST_FILE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -1094,7 +1094,7 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GENERATE_INFOPLIST_FILE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.sdks.Flutter.RunnerUITests;
Expand Down Expand Up @@ -1125,7 +1125,7 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GENERATE_INFOPLIST_FILE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.sdks.Flutter.RunnerUITests;
Expand Down
Loading
Loading