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

feat(app-check): support static debug token on web #810

Merged

Conversation

eljass
Copy link
Contributor

@eljass eljass commented Jan 27, 2025

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).
  • I have read and followed the pull request guidelines.

Adds support to include static debug token within web App Check initialization. This can be used with CI and/or during development.

Refers to: #808

@eljass
Copy link
Contributor Author

eljass commented Jan 27, 2025

Sorry for commit message mess. Tried to squash these to single one, but seems to have failed to do so. I think this can be merged with "squash and merge" to remove unnecessary commits from the history.

@robingenz
Copy link
Member

Thank you. I'm currently working on the update to Capacitor 7. I will soon take a look at your PR.

packages/app-check/src/definitions.ts Outdated Show resolved Hide resolved
@eljass eljass requested a review from robingenz February 3, 2025 15:17
Comment on lines 54 to 55
String debugTokenString = call.getString("debugToken", "");
hasDebugToken = debugTokenString != null && !debugTokenString.isEmpty();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
String debugTokenString = call.getString("debugToken", "");
hasDebugToken = debugTokenString != null && !debugTokenString.isEmpty();
String debugTokenString = call.getString("debugToken");
hasDebugToken = debugTokenString != null;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you match the empty string then? In web it is seen as falsy, but in this case in Android code debugTokenString != null will return as true if debugToken option is set to "".

packages/app-check/src/web.ts Show resolved Hide resolved
.changeset/fast-goats-pull.md Outdated Show resolved Hide resolved
@eljass eljass requested a review from robingenz February 4, 2025 09:39
robingenz
robingenz previously approved these changes Feb 4, 2025
@robingenz
Copy link
Member

@eljass Please fix the failed workflow.

Copy link

pkg-pr-new bot commented Feb 4, 2025

Open in Stackblitz

@capacitor-firebase/analytics

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/analytics@810

@capacitor-firebase/app

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app@810

@capacitor-firebase/app-check

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app-check@810

@capacitor-firebase/authentication

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/authentication@810

@capacitor-firebase/crashlytics

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/crashlytics@810

@capacitor-firebase/firestore

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/firestore@810

@capacitor-firebase/functions

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/functions@810

@capacitor-firebase/messaging

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/messaging@810

@capacitor-firebase/performance

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/performance@810

@capacitor-firebase/remote-config

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/remote-config@810

@capacitor-firebase/storage

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/storage@810

commit: 8ff6f10

@robingenz robingenz merged commit 22bf3b5 into capawesome-team:main Feb 4, 2025
4 checks passed
@robingenz
Copy link
Member

Thank you! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants