home.social

#http4s — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #http4s, aggregated by home.social.

  1. Error 500? Как вместо кодов получать подробные сведения обо всех ошибках сразу

    Привет, Хабр! Меня зовут Артём Корсаков. Я пишу на Scala и руковожу группой разработчиков в компании «Криптонит» , а также веду Scalabook — русскоязычную базу знаний по Scala и функциональному программированию. В этой статье расскажу про обработку ошибок в библиотеке http4s на Scala 3. Мы разберём, как настроить декодирование запросов так, чтобы клиент получал не просто код “500” или “422” с общим сообщением, а сразу видел развёрнутый список всех проблем в запросе. Например, что логин уже занят, пароль содержит недопустимые символы, а капча не введена. Пожалуй, самая раздражающая ошибка — это получение кода “500” в ответ на запрос, который ты десять раз перепроверил, сверился с документацией и уверен на все 100%, что запрос рабочий. Даже на 110%! В такие моменты раздражённо думаешь: “Что же этому серверу надо? Я же чётко сформулировал запрос! Ответить на этот вопрос порой сложно. Например, я хочу зарегистрироваться на сайте, ввожу логин/пароль и получаю сообщение "Internal Server Error". Первое желание – тут же покинуть сайт и поискать более дружелюбный. Давайте подумаем, как можно сделать сообщение об ошибке более информативным . Для этого будем использовать Scala 3, уточняющие типы и http4s . Представим, что мы создаём API сервиса авторизации, который (помимо прочего) должен регистрировать новых пользователей. Для начала определим структуру данных для создания нового пользователя.

    habr.com/ru/companies/kryptoni

    #функциональное_программирование #scala #http4s #обработка_ошибок #декодирование_запросов #backend

  2. Error 500? Как вместо кодов получать подробные сведения обо всех ошибках сразу

    Привет, Хабр! Меня зовут Артём Корсаков. Я пишу на Scala и руковожу группой разработчиков в компании «Криптонит» , а также веду Scalabook — русскоязычную базу знаний по Scala и функциональному программированию. В этой статье расскажу про обработку ошибок в библиотеке http4s на Scala 3. Мы разберём, как настроить декодирование запросов так, чтобы клиент получал не просто код “500” или “422” с общим сообщением, а сразу видел развёрнутый список всех проблем в запросе. Например, что логин уже занят, пароль содержит недопустимые символы, а капча не введена. Пожалуй, самая раздражающая ошибка — это получение кода “500” в ответ на запрос, который ты десять раз перепроверил, сверился с документацией и уверен на все 100%, что запрос рабочий. Даже на 110%! В такие моменты раздражённо думаешь: “Что же этому серверу надо? Я же чётко сформулировал запрос! Ответить на этот вопрос порой сложно. Например, я хочу зарегистрироваться на сайте, ввожу логин/пароль и получаю сообщение "Internal Server Error". Первое желание – тут же покинуть сайт и поискать более дружелюбный. Давайте подумаем, как можно сделать сообщение об ошибке более информативным . Для этого будем использовать Scala 3, уточняющие типы и http4s . Представим, что мы создаём API сервиса авторизации, который (помимо прочего) должен регистрировать новых пользователей. Для начала определим структуру данных для создания нового пользователя.

    habr.com/ru/companies/kryptoni

    #функциональное_программирование #scala #http4s #обработка_ошибок #декодирование_запросов #backend

  3. Error 500? Как вместо кодов получать подробные сведения обо всех ошибках сразу

    Привет, Хабр! Меня зовут Артём Корсаков. Я пишу на Scala и руковожу группой разработчиков в компании «Криптонит» , а также веду Scalabook — русскоязычную базу знаний по Scala и функциональному программированию. В этой статье расскажу про обработку ошибок в библиотеке http4s на Scala 3. Мы разберём, как настроить декодирование запросов так, чтобы клиент получал не просто код “500” или “422” с общим сообщением, а сразу видел развёрнутый список всех проблем в запросе. Например, что логин уже занят, пароль содержит недопустимые символы, а капча не введена. Пожалуй, самая раздражающая ошибка — это получение кода “500” в ответ на запрос, который ты десять раз перепроверил, сверился с документацией и уверен на все 100%, что запрос рабочий. Даже на 110%! В такие моменты раздражённо думаешь: “Что же этому серверу надо? Я же чётко сформулировал запрос! Ответить на этот вопрос порой сложно. Например, я хочу зарегистрироваться на сайте, ввожу логин/пароль и получаю сообщение "Internal Server Error". Первое желание – тут же покинуть сайт и поискать более дружелюбный. Давайте подумаем, как можно сделать сообщение об ошибке более информативным . Для этого будем использовать Scala 3, уточняющие типы и http4s . Представим, что мы создаём API сервиса авторизации, который (помимо прочего) должен регистрировать новых пользователей. Для начала определим структуру данных для создания нового пользователя.

    habr.com/ru/companies/kryptoni

    #функциональное_программирование #scala #http4s #обработка_ошибок #декодирование_запросов #backend

  4. Error 500? Как вместо кодов получать подробные сведения обо всех ошибках сразу

    Привет, Хабр! Меня зовут Артём Корсаков. Я пишу на Scala и руковожу группой разработчиков в компании «Криптонит» , а также веду Scalabook — русскоязычную базу знаний по Scala и функциональному программированию. В этой статье расскажу про обработку ошибок в библиотеке http4s на Scala 3. Мы разберём, как настроить декодирование запросов так, чтобы клиент получал не просто код “500” или “422” с общим сообщением, а сразу видел развёрнутый список всех проблем в запросе. Например, что логин уже занят, пароль содержит недопустимые символы, а капча не введена. Пожалуй, самая раздражающая ошибка — это получение кода “500” в ответ на запрос, который ты десять раз перепроверил, сверился с документацией и уверен на все 100%, что запрос рабочий. Даже на 110%! В такие моменты раздражённо думаешь: “Что же этому серверу надо? Я же чётко сформулировал запрос! Ответить на этот вопрос порой сложно. Например, я хочу зарегистрироваться на сайте, ввожу логин/пароль и получаю сообщение "Internal Server Error". Первое желание – тут же покинуть сайт и поискать более дружелюбный. Давайте подумаем, как можно сделать сообщение об ошибке более информативным . Для этого будем использовать Scala 3, уточняющие типы и http4s . Представим, что мы создаём API сервиса авторизации, который (помимо прочего) должен регистрировать новых пользователей. Для начала определим структуру данных для создания нового пользователя.

    habr.com/ru/companies/kryptoni

    #функциональное_программирование #scala #http4s #обработка_ошибок #декодирование_запросов #backend

  5. 🚀 Lookout! http4s v0.23.31 has just landed!
    It brings streamlined RFC compliance along with several features and tweaks — definitely worth grabbing while it’s hot!
    github.com/http4s/http4s/relea
    #Scala #http4s

  6. 🚀 Lookout! http4s v0.23.31 has just landed!
    It brings streamlined RFC compliance along with several features and tweaks — definitely worth grabbing while it’s hot!
    github.com/http4s/http4s/relea
    #Scala #http4s

  7. 🚀 Lookout! http4s v0.23.31 has just landed!
    It brings streamlined RFC compliance along with several features and tweaks — definitely worth grabbing while it’s hot!
    github.com/http4s/http4s/relea
    #Scala #http4s

  8. 🚀 Lookout! http4s v0.23.31 has just landed!
    It brings streamlined RFC compliance along with several features and tweaks — definitely worth grabbing while it’s hot!
    github.com/http4s/http4s/relea
    #Scala #http4s

  9. 🚀 Lookout! http4s v0.23.31 has just landed!
    It brings streamlined RFC compliance along with several features and tweaks — definitely worth grabbing while it’s hot!
    github.com/http4s/http4s/relea
    #Scala #http4s

  10. For those bravehearts on the bleeding edge, we just published the next-in-line release milestone of the http4s 1.0 series. Even though it's been a while since the last milestone, fifteen contributors made it happen! What's more, twelve of those were first-time contributors in http4s. That drives me crazy!
    github.com/http4s/http4s/relea
    #scala #typelevel #http4s

  11. For those bravehearts on the bleeding edge, we just published the next-in-line release milestone of the http4s 1.0 series. Even though it's been a while since the last milestone, fifteen contributors made it happen! What's more, twelve of those were first-time contributors in http4s. That drives me crazy!
    github.com/http4s/http4s/relea
    #scala #typelevel #http4s

  12. For those bravehearts on the bleeding edge, we just published the next-in-line release milestone of the http4s 1.0 series. Even though it's been a while since the last milestone, fifteen contributors made it happen! What's more, twelve of those were first-time contributors in http4s. That drives me crazy!
    github.com/http4s/http4s/relea
    #scala #typelevel #http4s

  13. For those bravehearts on the bleeding edge, we just published the next-in-line release milestone of the http4s 1.0 series. Even though it's been a while since the last milestone, fifteen contributors made it happen! What's more, twelve of those were first-time contributors in http4s. That drives me crazy!
    github.com/http4s/http4s/relea
    #scala #typelevel #http4s

  14. Very nice post by @ross 'On http4s, minimalism, and 1.0' — github.com/http4s/http4s/discu. It conjointly accurately demystifies the current and desired ultimate state for 1.0. Feel free to join the discussion. #scala #typelevel #http4s

  15. Very nice post by @ross 'On http4s, minimalism, and 1.0' — github.com/http4s/http4s/discu. It conjointly accurately demystifies the current and desired ultimate state for 1.0. Feel free to join the discussion. #scala #typelevel #http4s

  16. Very nice post by @ross 'On http4s, minimalism, and 1.0' — github.com/http4s/http4s/discu. It conjointly accurately demystifies the current and desired ultimate state for 1.0. Feel free to join the discussion. #scala #typelevel #http4s

  17. Very nice post by @ross 'On http4s, minimalism, and 1.0' — github.com/http4s/http4s/discu. It conjointly accurately demystifies the current and desired ultimate state for 1.0. Feel free to join the discussion. #scala #typelevel #http4s

  18. Very nice post by @ross 'On http4s, minimalism, and 1.0' — github.com/http4s/http4s/discu. It conjointly accurately demystifies the current and desired ultimate state for 1.0. Feel free to join the discussion. #scala #typelevel #http4s

  19. The upcoming twenty-fourth patch release in the `0.23`-series of http4s got 7 (seven!) new contributors. In fact, their contributions enrol into 2/3 of all shipped changes. Goddamn, that doesn't stop to blow my mind!
    #Typelevel #http4s #scala

  20. The upcoming twenty-fourth patch release in the `0.23`-series of http4s got 7 (seven!) new contributors. In fact, their contributions enrol into 2/3 of all shipped changes. Goddamn, that doesn't stop to blow my mind!
    #Typelevel #http4s #scala

  21. The upcoming twenty-fourth patch release in the `0.23`-series of http4s got 7 (seven!) new contributors. In fact, their contributions enrol into 2/3 of all shipped changes. Goddamn, that doesn't stop to blow my mind!
    #Typelevel #http4s #scala

  22. The upcoming twenty-fourth patch release in the `0.23`-series of http4s got 7 (seven!) new contributors. In fact, their contributions enrol into 2/3 of all shipped changes. Goddamn, that doesn't stop to blow my mind!
    #Typelevel #http4s #scala

  23. The upcoming twenty-fourth patch release in the `0.23`-series of http4s got 7 (seven!) new contributors. In fact, their contributions enrol into 2/3 of all shipped changes. Goddamn, that doesn't stop to blow my mind!
    #Typelevel #http4s #scala

  24. It is sad that all the Gitter links have rotted, but I've managed to recover a JSON archive of significant Typelevel and http4s channels for personal reference.

    Cats' begins with "well i got a readme written".

    #Typelevel #Scala #Http4s #Gitter

  25. It is sad that all the Gitter links have rotted, but I've managed to recover a JSON archive of significant Typelevel and http4s channels for personal reference.

    Cats' begins with "well i got a readme written".

    #Typelevel #Scala #Http4s #Gitter

  26. It is sad that all the Gitter links have rotted, but I've managed to recover a JSON archive of significant Typelevel and http4s channels for personal reference.

    Cats' begins with "well i got a readme written".

    #Typelevel #Scala #Http4s #Gitter

  27. It is sad that all the Gitter links have rotted, but I've managed to recover a JSON archive of significant Typelevel and http4s channels for personal reference.

    Cats' begins with "well i got a readme written".

    #Typelevel #Scala #Http4s #Gitter

  28. It is sad that all the Gitter links have rotted, but I've managed to recover a JSON archive of significant Typelevel and http4s channels for personal reference.

    Cats' begins with "well i got a readme written".

    #Typelevel #Scala #Http4s #Gitter

  29. @davesmith00000 agreed regarding play! Hence my preferred is to build something around http4s and in the past I have used Akka-http too.

    The last time I looked into this I did come across this but never got a chance to try it:

    github.com/softwaremill/bootzo

    by @adamwarski and team

  30. @davesmith00000 agreed regarding play! Hence my preferred is to build something around http4s and in the past I have used Akka-http too.

    The last time I looked into this I did come across this but never got a chance to try it:

    github.com/softwaremill/bootzo

    by @adamwarski and team

    #scala #typelevel #akka #pekko #http4s

  31. @davesmith00000 agreed regarding play! Hence my preferred is to build something around http4s and in the past I have used Akka-http too.

    The last time I looked into this I did come across this but never got a chance to try it:

    github.com/softwaremill/bootzo

    by @adamwarski and team

    #scala #typelevel #akka #pekko #http4s

  32. @davesmith00000 agreed regarding play! Hence my preferred is to build something around http4s and in the past I have used Akka-http too.

    The last time I looked into this I did come across this but never got a chance to try it:

    github.com/softwaremill/bootzo

    by @adamwarski and team

    #scala #typelevel #akka #pekko #http4s

  33. @davesmith00000 agreed regarding play! Hence my preferred is to build something around http4s and in the past I have used Akka-http too.

    The last time I looked into this I did come across this but never got a chance to try it:

    github.com/softwaremill/bootzo

    by @adamwarski and team

    #scala #typelevel #akka #pekko #http4s

  34. My #SolidProject client and server are now ready for efficient access control demos on #BigData using the HTTP WG's 's "Signing HTTP Messages".

    I can demo with a server publishing N resources (in this case, #LinkedData Event Stream (#LDES) data.
    The client is implemented in #Scala using #http4s, and the server uses #Akka.
    The libraries can be compiled to JS for use on #nodeJS frameworks too. Native is not far off, either.
    The client need make no more than N+2 requests:

    1. Request 1 on a resource R returning a "401 Unauthorised"
    2. a max of 2 requests to get the access control rules
    3. from there on, N signed requests using #HttpSignatures (when those all fall in the same container space)

    Solid clients are essentially like Search Engine crawlers fetching data on the web, so they need to jump around from website to website. Having approx 2 requests extra per website for auth is very interesting in that scenario.

    Note: those 2 requests can be cached, so those may be only needed once over a long period of time. The connection efficiency is possible by combining the following pieces:

    • using the IETF's HTTPSig (a version from the beginning of the year)
    • using default rules (part of the spec)
    • caching of ACLs on the client
    • the use of a "defaultAccessContainer" link header to reduce the number of requests.

    I am trying to work out who may be interested in such a technical demo, what a good time for it may be, ...
    so please just comment here or send me a mail at [email protected]

  35. My #SolidProject client and server are now ready for efficient access control demos on #BigData using the HTTP WG's 's "Signing HTTP Messages".

    I can demo with a server publishing N resources (in this case, #LinkedData Event Stream (#LDES) data.
    The client is implemented in #Scala using #http4s, and the server uses #Akka.
    The libraries can be compiled to JS for use on #nodeJS frameworks too. Native is not far off, either.
    The client need make no more than N+2 requests:

    1. Request 1 on a resource R returning a "401 Unauthorised"
    2. a max of 2 requests to get the access control rules
    3. from there on, N signed requests using #HttpSignatures (when those all fall in the same container space)

    Solid clients are essentially like Search Engine crawlers fetching data on the web, so they need to jump around from website to website. Having approx 2 requests extra per website for auth is very interesting in that scenario.

    Note: those 2 requests can be cached, so those may be only needed once over a long period of time. The connection efficiency is possible by combining the following pieces:

    • using the IETF's HTTPSig (a version from the beginning of the year)
    • using default rules (part of the spec)
    • caching of ACLs on the client
    • the use of a "defaultAccessContainer" link header to reduce the number of requests.

    I am trying to work out who may be interested in such a technical demo, what a good time for it may be, ...
    so please just comment here or send me a mail at [email protected]