140 Commits

Author SHA1 Message Date
Marwan Sulaiman
2d3250ffba Init events 2020-07-31 14:43:37 -04:00
Marwan Sulaiman
dfb7887080 Allow Athens to Propagate Authentication to Mod Download (#1650)
* Allow Athens to Propagate Authentication to Mod Download

* update readme

* add pattern matching to auth propagation

* Propagate authentication to pre declared static host

* quote redis test

* fix flaky redis error message

* fix config tests

* fix config tests

* Update config.dev.toml

Co-authored-by: Ted Wexler <ted@stuckinacan.com>

* gofmt

Co-authored-by: Ted Wexler <ted@stuckinacan.com>
2020-07-30 17:06:53 -04:00
Marwan Sulaiman
81906b918f pkg/requestid: add Request ID to Athens requests and logs (#1655)
Co-authored-by: Ted Wexler <ted@stuckinacan.com>
2020-07-27 12:37:36 -04:00
Marwan Sulaiman
408fd74a9c actions: add index handler tests (#1637) 2020-07-03 11:00:24 -04:00
Marwan Sulaiman
ef15c3458b Allow users to specify the module fetcher's temporary directory (#1636) 2020-06-25 17:15:15 -04:00
Marwan Sulaiman
52934cfa46 implement /index endpoint (#1630)
* implement /index endpoint

* rename to Module to Path
2020-06-24 14:29:30 -04:00
Marwan Sulaiman
f01c645305 pkg/middleware: add tracing to ValidationHook (#1627) 2020-06-15 16:34:24 -04:00
Marwan Sulaiman
38a6a6fe0b Add client tracing to external storage requests (#1626) 2020-06-14 11:03:48 -04:00
Elliot Morrison-Reed
c08aa890cb Fix sumdb/* paths when config.PathPrefix is set (#1620)
* Fix sumdb/* paths when config.PathPrefix is set

http.StripPrefix will look at the entire request path when called,
if we do not include config.PathPrefix then the StripPrefix call
will never receive a valid path from the application and the user
will always get a 404 error.

There were no test where I could easily check this regression so
I also added a few endpoint tests, the last test will fail with
a 404 instead of 403 if this change in not applied.

* Update cmd/proxy/actions/app_proxy.go

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>

* Update cmd/proxy/actions/app_proxy_test.go

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>

* Update cmd/proxy/actions/app_proxy_test.go

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>

* Update cmd/proxy/actions/app_proxy_test.go

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>

* Removed unneeded import of logrus

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>
2020-06-05 12:01:38 -04:00
Marwan Sulaiman
3c4db4ce86 pkg/storage: add External implementation (#1587)
* pkg/storage: add External implementation

* fix conflicts

* use newly instantiated client
2020-03-27 13:35:52 -04:00
Aaron Schlesinger
94a97fe9e9 "sumdbPoxy" ==> "sumdbProxy" (#1569)
Co-authored-by: Ted Wexler <ted@stuckinacan.com>
2020-03-20 15:18:51 -04:00
Marwan Sulaiman
0bb95c7351 pkg/storage: make Checker optional in storage.Backend (#1580)
* pkg/storage: make Checker optional in storage.Backend

* pass storage
2020-03-18 19:07:00 -04:00
Ted Wexler
939e695526 Adds redis sentinel support (#1554)
* Adds redis sentinel support

Fixes #1553

* Fix redis-sentinel test hostnames

* Fix redis master name again

* Fix redis sentinel port in tests

* Upgrade the redis client

* Rmoeve accidental config change

* Fix default config

* Addresses review comments

* Add documentation on single flight mechanisms

* Fix spelling issues

* Fix formatting

Co-authored-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
2020-03-17 13:04:37 -07:00
Matthew Plachter
71c57ef7ee add config options for redis password (#1545)
* add config options for redis password

* redis password test and failure test

* changed redis name and made a minimal redis.conf

add drone volume

volume fix

remove volumes from drone.

repoint redis path

Co-authored-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Co-authored-by: Marwan Sulaiman <marwan.sameer@gmail.com>
2020-02-25 16:18:04 -08:00
Marwan Sulaiman
34f55365a2 always use request logging middleware (#1522)
* always use request logging middleware

* reads better

* rm http-url as it is redundant

* gopls being redundant

* add color name
2020-01-20 18:25:48 -05:00
Bruno M. Custódio
221c451b6a Read basic auth credentials from a secret. (#1466)
Signed-off-by: Bruno Miguel Custódio <brunomcustodio@gmail.com>
2019-12-02 18:07:54 -08:00
Rob Prentiss
ed66d85f3f Use glob matching for package paths (#1409)
- Match the behavior of GOPRIVATE/GONOPROXY/GONOSUMDB
2019-10-02 08:45:58 -04:00
Marwan Sulaiman
298c6cd74d cmd/proxy/actions: pass NoSumPatterns to GoGetFetcher (#1391)
* cmd/proxy/actions: pass NoSumPatterns to GoGetFetcher

* add gosum unit tests

* upgrade appveyor to 1.13

* fix test typo

* check appveyor version

* AppVeyor has no 1.13

* use logger
2019-09-23 12:47:40 -04:00
Marwan Sulaiman
68ba75078b proxy/actions/sumdb: copy Go behavior for pattern matching (#1388) 2019-09-20 12:17:03 -04:00
oliverch
874d27158d feat: add /robots.txt (#1355)
* feat: add /robots.txt

* disallow all crawler by default.
2019-09-16 16:21:08 -05:00
Yi Tang
ca10728887 ref: upstream lister and it's impl to module pkg (#1309) 2019-07-25 20:40:03 -04:00
Yi Tang
7de77889ad support goproxy for list/download command (#1304) 2019-07-15 14:07:24 -04:00
Marwan Sulaiman
76fb786324 downloadProtocol: support multi-proxy environments with DownloadFile (#1230)
* downloadProtocol: support multi-proxy environments with DownloadFile

* remove debugging lines

* update config tests

* download/mode: add tests for DownloadFile and friends

* add documentation to Download File
2019-06-08 00:30:07 -04:00
Mike Yusko
c3c062b657 fix: '/catalog' endpoint, which didn't allow fetch URL query parameters (#1247)
* Fix '/catalog' endpoint, which didn't allow fetch URL query parameters

* Fix review comments
2019-05-27 15:34:16 -04:00
Marwan Sulaiman
0cac0edbf1 actions: support proxying sum db urls (#1208)
* actions: support proxying sum db urls

* remove proxy prefix

* add docs for checksum db

* more docs

* typo

* typo

* typo

* typo

* typo

* typo

* typo

* typo

* move checksum db into its own section
2019-05-08 17:09:07 -07:00
marpio
9974c16093 pkg/stash: Add Azure Blob implementation (#1162)
* add azblob sf stasher

* use http status const

* rm line

* cleanup, comments

* add test

* fix test

* skip test it no account key provided

* fix stash

* introduce stash timeout
2019-04-01 21:53:59 -07:00
Marwan Sulaiman
081ec9126e pkg/stash: Add GCS implementation (#1124)
* pkg/stash: Add GCS implementation

* fix docs
2019-03-13 11:07:07 -07:00
Marwan Sulaiman
fb9437ddff pkg/stash: implement a Redis lock for stashing (#1116)
* pkg/stash: implement a Redis lock for stashing

* fix tests

* fix op
2019-03-11 02:48:04 -04:00
Marwan Sulaiman
12ce2a6499 pkg/stash: add Etcd as a SingleFlight backend (#1070)
* pkg/stash: add Etcd as a SingleFlight backend

* fix config tests

* fmt

* pr fixes

* fix conflicts
2019-02-22 11:35:45 -08:00
Marwan Sulaiman
adb4dbb10f actions: improve basic auth tests (#1043)
* actions: improve basic auth tests

* pr fixes
2019-01-16 14:37:46 -05:00
Pascal Dierich
025fe91c6b cmd/proxy/actions: Add basic unit-tests for some proxy routes. (#1036)
* cmd/proxy/actions: Add basic unit-tests for some proxy routes.

* cmd/proxy/actions: Fail test with t.Fatal in TestHealthHandler

* cmd/actions/proxy: Remove handler tests. Keep authentication test.
2019-01-12 09:20:08 +01:00
Marwan Sulaiman
b19cbcc137 basicauth: log warning on healthz (#1039)
* basicauth: log warning on healthz

* include http path prefix
2019-01-11 13:23:28 -05:00
Marwan Sulaiman
0d94af2503 catalog: clean up unused interfaces (#1027)
* catalog: clean up unused interfaces

* fix op name
2019-01-05 15:04:46 -05:00
Manu Gupta
3b621caa85 Move catalog handler out of download protocol (#1020)
* Move catalog handler out of download protocol

* Bring back logger

* update comment
2019-01-02 21:55:07 -08:00
Marwan Sulaiman
5870aeee8d Remove Buffalo (#1010)
* Remove Buffalo

* gofmt

* pr fixes

* fix subrouter

* bring back secure middleware + pr fixes

* better place for subrouter

* vendor
2018-12-22 20:24:25 -05:00
Marwan Sulaiman
02cb18ce5e Remove unused session auth (#1011) 2018-12-22 11:17:19 -05:00
Nafis Faysal
dd801d86b1 Refactoring code to improve HTTP status code (#1005)
* refactoring code to improve HTTP status code

* refactoring code to improve HTTP status code

* refactoring code to improve HTTP status code

* refactoring code to improve HTTP status code
2018-12-20 22:15:03 +01:00
Tomasz Tomalak
fb696b2d84 Add prometheus metrics collectors for http handlers (#958)
* Add prometheus metrics exporter for http handlers

* Use prometheus from opencensus

* Add comment to unused func() param

* Add package names to operation description in observ package

* Sort exported/unexported functions
2018-12-20 10:19:22 +01:00
Manu Gupta
5eba6f2e47 File permissions on config files allow more restrictive setting (#966)
* File permissions on config files allow more restrictive setting

* Make the tests a bit more readable

* Bring back the tests dude

* Update error message

* remove else

* Add more test cases

* Change Lstat to Stat

* Add note for umask

* Make sure the permissions are 0600 or lower

* Update config file

* Do not check for windows

* Fix CI errors

* Fix CI test
2018-12-18 16:26:04 +01:00
Aravind
48f7ca7780 Implement storage.Backend for azureblob (#917) 2018-11-29 17:06:19 +01:00
Audrius Karabanovas
154c993c42 Readiness probe (#942)
* Adding readiness endpoint for readinessProbe in k8s

* liveness and readiness probes added to deployment template

* Changing endpoint to /readyz, onelining checks

* Removing DNS check as that will be covered by storage.List() call
2018-11-22 18:14:23 -05:00
Manu Gupta
035e20be56 Cookies are now not being sent to the client (#898)
* remove cors
add sessions for null

* use proper session store
2018-11-16 16:07:52 -05:00
marpio
4785e9c2b3 Remove storage timeouts (#928)
* remove storage timeouts

* fix tests
2018-11-16 16:00:08 -05:00
Marwan Sulaiman
132a75579b cmd/proxy: add /version endpoint to probe the server version (#908) 2018-11-16 10:07:48 -05:00
Brent Pendergraft
3c223dcfca add new log context middleware to store log entries in the context (#844)
* add new log context middleware to store log entries in the context

* replace LogEntryMiddleware and add NoOpLogger

* fix failing test

* move middleware to top level

* actually move middleware to top level
2018-11-06 08:46:51 -05:00
Michal Pristas
f53ab92503 Filter: fixing after refactoring (#867)
* added some clarity

* no need to handle pseudo versions

* gofmt

* tests ok

* reshuffled again
2018-11-06 00:18:18 -05:00
marpio
54f92c55d6 Config cleanup (#860)
* add default env vars

* del setRuntimeDefaults

* replace cdn conf with azure config and remove baseURL
2018-11-05 09:04:38 +01:00
Marwan Sulaiman
21dcd5a388 config: flatten Proxy struct (#846)
* config: flatten Proxy struct

* fix mw_test

* gofmt

* add line
2018-11-01 17:21:42 -04:00
Michal Pristas
c454512ba3 Netrc for windows (#831)
* netrc for windows

* Update auth.go

* fmt
2018-11-01 11:34:09 -07:00
Manu Gupta
8f4e3dc3c0 Remove FilterOff from the env var (#837)
* Remove FilterOff from the env var

* Remove test

* Turn off filter by default

* Fix test
2018-10-31 17:37:44 -04:00