diff --git a/Sources/PushAPI/AdminRequest.swift b/Sources/PushAPI/AdminRequest.swift index fa6b1c8..db79124 100644 --- a/Sources/PushAPI/AdminRequest.swift +++ b/Sources/PushAPI/AdminRequest.swift @@ -10,4 +10,14 @@ public struct AdminRequest: Codable { /// The application id with which the request is associated public let application: ApplicationId + + /** + Create a new admin request. + - Parameter keyHash: The SHA256 hash of the admin key + - Parameter application: The application id for the request. + */ + public init(keyHash: Data, application: ApplicationId) { + self.keyHash = keyHash + self.application = application + } } diff --git a/Sources/PushAPI/Push.swift b/Sources/PushAPI/Push.swift index 2c86645..85c0fb5 100644 --- a/Sources/PushAPI/Push.swift +++ b/Sources/PushAPI/Push.swift @@ -30,7 +30,7 @@ public enum Route: String { Get a list of unapproved devices for review. * HTTP Method: `POST` - * HTTP Body: The binary SHA256 hash of the master key using the custom salt + * HTTP Body: An `AdminRequest` JSON object with the SHA256 hash of the admin key and the application id * Response: An array of `DeviceRegistration` elements encoded in JSON. `401` if the master key is incorrect. */ case listUnapprovedDevices = "check"