Skip to content

Releases: swift-cloud/Compute

3.1.0

20 Mar 00:51
5d48d24
Compare
Choose a tag to compare
  • Adds support for TLS JA4 digests with req.TLSFingerprint(.ja4)

3.0.0

20 Mar 00:03
d0f41df
Compare
Choose a tag to compare
  • Built for Swift 6. There are no outstanding concurrency warnings or issues.
  • Adds a new Fastly.Device api to get data about the client making the current request

v2.19.0

04 Mar 22:53
Compare
Choose a tag to compare

Upgrade Swift Crypto to 3.0.0

v2.18.0 - Cache

28 Sep 23:49
Compare
Choose a tag to compare

This release adds support for Fastly's Cache API allowing you to cache and retrieve arbitrary data during a request:

let data = try await Cache.getOrSet("my-page") {
    let res = try await expensivePageRender()
    return (res, .ttl(60))
}

try await res
    .status(200)
    .header(.contentLength, "\(data.contentLength)")
    .send(data.body)

v2.17.0 - KVStore

07 Apr 15:47
Compare
Choose a tag to compare
  • Rename ObjectStore to KVStore following Fastly name change

v2.16.0 - Support Xcode 14.3

03 Apr 20:44
Compare
Choose a tag to compare
  • Add support for Xcode 14.3

v2.15.0 - Forwarded For

07 Mar 21:16
Compare
Choose a tag to compare
  • Set x-forwarded-for header when proxying a fetch request

v2.14.0 - Swift Crypto

03 Mar 14:41
Compare
Choose a tag to compare
  • Compute now relies directly on apple/swift-crypto making it more compatible with other Swift server libraries

v2.13.0 - Crypto Additions

27 Feb 19:28
Compare
Choose a tag to compare
  • Adds additional crypto signatures for ease of use

v2.12.0 - Fanout

08 Feb 23:11
4b9b48e
Compare
Choose a tag to compare
  • Integrates Fanout into request and response handling
  • Adds a new FanoutClient for publishing messages to Fanout channels
  • Switches underlying crypto lib to apple/swift-crypto
  • Adds support for creating and verifying ECDSA style JWTs (ex. ES256)
// Clients connect here
router.get("/stream") { req, res in
    guard req.isUpgradeWebsocketRequest() else {
        return try await res.status(400).send("Invalid websocket request")
    }
    try req.upgradeWebsocket(to: .fanout, hostname: "localhost")
}

// Fanout relays messages here
router.post("/stream") { req, res in
    let message = try await req.fanoutMessage()
    if message.event == .open {
        return try await res.send(fanout: .open, .subscribe(to: "test"))
    }
    try await res.send(fanout: .ack)
}

// Authenticated publish endpoint here
router.post("/message") { req, res in
    let token = try ConfigStore(name: "env")["fanout_token"]!
    let client = FanoutClient(token: token)
    let content = try await req.body.text()
    let data = try await client.publish(content, to: "test")
    try await res.proxy(data)
}