Commit Graph

36 Commits

Author SHA1 Message Date
Endless Paradox
5f458dd1a6
feat(auth): add proxy-server authentication (#3877) 2024-03-11 22:22:58 +08:00
thinkerou
4b68a5f12a
chore: update go.mod and remove space from copyright (#3158)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-28 10:42:28 +08:00
Lanco
d8e053d15f
use StringToBytes func (#2798) 2022-04-23 18:01:41 +08:00
Snawoot
b01605bb5b
basic auth: fix timing oracle (#2609)
Co-authored-by: thinkerou <thinkerou@gmail.com>
2021-01-13 09:40:37 +08:00
thinkerou
54175dbe72
chore: update the result of CR (#2354)
* chore: update the result of CR

* Update utils.go

* Update utils.go

* Update context.go

* Update context.go
2020-05-04 11:40:41 +08:00
Andy Pan
982daeb1ec Use zero-copy approach to convert types between string and byte… (#2206)
* Use zero-copy approach to convert types between string and byte slice

* Rename argument to a eligible one

Benchmark:

BenchmarkBytesConvBytesToStrRaw-4   	21003800	        70.9 ns/op	      96 B/op	       1 allocs/op
BenchmarkBytesConvBytesToStr-4      	1000000000	         0.333 ns/op	       0 B/op	       0 allocs/op
BenchmarkBytesConvStrToBytesRaw-4   	18478059	        59.3 ns/op	      96 B/op	       1 allocs/op
BenchmarkBytesConvStrToBytes-4      	1000000000	         0.373 ns/op	       0 B/op	       0 allocs/op


Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-01-18 00:32:50 +08:00
Andrew Szeto
5612cadb73 Remove unused code (#2013) 2019-08-10 09:26:58 +08:00
田欧
6c6d97ba2e remove hardcode instead of http status value (#1411) 2018-06-26 17:21:32 +08:00
田欧
b70b8ab20c use lower if the struct is private (#1185) 2017-12-17 13:02:33 +08:00
田欧
3b300929e8 Empty string check (#1101) 2017-09-29 00:22:35 +08:00
Bo-Yi Wu
211c48f040 refactor: using requestHeader internal func (#1083)
* refactor: using requestHeader internal func.

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-08-26 12:02:47 +02:00
田欧
a8fa424ae5 update comment (#1057) 2017-08-16 11:55:50 +08:00
田欧
7b508186dd style: remove optional return (#1036) 2017-07-19 14:49:18 +02:00
田欧
b539606eed use return not use else (#1028) 2017-07-17 19:54:38 -05:00
田欧
31ac11a298 update comment method (#977) 2017-07-05 04:37:24 -05:00
田欧
d535fcd598 separate type define (#975) 2017-07-05 02:47:36 -05:00
Javier Provecho Fernandez
89f0acc2f8 docs(auth): add missing logs for auth.go 2017-07-02 16:54:49 +02:00
Manu Mtz.-Almeida
d64a1fb91c Cosmetic changes 2016-01-28 00:35:09 +01:00
Manu Mtz-Almeida
8f3047814e Comments + IRoutes + IRouter + unexported AbortIndex 2015-07-02 20:24:54 +02:00
Manu Mtz-Almeida
f2ab821223 Dropping bsearch in BasicAuth() 2015-05-19 20:35:38 +02:00
Manu Mtz-Almeida
bb98ec0490 Cosmetic changes in auth.go 2015-05-19 20:20:52 +02:00
Manu Mtz-Almeida
81b08a554e Fixes important bug in Basic Auth when using custom realm. 2015-05-19 20:15:28 +02:00
Manu Mtz-Almeida
ac1ee3fb86 Adds unit tests for Utils 2015-04-08 15:32:50 +02:00
Manu Mtz-Almeida
a28104fa21 Better unit tests for BasicAuth middleware 2015-04-08 15:17:41 +02:00
Manu Mtz-Almeida
8b26264574 Merge branch 'develop' into performance
Conflicts:
	context.go
	context_test.go
	gin_test.go
	recovery_test.go
	utils.go
2015-04-08 13:37:25 +02:00
Manu Mtz-Almeida
ac0ad2fed8 Improves unit tests 2015-04-08 02:58:35 +02:00
Manu Mtz-Almeida
af4980ece2 Performance improvement in Auth middleware 2015-04-07 20:00:10 +02:00
Manu Mtz-Almeida
3e3ced70d4 Using log.Panic instead 2015-03-23 05:50:10 +01:00
Manu Mtz-Almeida
4103061a4a Refactores BasicAuth 2015-03-23 04:38:32 +01:00
Frank Bille
07c0d2e8fe Add customizable Realm for Basic authentication
Depending on the use case, it might be useful to be able to have different realms for different route groups.
2015-03-04 23:15:03 +01:00
Manu Mtz-Almeida
aa7b00a083 General refactoring. Part 2. 2014-10-09 01:40:42 +02:00
Manu Mtz-Almeida
8e5397bfa0 Adds in-code license 2014-08-29 19:49:50 +02:00
Manu Mtz-Almeida
2078ecd8e1 Renaming Context.Req to Context.Request 2014-07-08 16:57:04 +02:00
Manu Mtz-Almeida
661398ca53 Nicer BasicAuth API 2014-07-04 04:28:25 +02:00
Manu Mtz-Almeida
b0797e2bf9 Fixes Basic HTTP Authorization middleware 2014-07-01 22:58:29 +02:00
Manu Mtz-Almeida
15216a0883 Initial commit 2014-06-18 01:42:34 +02:00