Skip to content

Commit

Permalink
feat(auth, windows): add Windows support to auth plugin (#11089)
Browse files Browse the repository at this point in the history
* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels END Auth

* feat(auth): move to Pigeon for Platform channels START user

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat(auth): move to Pigeon for Platform channels

* feat: start objc

* feat: ios

* feat: ios

* feat: ios

* feat: ios

* feat: ios

* feat: ios

* feat: ios

* feat: ios

* feat: ios

* feat: ios

* feat: ios done

* feat: ios done

* remove test code from demo

* fix codes

* fix codes

* fix codes

* feat: update web

* feat: update tests

* fix tests

* add licence

* fix analyze

* fix analyze

* fix pod projects

* fix macos

* fix macos

* fix format

* fix ci

* remove useless file

* fix ios crash

* swift 5.6

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix ci

* fix ci

* fix android

* fix format

* fix format

* XL runner??

* Update packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseMultiFactor.java

Co-authored-by: Russell Wheatley <russellwheatley85@gmail.com>

* Update packages/firebase_auth/firebase_auth/ios/Classes/FLTFirebaseAuthPlugin.m

Co-authored-by: Russell Wheatley <russellwheatley85@gmail.com>

* remove useless code and apply suggestions from review

* remove useless code and apply suggestions from review

* add windows example app

* base project

* add generated pigeon for windows

* add generated pigeon for windows

* change name for interfaces

* update pigeon to 10.0.0

* import firebase in windows

* reorder

* reorder

* signInAnonymously

* sign in anonymously

* sharing app instance

* sharing instance

* hardcoded anonymously signin

* more functions

* implement functions

* last functions

* idtoken listener

* eventchannel

* event channel

* binaryMessenger

* it works

* formatting

* linking

* update windows

* update windows version

* URL

* prepare CI

* wrong error message

* error codes

* remove tests windows

* formlat

* feat: update pigeon

* working on emulator :D

* change tests

* fix generation

* format

* working

* auth

* update tests

* skipping tests

* new version of the SDK

* remove xl

* format

* update pigeon

* format

* test passed

* change

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* throwing on unimplements

* format

---------

Co-authored-by: Russell Wheatley <russellwheatley85@gmail.com>
  • Loading branch information
Lyokone and russellwheatley committed Sep 12, 2023
1 parent 4e9bb69 commit 0cedfc8
Show file tree
Hide file tree
Showing 52 changed files with 9,424 additions and 365 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ jobs:
timeout-minutes: 45
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2
with:
distribution: 'temurin'
java-version: '11'
- uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8
name: Install Node.js 16
with:
Expand All @@ -316,9 +320,5 @@ jobs:
- name: "Install Tools"
run: |
npm install -g firebase-tools
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
working-directory: tests
run: |
flutter test .\integration_test\e2e_test.dart -d windows
- name: Start Firebase Emulator and run tests
run: cd ./.github/workflows/scripts && firebase emulators:exec --project flutterfire-e2e-tests "cd ../../../tests && flutter test .\integration_test\e2e_test.dart -d windows"
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Copyright 2023, the Chromium project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*/

// Autogenerated from Pigeon (v10.1.6), do not edit directly.
// Copyright 2023, the Chromium project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Autogenerated from Pigeon (v11.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon

package io.flutter.plugins.firebase.auth;
Expand Down Expand Up @@ -411,81 +408,6 @@ ArrayList<Object> toList() {
}
}

/** Generated class from Pigeon that represents data sent in messages. */
public static final class PigeonActionCodeInfo {
private @NonNull ActionCodeInfoOperation operation;

public @NonNull ActionCodeInfoOperation getOperation() {
return operation;
}

public void setOperation(@NonNull ActionCodeInfoOperation setterArg) {
if (setterArg == null) {
throw new IllegalStateException("Nonnull field \"operation\" is null.");
}
this.operation = setterArg;
}

private @NonNull PigeonActionCodeInfoData data;

public @NonNull PigeonActionCodeInfoData getData() {
return data;
}

public void setData(@NonNull PigeonActionCodeInfoData setterArg) {
if (setterArg == null) {
throw new IllegalStateException("Nonnull field \"data\" is null.");
}
this.data = setterArg;
}

/** Constructor is non-public to enforce null safety; use Builder. */
PigeonActionCodeInfo() {}

public static final class Builder {

private @Nullable ActionCodeInfoOperation operation;

public @NonNull Builder setOperation(@NonNull ActionCodeInfoOperation setterArg) {
this.operation = setterArg;
return this;
}

private @Nullable PigeonActionCodeInfoData data;

public @NonNull Builder setData(@NonNull PigeonActionCodeInfoData setterArg) {
this.data = setterArg;
return this;
}

public @NonNull PigeonActionCodeInfo build() {
PigeonActionCodeInfo pigeonReturn = new PigeonActionCodeInfo();
pigeonReturn.setOperation(operation);
pigeonReturn.setData(data);
return pigeonReturn;
}
}

@NonNull
ArrayList<Object> toList() {
ArrayList<Object> toListResult = new ArrayList<Object>(2);
toListResult.add(operation == null ? null : operation.index);
toListResult.add((data == null) ? null : data.toList());
return toListResult;
}

static @NonNull PigeonActionCodeInfo fromList(@NonNull ArrayList<Object> list) {
PigeonActionCodeInfo pigeonResult = new PigeonActionCodeInfo();
Object operation = list.get(0);
pigeonResult.setOperation(
operation == null ? null : ActionCodeInfoOperation.values()[(int) operation]);
Object data = list.get(1);
pigeonResult.setData(
(data == null) ? null : PigeonActionCodeInfoData.fromList((ArrayList<Object>) data));
return pigeonResult;
}
}

