Skip to content

Commit 4a045b6

Browse files
authored
Merge pull request #49 from passageidentity/PSG-3990
PSG-3990
2 parents ed24a44 + 4c7d04c commit 4a045b6

File tree

66 files changed

+4400
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4400
-5
lines changed

.github/workflows/flutter-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
run: flutter analyze
2424

2525
- name: Run tests
26-
run: flutter test --platform chrome
26+
run: flutter test --platform chrome

analysis_options.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ include: package:flutter_lints/flutter.yaml
22

33
# Additional information about this file can be found at
44
# https://dart.dev/guides/language/analysis-options
5+
6+
analyzer:
7+
exclude:
8+
- integrationtestapp/**

android/src/main/kotlin/id/passage/passage_flutter/PassageFlutter.kt

+7
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,13 @@ internal class PassageFlutter(private val activity: Activity, appId: String? = n
422422
}
423423
}
424424

425+
fun overrideBasePath(call: MethodCall, result: MethodChannel.Result) {
426+
val path = call.argument<String>("path")
427+
?: return invalidArgumentError(result)
428+
passage.overrideBasePath(path)
429+
result.success(null)
430+
}
431+
425432
// endregion
426433

427434
}

android/src/main/kotlin/id/passage/passage_flutter/PassageFlutterPlugin.kt

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class PassageFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityAware {
4444

4545
when (call.method) {
4646
"initWithAppId" -> {}
47+
"overrideBasePath" -> {
48+
passageFlutter?.overrideBasePath(call, result)
49+
}
4750
"registerWithPasskey" -> passageFlutter?.registerWithPasskey(call, result)
4851
"loginWithPasskey" -> passageFlutter?.loginWithPasskey(call, result)
4952
"deviceSupportsPasskeys" -> passageFlutter?.deviceSupportsPasskeys(result)

integrationtestapp/.gitignore

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
30+
.pub-cache/
31+
.pub/
32+
/build/
33+
34+
# Symbolication related
35+
app.*.symbols
36+
37+
# Obfuscation related
38+
app.*.map.json
39+
40+
# Android Studio will place build artifacts here
41+
/android/app/debug
42+
/android/app/profile
43+
/android/app/release
44+
45+
# Node.js related
46+
proxy-server/node_modules/

integrationtestapp/.metadata

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
17+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
18+
- platform: android
19+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
20+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
21+
- platform: ios
22+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
23+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
24+
- platform: web
25+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
26+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
27+
28+
# User provided section
29+
30+
# List of Local paths (relative to this file) that should be
31+
# ignored by the migrate tool.
32+
#
33+
# Files that are not part of the templates will be ignored by default.
34+
unmanaged_files:
35+
- 'lib/main.dart'
36+
- 'ios/Runner.xcodeproj/project.pbxproj'

integrationtestapp/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# integration test app
2+
3+
For testing Passage Flutter sdk on web,android and iOS
4+
5+
6+
# Running Tests
7+
8+
# For Web Tests:
9+
Start the ChromeDriver: chromedriver --port=4444
10+
Install Node.js packages: 'npm install' and then start the proxy server: 'node proxy_server.js'
11+
12+
Run the tests with Flutter:
13+
14+
'flutter drive --driver=test_driver/integration_test.dart --target=integration_test/magic_link_test.dart -d chrome --web-port 4200'
15+
16+
17+
# For Android/iOS Tests:
18+
You can run tests directly from VS Code.
19+
Or, you can run the tests from the command line: flutter test integration_test/magic_link_test.dart and then choose your emulator.
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:flutter_lints/flutter.yaml

integrationtestapp/android/.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
6+
}
7+
8+
def localProperties = new Properties()
9+
def localPropertiesFile = rootProject.file("local.properties")
10+
if (localPropertiesFile.exists()) {
11+
localPropertiesFile.withReader("UTF-8") { reader ->
12+
localProperties.load(reader)
13+
}
14+
}
15+
16+
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
17+
if (flutterVersionCode == null) {
18+
flutterVersionCode = "1"
19+
}
20+
21+
def flutterVersionName = localProperties.getProperty("flutter.versionName")
22+
if (flutterVersionName == null) {
23+
flutterVersionName = "1.0"
24+
}
25+
26+
android {
27+
namespace = "com.example.integrationtestapp"
28+
compileSdk = 34
29+
ndkVersion = 34
30+
31+
compileOptions {
32+
sourceCompatibility = JavaVersion.VERSION_1_8
33+
targetCompatibility = JavaVersion.VERSION_1_8
34+
}
35+
36+
defaultConfig {
37+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
38+
applicationId = "com.example.integrationtestapp"
39+
// You can update the following values to match your application needs.
40+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
41+
minSdk = 33
42+
targetSdk = 34
43+
versionCode = flutterVersionCode.toInteger()
44+
versionName = flutterVersionName
45+
}
46+
47+
buildTypes {
48+
release {
49+
// TODO: Add your own signing config for the release build.
50+
// Signing with the debug keys for now, so `flutter run --release` works.
51+
signingConfig = signingConfigs.debug
52+
}
53+
}
54+
}
55+
56+
flutter {
57+
source = "../.."
58+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
package="com.example.integrationtestapp">
4+
5+
<application
6+
android:label="integrationtestapp_flutter"
7+
tools:replace="android:label"
8+
android:icon="@mipmap/ic_launcher">
9+
10+
<!-- Necessary for passkey authentication, do not delete. -->
11+
<meta-data
12+
android:name="asset_statements"
13+
android:resource="@string/asset_statements" />
14+
15+
<activity
16+
android:name=".MainActivity"
17+
android:exported="true"
18+
android:launchMode="singleTop"
19+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
20+
android:hardwareAccelerated="true"
21+
android:windowSoftInputMode="adjustResize">
22+
<intent-filter>
23+
<action android:name="android.intent.action.MAIN"/>
24+
<category android:name="android.intent.category.LAUNCHER"/>
25+
</intent-filter>
26+
</activity>
27+
28+
<!-- Don't delete the meta-data below.
29+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
30+
<meta-data
31+
android:name="flutterEmbedding"
32+
android:value="2" />
33+
</application>
34+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.example.integrationtestapp
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity()
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="passage_auth_origin">YOUR_AUTH_ORIGIN</string>
4+
<string name="asset_statements">
5+
[{
6+
\"include\": \"https://@string/passage_auth_origin/.well-known/assetlinks.json\"
7+
}]
8+
</string>
9+
</resources>
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
buildscript {
2+
ext.kotlin_version = '1.7.10'
3+
repositories {
4+
google()
5+
mavenCentral()
6+
}
7+
8+
dependencies {
9+
classpath 'com.android.tools.build:gradle:7.3.0'
10+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11+
}
12+
}
13+
14+
allprojects {
15+
repositories {
16+
google()
17+
mavenCentral()
18+
}
19+
}
20+
21+
rootProject.buildDir = '../build'
22+
subprojects {
23+
project.buildDir = "${rootProject.buildDir}/${project.name}"
24+
}
25+
subprojects {
26+
project.evaluationDependsOn(':app')
27+
}
28+
29+
tasks.register("clean", Delete) {
30+
delete rootProject.buildDir
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
2+
android.useAndroidX=true
3+
android.enableJetifier=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
9+
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11+
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
18+
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.3.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
23+
}
24+
25+
include ":app"

0 commit comments

Comments
 (0)