Skip to content

Node.js #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 51 commits into
base: elithrar/docs-js
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a8abe8a
[docs] Mentions passing csrf.Secure(false) in local dev environments.
wayneashleyberry Sep 1, 2016
0ff6a2c
[docs] Improve commented code (#46)
1046102779 Sep 26, 2016
bbe6687
[docs] Fix syntax typo (#48)
stefanocoding Oct 2, 2016
7f54448
[docs] Fix incorrect function name in docs (#49)
philipithomas Oct 15, 2016
fdae182
docs: fix minor typo (#50)
shoenig Oct 23, 2016
10e8fd1
[docs] Fix a few minor typos in examples. (#54)
jmcarp Nov 22, 2016
6958173
[doc] Fixed readme mux path prefix (#51)
llitfkitfk Nov 22, 2016
27774ab
Add Sourcegraph badge.
elithrar Mar 20, 2017
0c47ead
Fix link.
elithrar Mar 20, 2017
0790a82
Update doc.go (#59)
adiabatic Mar 24, 2017
e6dca67
[docs] doc.go: Fix list rendering (#61)
dunglas Apr 20, 2017
c5a2560
[docs] Fix documentation formatting (#63)
kevinburke Jun 6, 2017
8b1b43b
[build] Use dep / min Go version 1.3 (#68)
elithrar Aug 9, 2017
8aae08f
[fix] Remove unused variable "token" from TestNoCookie (#71)
neelance Sep 12, 2017
90b0c59
[build] Define go.mod (#83)
elithrar May 22, 2018
05b4a73
[build] Run CI for Go 1.7.x - 1.10.x (#84)
elithrar May 22, 2018
9f56e6e
Update LICENSE & AUTHORS files
Jun 8, 2018
d690280
Merge pull request #88 from gorilla/elithrar/corporate-overlords
kisielk Jun 8, 2018
10bfafc
[docs] Note that developers should check the HTTP method (#91)
elithrar Jun 20, 2018
f903b4e
README.md: Update site URL
kisielk Oct 12, 2018
abcfd25
Add stalebot config
elithrar Dec 7, 2018
472e852
[docs] Add a "Reviewed by Hound" badge (#98)
salbertson Dec 7, 2018
1db7df7
Merge pull request #101 from gorilla/stalebot
kisielk Dec 7, 2018
40703b8
Update and rename stale to stale.yml (#102)
elithrar Dec 8, 2018
d162037
[docs] Improve JS header/form instructions (#103)
elithrar Dec 10, 2018
3719438
[build] Add CircleCI config (#112)
elithrar Jun 26, 2019
38c9e46
Remove gorilla/context as part of pre-1.7 support (#114)
elithrar Jun 26, 2019
9b0e3ac
Add CircleCI status badge to README (#113)
elithrar Jun 26, 2019
5050f9c
Add trusted origins feature (#117)
fjorgemota Jul 20, 2019
a7479e7
Create release-drafter.yml (#118)
elithrar Jul 20, 2019
7b29b05
bugfix: correctly set a defaultMaxAge when MaxAge isn't called (#120)
elithrar Aug 26, 2019
4b50158
feature: Support SameSite option (#123)
tflyons Oct 8, 2019
dbfab4e
bugfix: Don't set a default samesite for backwards compatibility (#132)
euank Apr 26, 2020
79c60d0
fix: Set SameSite=Lax by default (#136)
elithrar Apr 26, 2020
4be1463
docs: add TOC to README (#137)
elithrar May 30, 2020
d1ee07f
docs: change TrustedOrigin to TrustedOrigins in README (#140)
mittonface Aug 26, 2020
9565ae2
build: use build matrix; drop Go <= 1.10 (#142)
elithrar Sep 12, 2020
46c0190
Add note about csrf.Path option (#147)
Apr 11, 2021
c61da38
Add a note about secrecy of CSRF token in the README.md (#154)
maxximino May 28, 2021
b69cbb3
bugfix: Not providing any token in requests results in wrong error me…
FlorianLoch Jul 29, 2021
e40f234
Remove pkg/errors dependency (#161)
husio Jan 21, 2022
93379db
archive mode
elithrar Dec 9, 2022
04cc5db
Update README.md
Jul 15, 2023
32c27b0
Merge pull request #164 from gorilla/coreydaley-patch-1
Jul 15, 2023
15d47ec
[GPT-96] Update go version & add verification/testing tools (#166)
apoorvajagtap Jul 25, 2023
a71a12f
updated licence (#167)
apoorvajagtap Jul 26, 2023
73c96a5
Update issues.yml (#168)
Jul 31, 2023
c1f4eb3
issues/158/examples for working api with javascript frontend (#162)
francoposa Aug 17, 2023
94b5a9e
updating github action workflows (#169)
Oct 18, 2023
a009743
Updating gorilla/securecookie to v1.1.2 (#170)
Nov 5, 2023
9dd6af1
Merge commit from fork
patrickod Jan 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add all the issues created to the project.
name: Add issue or pull request to Project

on:
issues:
types:
- opened
pull_request_target:
types:
- opened
- reopened

jobs:
add-to-project:
runs-on: ubuntu-latest
steps:
- name: Add issue to project
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/gorilla/projects/4
github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Security
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
scan:
strategy:
matrix:
go: ['1.20','1.21']
fail-fast: true
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: false

- name: Run GoSec
uses: securego/gosec@master
with:
args: -exclude-dir examples ./...

- name: Run GoVulnCheck
uses: golang/govulncheck-action@v1
with:
go-version-input: ${{ matrix.go }}
go-package: ./...
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
unit:
strategy:
matrix:
go: ['1.20','1.21']
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: false

- name: Run Tests
run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage
32 changes: 32 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Verify
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
lint:
strategy:
matrix:
go: ['1.20','1.21']
fail-fast: true
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: false

- name: Run GolangCI-Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53
args: --timeout=5m
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage.coverprofile
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

27 changes: 27 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"


[[constraint]]
name = "github.com/gorilla/context"
version = "1.1.0"

[[constraint]]
name = "github.com/gorilla/securecookie"
version = "1.1.0"

[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"
48 changes: 24 additions & 24 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
Copyright (c) 2015, Matt Silverlock ([email protected]) All rights
reserved.
Copyright (c) 2023 The Gorilla Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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:
$(if $(GO_LINT), ,go install $(GO_LINT_URI))
@echo "##### Running golangci-lint"
golangci-lint run -v

.PHONY: gosec
gosec:
$(if $(GO_SEC), ,go install $(GO_SEC_URI))
@echo "##### Running gosec"
gosec ./...

.PHONY: govulncheck
govulncheck:
$(if $(GO_VULNCHECK), ,go install $(GO_VULNCHECK_URI))
@echo "##### Running govulncheck"
govulncheck ./...

.PHONY: verify
verify: golangci-lint gosec govulncheck

.PHONY: test
test:
@echo "##### Running tests"
go test -race -cover -coverprofile=coverage.coverprofile -covermode=atomic -v ./...
Loading
Loading