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

Apple Pass integration #6248

Merged
merged 79 commits into from
May 30, 2024

Conversation

openprojects
Copy link
Contributor

@openprojects openprojects commented Mar 26, 2024

@github-actions github-actions bot added dependencies Pull requests that update a dependency file python Pull requests that update Python deps alembic Contains database changes labels Mar 26, 2024
@openprojects openprojects marked this pull request as draft March 26, 2024 14:01
indico/modules/categories/forms.py Show resolved Hide resolved
docs/source/config/settings.rst Outdated Show resolved Hide resolved
@openprojects
Copy link
Contributor Author

Hi @ThiefMaster , can you please stop reviewing this PR? It is marked in DRAFT and I explicitly required @OmeGak to review it.
Thank you.

@ThiefMaster
Copy link
Member

Don't worry, I did not plan to go more in-depth, but those are things I noticed immediately while skimming over it.

Copy link
Member

@OmeGak OmeGak left a comment

Choose a reason for hiding this comment

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

Towards the end of my review I realized that Apple has stopped publicly using the term "Apple Pass" in favor of "Pass for Apple Wallet". I would suggest that we stick to this name for all variable and setting names in the code (e.g. apple_wallet). The benefit is that both Google and Apple wallet related code will share the _wallet suffix, making it more explicit that they are very closely related.

Besides this, please note that there a couple of issues with header checks.

docs/source/config/settings.rst Outdated Show resolved Hide resolved
docs/source/config/settings.rst Outdated Show resolved Hide resolved
indico/modules/categories/forms.py Outdated Show resolved Hide resolved
indico/modules/events/registration/controllers/display.py Outdated Show resolved Hide resolved
indico/modules/events/registration/controllers/display.py Outdated Show resolved Hide resolved
indico/modules/events/registration/forms.py Outdated Show resolved Hide resolved
indico/modules/events/registration/forms.py Outdated Show resolved Hide resolved
indico/modules/events/registration/apple_pass.py Outdated Show resolved Hide resolved
@openprojects
Copy link
Contributor Author

Towards the end of my review I realized that Apple has stopped publicly using the term "Apple Pass" in favor of "Pass for Apple Wallet". I would suggest that we stick to this name for all variable and setting names in the code (e.g. apple_wallet). The benefit is that both Google and Apple wallet related code will share the _wallet suffix, making it more explicit that they are very closely related.

Besides this, please note that there a couple of issues with header checks.

I did a quick search about that, and it looks to me that the name Pass still indicates the object created, and Wallet the software to keep/display the passes.
What we are generating in Indico is a Pass, not a Wallet:

https://developer.apple.com/documentation/walletpasses

@ThiefMaster
Copy link
Member

I did a quick search about that, and it looks to me that the name Pass still indicates the object created, and Wallet the software to keep/display the passes.
What we are generating in Indico is a Pass, not a Wallet

I think there's still lots of value in using similar terminology in the codebase, ie google_wallet_whatever and apple_wallet_whatever. That way one can easily search for _wallet_whatever to find code that's likely applicable for both places (but too different to be reused).

@openprojects openprojects force-pushed the Add-Apple-Wallet-integration branch 2 times, most recently from 26d750b to 2dd748a Compare April 8, 2024 08:34
@openprojects
Copy link
Contributor Author

I'll squash all the single commits AFTER the whole review process is completed.

@ThiefMaster
Copy link
Member

No need to squash since you do not have merge commits int here :) We'll squash+merge at the end anyway (same like in the google wallet PR and most other PRs), so the individual commits in the PR are perfectly fine to leave around.

Copy link
Member

@OmeGak OmeGak left a comment

Choose a reason for hiding this comment

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

Following @ThiefMaster, let's make sure to rename all apple_pass_whatever variable names to `apple_wallet_whatever.

@openprojects
Copy link
Contributor Author

Following @ThiefMaster, let's make sure to rename all apple_pass_whatever variable names to `apple_wallet_whatever.

Done.

@bpedersen2
Copy link
Contributor

Just as a hint: pkpass support is not restricted to Apple, on Android e.g.the walletpasses app (check walletpasses.io) happily ingests them as well. So when presenting things to users, keep that in mind.

@openprojects openprojects marked this pull request as ready for review April 15, 2024 13:54
@OmeGak
Copy link
Member

OmeGak commented Apr 15, 2024

@ThiefMaster, feel free to go ahead with your review. Most of my comments were already resolved. Some of the outstanding ones would help your feedback still.

@bpedersen2
Copy link
Contributor

I am a bit unsure if storing signing keys and their password in the same database is something that is good security practice. I would have made those per-instance fields that are configure in the config file only.

@ThiefMaster
Copy link
Member

This is just Apple being Apple. The fact that those passbook files even NEED to be signed is kind of ridiculous. And we want to have this configurable by category, and requiring this go go through indico.conf would not scale.

FWIW, the cleanest option would be some kind of "set credentials" UI that would be write-only, instead of integrating this in the general settings form. Might still be a good idea at a later point (for both the Google and Apple credentials). But overkill for the initial version (even more so while this is gated behind a feature flag in indico.conf).

@openprojects openprojects changed the title Apple Pass integration - DRAFT Apple Pass integration May 14, 2024
openprojects and others added 25 commits May 30, 2024 11:57
Co-authored-by: Adrian <adrian@planetcoding.net>
Co-authored-by: Adrian <adrian@planetcoding.net>
Co-authored-by: Adrian <adrian@planetcoding.net>
Co-authored-by: Adrian <adrian@planetcoding.net>
Also improve field labels/descriptions
We always pass a loaded cert object and never a string there
This is just to make it easier to compare it with the google one to see
that they are indeed very similar
It's a no-op when it's reassigned the same value, but it feels cleaner
that way
This is the standard abbrevisation we use everywhere else
@ThiefMaster ThiefMaster force-pushed the Add-Apple-Wallet-integration branch from a35e120 to fdd7300 Compare May 30, 2024 09:58
@ThiefMaster ThiefMaster enabled auto-merge (squash) May 30, 2024 10:33
@ThiefMaster ThiefMaster merged commit 466e876 into indico:master May 30, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alembic Contains database changes dependencies Pull requests that update a dependency file python Pull requests that update Python deps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants