-
Notifications
You must be signed in to change notification settings - Fork 12
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
Remove delegates #18
Remove delegates #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment
import Orders | ||
|
||
final class OrderData: OrderDataModel, @unchecked Sendable { | ||
static let schema = "order_data" | ||
|
||
static let typeIdentifier = Environment.get("ORDER_TYPE_IDENTIFIER")! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this best practice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I prefer not to hard code it so as not to leak it into version control, just to be safe. It's not actually strictly secret, so you might as well hard code it.
PassDataModel
andOrderDataModel
PassDataModel
andOrderDataModel
Made data models generic parameters of services
Now
PassesService
andOrdersService
require respectivelyPassDataModel
andOrderDataModel
as generic parameters (until now the data model protocols were basically useless).That means that the user must create a service for each data model; the reason is explained in the next paragraph
Eliminate a possible error with signing passes/orders
PassDataModel
andOrderDataModel
now also require atypeIdentifier
static property.Each certificate Apple gives is related to a type identifier, and should only sign passes/orders of that type identifier.
Until now it was possible to sign passes and orders of different type identifiers with the same service (and therefore the same certificate).
Now each service has a single data model as a generic parameter, so this error is impossible