{"id":8618927,"name":"github.com/2lambda123/csrf","ecosystem":"go","description":"Package csrf (gorilla/csrf) provides Cross Site Request Forgery (CSRF)\nprevention middleware for Go web applications \u0026 services.\n\nIt includes:\n\ngorilla/csrf is easy to use: add the middleware to individual handlers with\nthe below:\n\n... and then collect the token with `csrf.Token(r)` before passing it to the\ntemplate, JSON body or HTTP header (you pick!). gorilla/csrf inspects the form body\n(first) and HTTP headers (second) on subsequent POST/PUT/PATCH/DELETE/etc. requests\nfor the token.\n\nHere's the common use-case: HTML forms you want to provide CSRF protection for,\nin order to protect malicious POST requests being made:\n\nNote that the CSRF middleware will (by necessity) consume the request body if the\ntoken is passed via POST form values. If you need to consume this in your\nhandler, insert your own middleware earlier in the chain to capture the request\nbody.\n\nYou can also send the CSRF token in the response header. This approach is useful\nif you're using a front-end JavaScript framework like Ember or Angular, or are\nproviding a JSON API:\n\nIn addition: getting CSRF protection right is important, so here's some background:\n\nThis library does not seek to be adventurous.","homepage":"https://github.com/2lambda123/csrf","licenses":"BSD-3-Clause","normalized_licenses":["BSD-3-Clause"],"repository_url":"https://github.com/2lambda123/csrf","keywords_array":[],"namespace":"github.com/2lambda123","versions_count":9,"first_release_published_at":"2015-08-05T05:46:41.000Z","latest_release_published_at":"2023-11-05T02:08:39.000Z","latest_release_number":"v1.7.2","last_synced_at":"2026-04-16T21:32:24.839Z","created_at":"2023-12-05T01:35:35.839Z","updated_at":"2026-04-16T21:32:24.840Z","registry_url":"https://pkg.go.dev/github.com/2lambda123/csrf","install_command":"go get github.com/2lambda123/csrf","documentation_url":"https://pkg.go.dev/github.com/2lambda123/csrf#section-documentation","metadata":{},"repo_metadata":{"uuid":"726778942","full_name":"2lambda123/csrf","owner":"2lambda123","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-03T11:31:52.000Z","size":123,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-05T01:35:40.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2lambda123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-12-03T11:31:39.000Z","updated_at":"2023-12-05T01:36:03.461Z","dependencies_parsed_at":"2023-12-05T01:36:01.777Z","dependency_job_id":"929f9b62-1abe-4c5b-86be-3d7458d85a3b","html_url":"https://github.com/2lambda123/csrf","commit_stats":null,"previous_names":["2lambda123/csrf"],"tags_count":15,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2lambda123%2Fcsrf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2lambda123%2Fcsrf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2lambda123%2Fcsrf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2lambda123%2Fcsrf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2lambda123","download_url":"https://codeload.github.com/2lambda123/csrf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":174878132,"owners_count":10178708,"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"}},"repo_metadata_updated_at":"2023-12-06T01:36:32.224Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":10.771707882697278,"dependent_packages_count":9.555904237689512,"stargazers_count":null,"forks_count":null,"docker_downloads_count":null,"average":10.163806060193394},"purl":"pkg:golang/github.com/2lambda123/csrf","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/go/github.com/2lambda123/csrf","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/go/github.com/2lambda123/csrf","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/go/github.com/2lambda123/csrf/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":null,"versions_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2F2lambda123%2Fcsrf/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2F2lambda123%2Fcsrf/version_numbers","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2F2lambda123%2Fcsrf/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2F2lambda123%2Fcsrf/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2F2lambda123%2Fcsrf/codemeta","maintainers":[]}