Skip to content

v0.9.0

Choose a tag to compare

@DZakh DZakh released this 03 Sep 07:22
· 43 commits to main since this release

Authentication header 🆕

For the Authentication header there's a new helper s.auth which supports Bearer and Basic authentication schemes.

let getPosts = Rest.route(() => {
  path: "/posts",
  method: Get,
  variables: s => {
    "token": s.auth(Bearer),
  },
  responses: [
    s => s.data(S.array(postSchema)),
  ],
})
let result = await client.call(
  getPosts,
  {
    "token": "abc",
  }
) // ℹ️ It'll do a GET request to http://localhost:3000/posts with the `{"authorization": "Bearer abc"}` headers

Full Changelog: v0.8.0...v0.9.0