summaryrefslogtreecommitdiff
path: root/vendor/github.com/gorilla/context
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gorilla/context')
-rw-r--r--vendor/github.com/gorilla/context/.editorconfig20
-rw-r--r--vendor/github.com/gorilla/context/.gitignore1
-rw-r--r--vendor/github.com/gorilla/context/.golangci.yml12
-rw-r--r--vendor/github.com/gorilla/context/.travis.yml19
-rw-r--r--vendor/github.com/gorilla/context/LICENSE2
-rw-r--r--vendor/github.com/gorilla/context/Makefile52
-rw-r--r--vendor/github.com/gorilla/context/README.md28
-rw-r--r--vendor/github.com/gorilla/context/context.go4
8 files changed, 108 insertions, 30 deletions
diff --git a/vendor/github.com/gorilla/context/.editorconfig b/vendor/github.com/gorilla/context/.editorconfig
new file mode 100644
index 000000000..2940ec92a
--- /dev/null
+++ b/vendor/github.com/gorilla/context/.editorconfig
@@ -0,0 +1,20 @@
+; https://editorconfig.org/
+
+root = true
+
+[*]
+insert_final_newline = true
+charset = utf-8
+trim_trailing_whitespace = true
+indent_style = space
+indent_size = 2
+
+[{Makefile,go.mod,go.sum,*.go,.gitmodules}]
+indent_style = tab
+indent_size = 4
+
+[*.md]
+indent_size = 4
+trim_trailing_whitespace = false
+
+eclint_indent_style = unset
diff --git a/vendor/github.com/gorilla/context/.gitignore b/vendor/github.com/gorilla/context/.gitignore
new file mode 100644
index 000000000..84039fec6
--- /dev/null
+++ b/vendor/github.com/gorilla/context/.gitignore
@@ -0,0 +1 @@
+coverage.coverprofile
diff --git a/vendor/github.com/gorilla/context/.golangci.yml b/vendor/github.com/gorilla/context/.golangci.yml
new file mode 100644
index 000000000..1def5e627
--- /dev/null
+++ b/vendor/github.com/gorilla/context/.golangci.yml
@@ -0,0 +1,12 @@
+linters:
+ enable:
+ - errcheck
+ - gosimple
+ - govet
+ - ineffassign
+ - staticcheck
+ - unused
+ - contextcheck
+ - goconst
+ - gofmt
+ - misspell
diff --git a/vendor/github.com/gorilla/context/.travis.yml b/vendor/github.com/gorilla/context/.travis.yml
deleted file mode 100644
index 6f440f1e4..000000000
--- a/vendor/github.com/gorilla/context/.travis.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-language: go
-sudo: false
-
-matrix:
- include:
- - go: 1.3
- - go: 1.4
- - go: 1.5
- - go: 1.6
- - go: 1.7
- - go: tip
- allow_failures:
- - go: tip
-
-script:
- - go get -t -v ./...
- - diff -u <(echo -n) <(gofmt -d .)
- - go vet $(go list ./... | grep -v /vendor/)
- - go test -v -race ./...
diff --git a/vendor/github.com/gorilla/context/LICENSE b/vendor/github.com/gorilla/context/LICENSE
index 0e5fb8728..f2f8749bc 100644
--- a/vendor/github.com/gorilla/context/LICENSE
+++ b/vendor/github.com/gorilla/context/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2012 Rodrigo Moraes. All rights reserved.
+Copyright (c) 2012-2023 The Gorilla web toolkit authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff --git a/vendor/github.com/gorilla/context/Makefile b/vendor/github.com/gorilla/context/Makefile
new file mode 100644
index 000000000..c02b8a41f
--- /dev/null
+++ b/vendor/github.com/gorilla/context/Makefile
@@ -0,0 +1,52 @@
+GO_LINT=$(shell which golangci-lint 2> /dev/null || echo '')
+GO_LINT_URI=github.com/golangci/golangci-lint/cmd/golangci-lint@latest
+
+GO_SEC=$(shell which gosec 2> /dev/null || echo '')
+GO_SEC_URI=github.com/securego/gosec/v2/cmd/gosec@latest
+
+GO_VULNCHECK=$(shell which govulncheck 2> /dev/null || echo '')
+GO_VULNCHECK_URI=golang.org/x/vuln/cmd/govulncheck@latest
+
+.PHONY: golangci-lint
+golangci-lint: ## Run golangci-lint. Example: make golangci-lint
+ $(if $(GO_LINT), ,go install $(GO_LINT_URI))
+ @echo "##### Running golangci-lint #####"
+ golangci-lint run -v
+
+.PHONY: verify
+verify: ## Run all verifications [golangci-lint]. Example: make verify
+ @echo "##### Running verifications #####"
+ $(MAKE) golangci-lint
+
+.PHONY: gosec
+gosec: ## Run gosec. Example: make gosec
+ $(if $(GO_SEC), ,go install $(GO_SEC_URI))
+ @echo "##### Running gosec #####"
+ gosec ./...
+
+.PHONY: govulncheck
+govulncheck: ## Run govulncheck. Example: make govulncheck
+ $(if $(GO_VULNCHECK), ,go install $(GO_VULNCHECK_URI))
+ @echo "##### Running govulncheck #####"
+ govulncheck ./...
+
+.PHONY: security
+security: ## Run all security checks [gosec, govulncheck]. Example: make security
+ @echo "##### Running security checks #####"
+ $(MAKE) gosec
+ $(MAKE) govulncheck
+
+.PHONY: test-unit
+test-unit: ## Run unit tests. Example: make test-unit
+ @echo "##### Running unit tests #####"
+ go test -race -cover -coverprofile=coverage.coverprofile -covermode=atomic -v ./...
+
+.PHONY: test
+test: ## Run all tests [test-unit]. Example: make test
+ @echo "##### Running tests #####"
+ $(MAKE) test-unit
+
+.PHONY: help
+help: ## Print this help. Example: make help
+ @echo "##### Printing help #####"
+ @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
diff --git a/vendor/github.com/gorilla/context/README.md b/vendor/github.com/gorilla/context/README.md
index 08f86693b..6fb5fb049 100644
--- a/vendor/github.com/gorilla/context/README.md
+++ b/vendor/github.com/gorilla/context/README.md
@@ -1,10 +1,26 @@
-context
-=======
-[![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context)
+# gorilla/context
+
+[![License](https://img.shields.io/github/license/gorilla/.github)](https://img.shields.io/github/license/gorilla/.github)
+![testing](https://github.com/gorilla/context/actions/workflows/test.yml/badge.svg)
+[![codecov](https://codecov.io/github/gorilla/context/branch/main/graph/badge.svg)](https://codecov.io/github/gorilla/context)
+[![godoc](https://godoc.org/github.com/gorilla/context?status.svg)](https://godoc.org/github.com/gorilla/context)
+[![sourcegraph](https://sourcegraph.com/github.com/gorilla/context/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/context?badge)
+[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7656/badge)](https://bestpractices.coreinfrastructure.org/projects/7656)
+
+![Gorilla Logo](https://github.com/gorilla/.github/assets/53367916/d92caabf-98e0-473e-bfbf-ab554ba435e5)
+
+> ⚠⚠⚠ **Note** ⚠⚠⚠ gorilla/context, having been born well before `context.Context` existed, does not play well
+> with the shallow copying of the request that [`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext) (added to net/http Go 1.7 onwards) performs.
+>
+> Using gorilla/context may lead to memory leaks under those conditions, as the pointers to each `http.Request` become "islanded" and will not be cleaned up when the response is sent.
+>
+> You should use the `http.Request.Context()` feature in Go 1.7.
gorilla/context is a general purpose registry for global request variables.
-> Note: gorilla/context, having been born well before `context.Context` existed, does not play well
-> with the shallow copying of the request that [`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext) (added to net/http Go 1.7 onwards) performs. You should either use *just* gorilla/context, or moving forward, the new `http.Request.Context()`.
+* It stores a `map[*http.Request]map[interface{}]interface{}` as a global singleton, and thus tracks variables by their HTTP request.
+
+
+### License
-Read the full documentation here: http://www.gorillatoolkit.org/pkg/context
+See the LICENSE file for details.
diff --git a/vendor/github.com/gorilla/context/context.go b/vendor/github.com/gorilla/context/context.go
index 81cb128b1..9160564dd 100644
--- a/vendor/github.com/gorilla/context/context.go
+++ b/vendor/github.com/gorilla/context/context.go
@@ -1,7 +1,3 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
package context
import (