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

Version 0.4.0 #8

Merged
merged 27 commits into from
Jul 1, 2024
Merged

Version 0.4.0 #8

merged 27 commits into from
Jul 1, 2024

Conversation

fpseverino
Copy link
Member

@fpseverino fpseverino commented Jun 26, 2024

  • Fix an issue in the PKErrorLog model, where the created_at FieldKey didn't coincide in the model and in the migration.
  • Make authenticationToken unique for each pass, as requested by the Wallet documentation, improving security.
  • Create a new target PassKit for the types shared between the Passes and the upcoming Orders modules.
  • Rename multiple structs and protocols to better represent what they are.
  • Add PassJSON protocol to help build the pass.json.
  • Start work on the Orders target.

@fpseverino fpseverino requested review from gwynne and 0xTim June 26, 2024 15:28
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 276 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (99fa653) to head (6e6c69f).
Report is 3 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main      #8   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         11      27   +16     
  Lines        517     614   +97     
=====================================
- Misses       517     614   +97     
Files Coverage Δ
Sources/PassKit/Models/DeviceModel.swift 0.00% <ø> (ø)
Sources/PassKit/Models/ErrorLogModel.swift 0.00% <ø> (ø)
Sources/Passes/Models/PassDataModel.swift 0.00% <ø> (ø)
...ources/Passes/Models/PassesRegistrationModel.swift 0.00% <ø> (ø)
Sources/Passes/PassesDelegate.swift 0.00% <ø> (ø)
Sources/PassKit/URL+Extension.swift 0.00% <0.00%> (ø)
Sources/Orders/DTOs/OrdersForDeviceDTO.swift 0.00% <0.00%> (ø)
Sources/Orders/Models/OrderDataModel.swift 0.00% <0.00%> (ø)
...ources/Passes/Middleware/ApplePassMiddleware.swift 0.00% <0.00%> (ø)
Sources/Passes/Models/PassModel.swift 0.00% <0.00%> (ø)
... and 16 more

@fpseverino fpseverino requested a review from ptoffy June 27, 2024 15:27
@fpseverino fpseverino changed the title Fix issue with model FieldKeys Fix issue and rename types Jun 27, 2024
@fpseverino fpseverino changed the title Fix issue and rename types Version 0.4.0 Jun 28, 2024
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

One comment, nothing outstanding

Sources/PassKit/FakeSendable.swift Outdated Show resolved Hide resolved
@fpseverino fpseverino merged commit 65ff989 into vapor-community:main Jul 1, 2024
9 of 10 checks passed
@fpseverino fpseverino deleted the update branch July 1, 2024 12:42
Copy link
Member

@ptoffy ptoffy left a comment

Choose a reason for hiding this comment

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

I know this was merged in already but wanted to voice my concerns. Also, tests?

// Created by Francesco Paolo Severino on 30/06/24.
//

public enum OrdersError: Error {
Copy link
Member

Choose a reason for hiding this comment

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

Before you release the major version this should be hidden behind a struct as in https://github.com/vapor/jwt-kit/blob/main/Sources/JWTKit/JWTError.swift IMO as adding/removing cases to this (which is likely) is source breaking and requires a new major release

}

/// The type of transit for a boarding pass.
public enum TransitType: String, Encodable {
Copy link
Member

Choose a reason for hiding this comment

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

As above

}

/// The format of the barcode.
public enum BarcodeFormat: String, Encodable {
Copy link
Member

Choose a reason for hiding this comment

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

As above

import Foundation

public enum PassKitError: Error {
public enum PassesError: Error {
Copy link
Member

Choose a reason for hiding this comment

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

As above

var _$order: Parent<OrderType> {
guard let mirror = Mirror(reflecting: self).descendant("_order"),
let order = mirror as? Parent<OrderType> else {
fatalError("order property must be declared using @Parent")
Copy link
Member

Choose a reason for hiding this comment

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

Not a big fan of these fatalErrors honestly

Copy link
Member Author

Choose a reason for hiding this comment

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

What could I replace them with? In most cases I cannot make these properties optional

Copy link
Member

@ptoffy ptoffy Jul 1, 2024

Choose a reason for hiding this comment

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

Throwing custom Errors which can be caught (and debugged) and don't just crash the app

@fpseverino
Copy link
Member Author

I know this was merged in already but wanted to voice my concerns. Also, tests?

Thanks for the feedback Paul!
I'll add tests for bundle signing, but for updating passes and orders I think a real device is needed.

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

Successfully merging this pull request may close these issues.

3 participants