{"id":23070158,"url":"https://github.com/strojure/ring-lib","last_synced_at":"2025-06-16T06:36:19.436Z","repository":{"id":65402003,"uuid":"590058627","full_name":"strojure/ring-lib","owner":"strojure","description":"Opinionated implementations for Clojure ring handler.","archived":false,"fork":false,"pushed_at":"2023-03-28T13:43:06.000Z","size":55,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"default","last_synced_at":"2025-05-18T17:04:49.350Z","etag":null,"topics":["clojure","optimization","ring-handler","ring-middleware"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strojure.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-17T15:11:19.000Z","updated_at":"2023-07-25T15:06:30.000Z","dependencies_parsed_at":"2023-02-16T21:31:03.013Z","dependency_job_id":null,"html_url":"https://github.com/strojure/ring-lib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"strojure/library-template","purl":"pkg:github/strojure/ring-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strojure%2Fring-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strojure%2Fring-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strojure%2Fring-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strojure%2Fring-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strojure","download_url":"https://codeload.github.com/strojure/ring-lib/tar.gz/refs/heads/default","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strojure%2Fring-lib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260114984,"owners_count":22961022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","optimization","ring-handler","ring-middleware"],"created_at":"2024-12-16T06:19:43.698Z","updated_at":"2025-06-16T06:36:19.377Z","avatar_url":"https://github.com/strojure.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ring-lib\r\n\r\nOpinionated implementations for Clojure ring handler.\r\n\r\n[![Clojars Project](https://img.shields.io/clojars/v/com.github.strojure/ring-lib.svg)](https://clojars.org/com.github.strojure/ring-lib)\r\n\r\n[![cljdoc badge](https://cljdoc.org/badge/com.github.strojure/ring-lib)](https://cljdoc.org/d/com.github.strojure/ring-lib)\r\n[![tests](https://github.com/strojure/ring-lib/actions/workflows/tests.yml/badge.svg)](https://github.com/strojure/ring-lib/actions/workflows/tests.yml)\r\n\r\n## Motivation\r\n\r\nBeing not satisfied with some decisions/implementations in existing Ring\r\nlibraries.\r\n\r\n## API\r\n\r\n### Middlewares\r\n\r\nSome middlewares in this library does not provide `wrap-middleware` function.\r\nThere are middleware builder functions in `strojure.ring-lib.middleware.core`\r\nnamespace:\r\n\r\n```clojure\r\n(require '[strojure.ring-lib.middleware.core :as mw]\r\n         '[strojure.ring-lib.middleware.params :as params])\r\n\r\n(-\u003e handler\r\n    (mw/wrap-request (params/params-request-fn {})))\r\n```\r\n\r\n#### csp\r\n\r\nThe implementation of Content Security Policy ([CSP]).\r\n\r\n- Supports static CSP headers and headers with nonce.\r\n- Renders policy from Clojure map.\r\n- Follows recommendations for nonce generation.\r\n- Configurable usage of report-only CSP header.\r\n- Handles report URI endpoint.\r\n\r\n[CSP]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP\r\n\r\n#### cookies\r\n\r\nThe alternative implementation of the\r\n[cookies](https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/cookies.clj)\r\nmiddleware.\r\n\r\n- Lazy evaluation of the `:cookies` key in request.\r\n- Avoids destructuring of the options map in every request.\r\n\r\n#### params\r\n\r\nThe alternative implementation of the\r\n[params](https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/params.clj)\r\nmiddleware.\r\n\r\n- Name dependent detection if param is single value or collection, by default\r\n  only names with `[]` suffix has collection value.\r\n- Lazy evaluation of request keys.\r\n- Allows to customize param names with collection values.\r\n- Allows to define coercion function for param names, i.e. to keywordize them.\r\n- Adds `:form-params` which is `:query-params` for GET requests and\r\n  `:body-params` for POST request with “application/x-www-form-urlencoded”\r\n  content type.\r\n- Adds `:path-or-query-params` which contains params from URL but not body.\r\n- Does not add `:params` as merge of everything else because it is considered confusing.\r\n- Optimized for performance.\r\n\r\n## Benchmarks\r\n\r\n- [middleware.params](doc/benchmark/middleware_params.clj)\r\n- [util.codec](doc/benchmark/util_codec.clj)\r\n- [util.headers](doc/benchmark/util_headers.clj)\r\n\r\n---\r\n\r\nAuthored by [Sergey Trofimov](https://github.com/serioga).\r\n\r\n[![license](https://img.shields.io/badge/license-The%20Unlicense-informational)](UNLICENSE)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrojure%2Fring-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrojure%2Fring-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrojure%2Fring-lib/lists"}