Make all types public

This commit is contained in:
Christoph Hagen 2022-06-05 12:10:38 +02:00
parent bc5954a969
commit 2680ed54a3
7 changed files with 11 additions and 36 deletions

View File

@ -6,7 +6,7 @@ import Foundation
This structure contains the content of the notification, as well as all data to send the notification to one or more recipients. This structure contains the content of the notification, as well as all data to send the notification to one or more recipients.
The message contains the authorization of the sender as well. The message contains the authorization of the sender as well.
*/ */
struct AuthenticatedPushMessage { public struct AuthenticatedPushMessage: Codable {
/// The device sending the message /// The device sending the message
let sender: DeviceAuthentication let sender: DeviceAuthentication
@ -15,7 +15,3 @@ struct AuthenticatedPushMessage {
let message: PushMessage let message: PushMessage
} }
extension AuthenticatedPushMessage: Codable {
}

View File

@ -3,7 +3,7 @@ import Foundation
/** /**
An object to store the necessary information to authenticate a device to the server. An object to store the necessary information to authenticate a device to the server.
*/ */
struct DeviceAuthentication { public struct DeviceAuthentication: Codable {
/** /**
The push token of the device. The push token of the device.
@ -20,7 +20,3 @@ struct DeviceAuthentication {
let authentication: AuthenticationToken let authentication: AuthenticationToken
} }
extension DeviceAuthentication: Codable {
}

View File

@ -5,7 +5,7 @@ import Foundation
- Note: There is a potential security risk here: Capturing this message and retransmitting it to the `confirm` route can approve previously rejected devices if they register again with the same push token. A timestamp, counter, or nonce can prevent this. - Note: There is a potential security risk here: Capturing this message and retransmitting it to the `confirm` route can approve previously rejected devices if they register again with the same push token. A timestamp, counter, or nonce can prevent this.
*/ */
struct DeviceDecision { public struct DeviceDecision: Codable {
/// The push token of the approved or rejected device. /// The push token of the approved or rejected device.
let pushToken: PushToken let pushToken: PushToken
@ -13,7 +13,3 @@ struct DeviceDecision {
/// The hash of the master key to authenticate the request. /// The hash of the master key to authenticate the request.
let masterKeyHash: Data let masterKeyHash: Data
} }
extension DeviceDecision: Codable {
}

View File

@ -3,7 +3,7 @@ import Foundation
/** /**
An object containing the information required to issue a registration request to the server. An object containing the information required to issue a registration request to the server.
*/ */
struct DeviceRegistration { public struct DeviceRegistration: Codable {
/// The push token of the registering device /// The push token of the registering device
let pushToken: PushToken let pushToken: PushToken
@ -18,7 +18,3 @@ struct DeviceRegistration {
*/ */
let name: String let name: String
} }
extension DeviceRegistration: Codable {
}

View File

@ -3,7 +3,7 @@ import Foundation
/** /**
An object to update the push token of a device. An object to update the push token of a device.
*/ */
struct PushTokenUpdate { public struct PushTokenUpdate: Codable {
/// The authentication of the requesting device. /// The authentication of the requesting device.
let device: DeviceAuthentication let device: DeviceAuthentication
@ -11,7 +11,3 @@ struct PushTokenUpdate {
/// The new push token to register /// The new push token to register
let newToken: PushToken let newToken: PushToken
} }
extension PushTokenUpdate: Codable {
}

View File

@ -5,7 +5,7 @@ import Foundation
The raw values of the cases represent the path to the route. The raw values of the cases represent the path to the route.
*/ */
enum Route: String { public enum Route: String {
/** /**
Register a device for push notifications. Register a device for push notifications.
@ -105,23 +105,23 @@ enum Route: String {
Push tokens are created when a device registers with the Apple Push Notification Service (APNS). The tokens act as identifiers to transmit push notifications to devices. The server uses the unique push tokens to identify devices and assign them to applications. Push tokens are created when a device registers with the Apple Push Notification Service (APNS). The tokens act as identifiers to transmit push notifications to devices. The server uses the unique push tokens to identify devices and assign them to applications.
*/ */
typealias PushToken = Data public typealias PushToken = Data
/** /**
An authentication token of a device. An authentication token of a device.
These tokens are created by the server during device registration, and used for all subsequent requests in combination with the push token. These tokens are created by the server during device registration, and used for all subsequent requests in combination with the push token.
*/ */
typealias AuthenticationToken = Data public typealias AuthenticationToken = Data
/** /**
The name of an application. The name of an application.
The push server can simultaneously handle multiple applications, which are identified by a unique string. Applications can require confirmation of new device registrations by the administrator. The server configuration also specifies if applications allow the retrieval of device lists for all registered devices, to directly send push notifications to the participants. The push server can simultaneously handle multiple applications, which are identified by a unique string. Applications can require confirmation of new device registrations by the administrator. The server configuration also specifies if applications allow the retrieval of device lists for all registered devices, to directly send push notifications to the participants.
*/ */
typealias ApplicationId = String public typealias ApplicationId = String
/** /**
The SHA256 hash of the master key with a salt. The SHA256 hash of the master key with a salt.
*/ */
typealias MasterKeyHash = Data public typealias MasterKeyHash = Data

View File

@ -6,7 +6,7 @@ import Foundation
This structure contains the content of the notification, as well as all data to send the notification to one or more recipients. This structure contains the content of the notification, as well as all data to send the notification to one or more recipients.
*/ */
struct PushMessage { public struct PushMessage: Codable {
/** /**
A list of push tokens for all recipients of the message A list of push tokens for all recipients of the message
*/ */
@ -57,11 +57,6 @@ struct PushMessage {
let topic: String? let topic: String?
} }
extension PushMessage: Codable {
}
extension APNSwiftConnection.PushType: Codable { extension APNSwiftConnection.PushType: Codable {
} }