/** Generated class from Pigeon that represents data sent in messages. */
public static final class PigeonActionCodeInfoData {
private @Nullable String email;
Expand Down Expand Up @@ -551,93 +473,75 @@ ArrayList<Object> toList() {
}

/** Generated class from Pigeon that represents data sent in messages. */
public static final class PigeonUserCredential {
private @Nullable PigeonUserDetails user;
public static final class PigeonActionCodeInfo {
private @NonNull ActionCodeInfoOperation operation;

public @Nullable PigeonUserDetails getUser() {
return user;
public @NonNull ActionCodeInfoOperation getOperation() {
return operation;
}

public void setUser(@Nullable PigeonUserDetails setterArg) {
this.user = setterArg;
public void setOperation(@NonNull ActionCodeInfoOperation setterArg) {
if (setterArg == null) {
throw new IllegalStateException("Nonnull field \"operation\" is null.");
}
this.operation = setterArg;
}

private @Nullable PigeonAdditionalUserInfo additionalUserInfo;

public @Nullable PigeonAdditionalUserInfo getAdditionalUserInfo() {
return additionalUserInfo;
}
private @NonNull PigeonActionCodeInfoData data;

public void setAdditionalUserInfo(@Nullable PigeonAdditionalUserInfo setterArg) {
this.additionalUserInfo = setterArg;
public @NonNull PigeonActionCodeInfoData getData() {
return data;
}

private @Nullable PigeonAuthCredential credential;

public @Nullable PigeonAuthCredential getCredential() {
return credential;
public void setData(@NonNull PigeonActionCodeInfoData setterArg) {
if (setterArg == null) {
throw new IllegalStateException("Nonnull field \"data\" is null.");
}
this.data = setterArg;
}

public void setCredential(@Nullable PigeonAuthCredential setterArg) {
this.credential = setterArg;
}
/** Constructor is non-public to enforce null safety; use Builder. */
PigeonActionCodeInfo() {}

public static final class Builder {

private @Nullable PigeonUserDetails user;

public @NonNull Builder setUser(@Nullable PigeonUserDetails setterArg) {
this.user = setterArg;
return this;
}

private @Nullable PigeonAdditionalUserInfo additionalUserInfo;
private @Nullable ActionCodeInfoOperation operation;

public @NonNull Builder setAdditionalUserInfo(@Nullable PigeonAdditionalUserInfo setterArg) {
this.additionalUserInfo = setterArg;
public @NonNull Builder setOperation(@NonNull ActionCodeInfoOperation setterArg) {
this.operation = setterArg;
return this;
}

private @Nullable PigeonAuthCredential credential;
private @Nullable PigeonActionCodeInfoData data;

public @NonNull Builder setCredential(@Nullable PigeonAuthCredential setterArg) {
this.credential = setterArg;
public @NonNull Builder setData(@NonNull PigeonActionCodeInfoData setterArg) {
this.data = setterArg;
return this;
}

public @NonNull PigeonUserCredential build() {
PigeonUserCredential pigeonReturn = new PigeonUserCredential();
pigeonReturn.setUser(user);
pigeonReturn.setAdditionalUserInfo(additionalUserInfo);
pigeonReturn.setCredential(credential);
public @NonNull PigeonActionCodeInfo build() {
PigeonActionCodeInfo pigeonReturn = new PigeonActionCodeInfo();
pigeonReturn.setOperation(operation);
pigeonReturn.setData(data);
return pigeonReturn;
}
}

@NonNull
ArrayList<Object> toList() {
ArrayList<Object> toListResult = new ArrayList<Object>(3);
toListResult.add((user == null) ? null : user.toList());
toListResult.add((additionalUserInfo == null) ? null : additionalUserInfo.toList());
toListResult.add((credential == null) ? null : credential.toList());
ArrayList<Object> toListResult = new ArrayList<Object>(2);
toListResult.add(operation == null ? null : operation.index);
toListResult.add((data == null) ? null : data.toList());
return toListResult;
}

static @NonNull PigeonUserCredential fromList(@NonNull ArrayList<Object> list) {
PigeonUserCredential pigeonResult = new PigeonUserCredential();
Object user = list.get(0);
pigeonResult.setUser(
(user == null) ? null : PigeonUserDetails.fromList((ArrayList<Object>) user));
Object additionalUserInfo = list.get(1);
pigeonResult.setAdditionalUserInfo(
(additionalUserInfo == null)
? null
: PigeonAdditionalUserInfo.fromList((ArrayList<Object>) additionalUserInfo));
Object credential = list.get(2);
pigeonResult.setCredential(
(credential == null)
? null
: PigeonAuthCredential.fromList((ArrayList<Object>) credential));
static @NonNull PigeonActionCodeInfo fromList(@NonNull ArrayList<Object> list) {
PigeonActionCodeInfo pigeonResult = new PigeonActionCodeInfo();
Object operation = list.get(0);
pigeonResult.setOperation(ActionCodeInfoOperation.values()[(int) operation]);
Object data = list.get(1);
pigeonResult.setData(
(data == null) ? null : PigeonActionCodeInfoData.fromList((ArrayList<Object>) data));
return pigeonResult;
}
}
Expand Down Expand Up @@ -1266,6 +1170,98 @@ ArrayList<Object> toList() {
}
}

/** Generated class from Pigeon that represents data sent in messages. */
public static final class PigeonUserCredential {
private @Nullable PigeonUserDetails user;

public @Nullable PigeonUserDetails getUser() {
return user;
}

public void setUser(@Nullable PigeonUserDetails setterArg) {
this.user = setterArg;
}

private @Nullable PigeonAdditionalUserInfo additionalUserInfo;

public @Nullable PigeonAdditionalUserInfo getAdditionalUserInfo() {
return additionalUserInfo;
}

public void setAdditionalUserInfo(@Nullable PigeonAdditionalUserInfo setterArg) {
this.additionalUserInfo = setterArg;
}

private @Nullable PigeonAuthCredential credential;

public @Nullable PigeonAuthCredential getCredential() {
return credential;
}

public void setCredential(@Nullable PigeonAuthCredential setterArg) {
this.credential = setterArg;
}

public static final class Builder {

private @Nullable PigeonUserDetails user;

public @NonNull Builder setUser(@Nullable PigeonUserDetails setterArg) {
this.user = setterArg;
return this;
}

private @Nullable PigeonAdditionalUserInfo additionalUserInfo;

public @NonNull Builder setAdditionalUserInfo(@Nullable PigeonAdditionalUserInfo setterArg) {
this.additionalUserInfo = setterArg;
return this;
}

private @Nullable PigeonAuthCredential credential;

public @NonNull Builder setCredential(@Nullable PigeonAuthCredential setterArg) {
this.credential = setterArg;
return this;
}

public @NonNull PigeonUserCredential build() {
PigeonUserCredential pigeonReturn = new PigeonUserCredential();
pigeonReturn.setUser(user);
pigeonReturn.setAdditionalUserInfo(additionalUserInfo);
pigeonReturn.setCredential(credential);
return pigeonReturn;
}
}

@NonNull
ArrayList<Object> toList() {
ArrayList<Object> toListResult = new ArrayList<Object>(3);
toListResult.add((user == null) ? null : user.toList());
toListResult.add((additionalUserInfo == null) ? null : additionalUserInfo.toList());
toListResult.add((credential == null) ? null : credential.toList());
return toListResult;
}

static @NonNull PigeonUserCredential fromList(@NonNull ArrayList<Object> list) {
PigeonUserCredential pigeonResult = new PigeonUserCredential();
Object user = list.get(0);
pigeonResult.setUser(
(user == null) ? null : PigeonUserDetails.fromList((ArrayList<Object>) user));
Object additionalUserInfo = list.get(1);
pigeonResult.setAdditionalUserInfo(
(additionalUserInfo == null)
? null
: PigeonAdditionalUserInfo.fromList((ArrayList<Object>) additionalUserInfo));
Object credential = list.get(2);
pigeonResult.setCredential(
(credential == null)
? null
: PigeonAuthCredential.fromList((ArrayList<Object>) credential));
return pigeonResult;
}
}

/** Generated class from Pigeon that represents data sent in messages. */
public static final class PigeonActionCodeSettings {
private @NonNull String url;
Expand Down Expand Up @@ -4487,7 +4483,7 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) {
*/
public interface GenerateInterfaces {

void generateInterfaces(@NonNull PigeonMultiFactorInfo info);
void pigeonInterface(@NonNull PigeonMultiFactorInfo info);

/** The codec used by GenerateInterfaces. */
static @NonNull MessageCodec<Object> getCodec() {
Expand All @@ -4501,7 +4497,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable GenerateIn
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger,
"dev.flutter.pigeon.firebase_auth_platform_interface.GenerateInterfaces.generateInterfaces",
"dev.flutter.pigeon.firebase_auth_platform_interface.GenerateInterfaces.pigeonInterface",
getCodec());
if (api != null) {
channel.setMessageHandler(
Expand All @@ -4510,7 +4506,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable GenerateIn
ArrayList<Object> args = (ArrayList<Object>) message;
PigeonMultiFactorInfo infoArg = (PigeonMultiFactorInfo) args.get(0);
try {
api.generateInterfaces(infoArg);
api.pigeonInterface(infoArg);
wrapped.add(0, null);
} catch (Throwable exception) {
ArrayList<Object> wrappedError = wrapError(exception);
Expand Down
Loading

0 comments on commit 0cedfc8

Please sign in to comment.