Skip to content

Releases: davenverse/snickerdoodle

v0.0.4

07 Sep 18:02
b66bd56
Compare
Choose a tag to compare

Allows Users to Synchronous Sync Persistence, for short-lived applications where the shutdown race condition is more problematic than the delay on an action.

What's Changed

Full Changelog: v0.0.3...v0.0.4

v0.0.3

18 Jul 14:00
3e93b61
Compare
Choose a tag to compare

Summary

Sqlite Support on Scala.js. Pretty cool to be able to support this. To my knowledge this is the first of its kind, so there may be things to document or figure out. However, its better than a runtime throwable which is what we had before.

What's Changed

Full Changelog: v0.0.2...v0.0.3

v0.0.2

18 Jul 00:27
1577295
Compare
Choose a tag to compare

Summary

Supercookie Prevention means that using this CookieJar prevents sites from storing public suffix cookies on your machine. Before if you visited
badGuy.com it could set a cookie for com which would send to all other sites within com risking your privacy. This new feature counteracts this.

What's Changed

New Contributors

Full Changelog: v0.0.1...v0.0.2

v0.0.1

15 Jul 04:16
Compare
Choose a tag to compare

Summary

Snickerdoodle handles cookie persistence between application runs, it has a fully in memory implementation, and will follow RFC 6265 correctly. Meaning it works very similarly to how your browser manages its cookies. Snickerdoodle is a bit more opinionated than the http4s implementation.

Cookies are a persistent stateful resource between a client and server. However, maybe you run into an unexpected error, or someone sets a remember me token for a super long time, or maybe you would just prefer to avoid work if you can because you have the information already available.

Snickerdoodle is the cookie for you.

Initial Release!

Quick Start

To use snickerdoodle in an existing SBT project with Scala 2.13 or a later version, add the following dependencies to your
build.sbt depending on your needs:

libraryDependencies ++= Seq(
  "io.chrisdavenport" %% "snickerdoodle" % "<version>"
)

How to use

import cats.syntax.all._
import cats.effect._
import fs2.io.file.Path
import io.chrisdavenport.snickerdoodle._
import org.http4s.ember.client.EmberClientBuilder
import org.http4s.client.middleware.CookieJar

// Create the cookie jar like so
val jarResource = SnCookieJarBuilder.default[IO]
  .withSqlitePersistence(Path("sample.sqlite"))
  .build

// Typical way you generally make a client
val clientResource = EmberClientBuilder.default[IO].build


val combined = (jarResource, clientResource).mapN{
  // Apply it to a client
  case (jar, client) => CookieJar(jar)(client)
}