Skip to content

Commit 63c37c3

Browse files
Updated RFC links to be easier to read
1 parent 5232055 commit 63c37c3

10 files changed

+33
-33
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,13 @@ import WebPushTesting
416416
417417
## Specifications
418418
419-
- [RFC 6454 The Web Origin Concept](https://datatracker.ietf.org/doc/html/rfc6454)
420-
- [RFC 7515 JSON Web Signature (JWS)](https://datatracker.ietf.org/doc/html/rfc7515)
421-
- [RFC 7519 JSON Web Token (JWT)](https://datatracker.ietf.org/doc/html/rfc7519)
422-
- [RFC 8030 Generic Event Delivery Using HTTP Push](https://datatracker.ietf.org/doc/html/rfc8030)
423-
- [RFC 8188 Encrypted Content-Encoding for HTTP](https://datatracker.ietf.org/doc/html/rfc8188)
424-
- [RFC 8291 Message Encryption for Web Push](https://datatracker.ietf.org/doc/html/rfc8291)
425-
- [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push](https://datatracker.ietf.org/doc/html/rfc8292)
419+
- [RFC 6454 The Web Origin Concept](https://datatracker.ietf.org/doc/html/rfc6454)
420+
- [RFC 7515 JSON Web Signature (JWS)](https://datatracker.ietf.org/doc/html/rfc7515)
421+
- [RFC 7519 JSON Web Token (JWT)](https://datatracker.ietf.org/doc/html/rfc7519)
422+
- [RFC 8030 Generic Event Delivery Using HTTP Push](https://datatracker.ietf.org/doc/html/rfc8030)
423+
- [RFC 8188 Encrypted Content-Encoding for HTTP](https://datatracker.ietf.org/doc/html/rfc8188)
424+
- [RFC 8291 Message Encryption for Web Push](https://datatracker.ietf.org/doc/html/rfc8291)
425+
- [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push](https://datatracker.ietf.org/doc/html/rfc8292)
426426
427427
428428
- [Push API Working Draft](https://www.w3.org/TR/push-api/)

Sources/WebPush/Errors/PushServiceError.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import Foundation
1111

1212
/// An unknown Push Service error was encountered.
1313
///
14-
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP Push](https://datatracker.ietf.org/doc/html/rfc8030)
15-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push](https://datatracker.ietf.org/doc/html/rfc8292)
14+
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP Push](https://datatracker.ietf.org/doc/html/rfc8030)
15+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push](https://datatracker.ietf.org/doc/html/rfc8292)
1616
/// - SeeAlso: [Sending web push notifications in web apps and browsers — Review responses for push notification errors](https://developer.apple.com/documentation/usernotifications/sending-web-push-notifications-in-web-apps-and-browsers#Review-responses-for-push-notification-errors)
1717
public struct PushServiceError: LocalizedError, Sendable {
1818
/// The HTTP response that was returned from the push service..

Sources/WebPush/Helpers/URL+Origin.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ extension URL {
1313
///
1414
/// This implementation is similar to the [WHATWG Standard](https://url.spec.whatwg.org/#concept-url-origin), except that it uses the unicode form of the host, and is limited to HTTP and HTTPS schemas.
1515
///
16-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
17-
/// - SeeAlso: [RFC6454 The Web Origin Concept §6.1. Unicode Serialization of an Origin](https://datatracker.ietf.org/doc/html/rfc6454#section-6.1)
16+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
17+
/// - SeeAlso: [RFC 6454 — The Web Origin Concept §6.1. Unicode Serialization of an Origin](https://datatracker.ietf.org/doc/html/rfc6454#section-6.1)
1818
var origin: String {
1919
/// Note that we need the unicode variant, which only URLComponents provides.
2020
let components = URLComponents(url: self, resolvingAgainstBaseURL: true)

Sources/WebPush/Subscriber.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public protocol SubscriberProtocol: Sendable {
3131

3232
/// The set of cryptographic secrets shared by the browser (is. user agent) along with a subscription.
3333
///
34-
/// - SeeAlso: [RFC 8291 Message Encryption for Web Push §2.1. Key and Secret Distribution](https://datatracker.ietf.org/doc/html/rfc8291#section-2.1)
34+
/// - SeeAlso: [RFC 8291 Message Encryption for Web Push §2.1. Key and Secret Distribution](https://datatracker.ietf.org/doc/html/rfc8291#section-2.1)
3535
public struct UserAgentKeyMaterial: Sendable {
3636
/// The underlying type of an authentication secret.
3737
public typealias Salt = Data

Sources/WebPush/Topic.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Foundation
1515
///
1616
/// - Important: Since topics are sent in the clear to push services, they must be securely hashed. You must use a stable random value for this, such as the subscriber's ``UserAgentKeyMaterial/authenticationSecret``. This is fine for most applications, though you may wish to use a different key if your application requires it.
1717
///
18-
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP §5.4. Replacing Push Messages](https://datatracker.ietf.org/doc/html/rfc8030#section-5.4)
18+
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP §5.4. Replacing Push Messages](https://datatracker.ietf.org/doc/html/rfc8030#section-5.4)
1919
public struct Topic: Hashable, Sendable, CustomStringConvertible {
2020
/// The topic value to use.
2121
public let topic: String

Sources/WebPush/VAPID/VAPID.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ public typealias VoluntaryApplicationServerIdentification = VAPID
1313

1414
/// A set of types for Voluntary Application Server Identification, also known as VAPID.
1515
///
16-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push](https://datatracker.ietf.org/doc/html/rfc8292)
16+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push](https://datatracker.ietf.org/doc/html/rfc8292)
1717
public enum VAPID: Sendable {}

Sources/WebPush/VAPID/VAPIDConfiguration.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ extension VAPID.Configuration {
214214
/// This allows administrators of push services to contact you should an issue arise with your application server.
215215
///
216216
/// - Note: Although the specification notes that this field is optional, some push services may refuse connection from serers without contact information.
217-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2.1. Application Server Contact Information](https://datatracker.ietf.org/doc/html/rfc8292#section-2.1)
217+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2.1. Application Server Contact Information](https://datatracker.ietf.org/doc/html/rfc8292#section-2.1)
218218
public enum ContactInformation: Hashable, Codable, Sendable {
219219
/// A URL-based contact method, such as a support page on your website.
220220
case url(URL)

Sources/WebPush/VAPID/VAPIDKey.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ extension VAPID.Key: Identifiable {
9898
/// The public key component in a format suitable for user agents to consume.
9999
///
100100
/// - SeeAlso: [Push API Working Draft §7.2. `PushSubscriptionOptions` Interface](https://www.w3.org/TR/push-api/#dom-pushsubscriptionoptions-applicationserverkey)
101-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §3.2. Public Key Parameter ("k")](https://datatracker.ietf.org/doc/html/rfc8292#section-3.2)
101+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §3.2. Public Key Parameter ("k")](https://datatracker.ietf.org/doc/html/rfc8292#section-3.2)
102102
public var id: ID {
103103
ID(privateKey.publicKey.x963Representation.base64URLEncodedString())
104104
}

Sources/WebPush/VAPID/VAPIDToken.swift

+13-13
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import Foundation
1212
extension VAPID {
1313
/// An internal representation the token and authorization headers used self-identification.
1414
///
15-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
16-
/// - SeeAlso: [RFC 7515 JSON Web Signature (JWS)](https://datatracker.ietf.org/doc/html/rfc7515)
17-
///- SeeAlso: [RFC 7519 JSON Web Token (JWT)](https://datatracker.ietf.org/doc/html/rfc7519)
15+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
16+
/// - SeeAlso: [RFC 7515 JSON Web Signature (JWS)](https://datatracker.ietf.org/doc/html/rfc7515)
17+
///- SeeAlso: [RFC 7519 JSON Web Token (JWT)](https://datatracker.ietf.org/doc/html/rfc7519)
1818
struct Token: Hashable, Codable, Sendable {
1919
/// The coding keys used to encode the token.
2020
enum CodingKeys: String, CodingKey {
@@ -26,25 +26,25 @@ extension VAPID {
2626
/// The audience claim, which encodes the origin of the ``Subscriber/endpoint``
2727
///
2828
/// - SeeAlso: ``/Foundation/URL/origin``
29-
/// - SeeAlso: [RFC 7519 JSON Web Token (JWT) §4.1.3. "aud" (Audience) Claim](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3)
30-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
29+
/// - SeeAlso: [RFC 7519 JSON Web Token (JWT) §4.1.3. "aud" (Audience) Claim](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3)
30+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
3131
var audience: String
3232

3333
/// The subject claim, which encodes contact information for the application server.
3434
///
35-
/// - SeeAlso: [RFC 7519 JSON Web Token (JWT) §4.1.2. "sub" (Subject) Claim](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.2)
36-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2.1. Application Server Contact Information](https://datatracker.ietf.org/doc/html/rfc8292#section-2.1)
35+
/// - SeeAlso: [RFC 7519 JSON Web Token (JWT) §4.1.2. "sub" (Subject) Claim](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.2)
36+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2.1. Application Server Contact Information](https://datatracker.ietf.org/doc/html/rfc8292#section-2.1)
3737
var subject: Configuration.ContactInformation
3838

3939
/// The expiry claim, which encodes the number of seconds after 1970/01/01 when the token expires.
4040
///
41-
/// - SeeAlso: [RFC 7519 JSON Web Token (JWT) §4.1.4. "exp" (Expiration Time) Claim](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4)
42-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
41+
/// - SeeAlso: [RFC 7519 JSON Web Token (JWT) §4.1.4. "exp" (Expiration Time) Claim](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4)
42+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
4343
var expiration: Int
4444

4545
/// The standard header including the type and algorithm.
4646
///
47-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
47+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
4848
static let jwtHeader = Array(#"{"typ":"JWT","alg":"ES256"}"#.utf8).base64URLEncodedString()
4949

5050
/// Initialize a token with the specified claims.
@@ -93,7 +93,7 @@ extension VAPID {
9393
self = token
9494
}
9595

96-
/// - SeeAlso: [RFC 7515 JSON Web Signature (JWS) §3. JSON Web Signature (JWS) Overview](https://datatracker.ietf.org/doc/html/rfc7515#section-3)
96+
/// - SeeAlso: [RFC 7515 JSON Web Signature (JWS) §3. JSON Web Signature (JWS) Overview](https://datatracker.ietf.org/doc/html/rfc7515#section-3)
9797
func generateJWT(signedBy signingKey: some VAPIDKeyProtocol) throws -> String {
9898
let header = Self.jwtHeader
9999

@@ -108,7 +108,7 @@ extension VAPID {
108108

109109
/// Generate an `Authorization` header.
110110
///
111-
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §3. VAPID Authentication Scheme](https://datatracker.ietf.org/doc/html/rfc8292#section-3)
111+
/// - SeeAlso: [RFC 8292 Voluntary Application Server Identification (VAPID) for Web Push §3. VAPID Authentication Scheme](https://datatracker.ietf.org/doc/html/rfc8292#section-3)
112112
func generateAuthorization(signedBy signingKey: some VAPIDKeyProtocol) throws -> String {
113113
let token = try generateJWT(signedBy: signingKey)
114114
let key = signingKey.id
@@ -123,6 +123,6 @@ protocol VAPIDKeyProtocol: Identifiable, Sendable {
123123
associatedtype Signature: ContiguousBytes
124124

125125
/// Returns a JWS signature for the message.
126-
/// - SeeAlso: [RFC 7515 JSON Web Signature (JWS)](https://datatracker.ietf.org/doc/html/rfc7515)
126+
/// - SeeAlso: [RFC 7515 JSON Web Signature (JWS)](https://datatracker.ietf.org/doc/html/rfc7515)
127127
func signature(for message: some DataProtocol) throws -> Signature
128128
}

Sources/WebPush/WebPushManager.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ public actor WebPushManager: Sendable {
637637
.withUnsafeBytes(AES.GCM.Nonce.init(data:))
638638

639639
/// Encrypt the padded payload into a single record.
640-
/// - SeeAlso: [RFC 8188 Encrypted Content-Encoding for HTTP](https://datatracker.ietf.org/doc/html/rfc8188)
640+
/// - SeeAlso: [RFC 8188 Encrypted Content-Encoding for HTTP](https://datatracker.ietf.org/doc/html/rfc8188)
641641
let encryptedRecord = try AES.GCM.seal(paddedPayload, using: contentEncryptionKey, nonce: nonce)
642642

643643
/// Attach the header with our public key and salt, along with the authentication tag.
@@ -784,7 +784,7 @@ extension WebPushManager: Service {
784784
extension WebPushManager {
785785
/// A duration in seconds used to express when push messages will expire.
786786
///
787-
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP §5.2. Push Message Time-To-Live](https://datatracker.ietf.org/doc/html/rfc8030#section-5.2)
787+
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP §5.2. Push Message Time-To-Live](https://datatracker.ietf.org/doc/html/rfc8030#section-5.2)
788788
public struct Expiration: Hashable, Comparable, Codable, ExpressibleByIntegerLiteral, AdditiveArithmetic, Sendable {
789789
/// The number of seconds represented by this expiration.
790790
public let seconds: Int
@@ -800,7 +800,7 @@ extension WebPushManager {
800800
///
801801
/// If the user agent is unavailable, a push message with a zero TTL expires and is never delivered.
802802
///
803-
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP §5.2. Push Message Time-To-Live](https://datatracker.ietf.org/doc/html/rfc8030#section-5.2)
803+
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP §5.2. Push Message Time-To-Live](https://datatracker.ietf.org/doc/html/rfc8030#section-5.2)
804804
public static let dropIfUndeliverable: Self = .zero
805805

806806
/// Initialize an expiration with a number of seconds.
@@ -868,7 +868,7 @@ extension WebPushManager {
868868
extension WebPushManager {
869869
/// The urgency with which to deliver a push message.
870870
///
871-
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP §5.3. Push Message Urgency](https://datatracker.ietf.org/doc/html/rfc8030#section-5.3)
871+
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP §5.3. Push Message Urgency](https://datatracker.ietf.org/doc/html/rfc8030#section-5.3)
872872
public struct Urgency: Hashable, Comparable, Sendable, CustomStringConvertible {
873873
/// The internal raw value that is encoded in this type's place when calling ``description``.
874874
let rawValue: String

0 commit comments

Comments
 (0)