Commit Graph

12 Commits

Author SHA1 Message Date
Nicholas Wiersma
d932d50232 chore: lint code with golangci-lint (#1828)
* feat: add golangci-lint linting

* chore: fix linter issues

* feat: add linting into the workflow

* docs: update lint docs

* fix: cr suggestions

* fix: remove old formatting and vetting scripts

* fix: add docker make target

* fix: action go caching

* fix: depreciated actions checkout version

* fix: cr suggestion

* fix: cr suggestions

---------

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-02-24 20:39:17 -08:00
Ashish Ranjan
3f26845cff move to github actions from drone (#1823)
* add github actions workflow for tag releases

* migrate drone build &test step to github actions

* fix minio service

* fix indentation

* fix dependency syntax

* remove needs keyword

* fix service hostnames, add protectedredis

* update protected redis docker image

* fix too many args error

* exclude vendor dir from gofmt

* fix fmt errors

* fix fmt errors

* rm .drone.yml

* rename workflow name

* break test step

* remove vendor step

* use makefile rule

* use buildx
2023-02-22 22:47:37 -08:00
Federico Paolinelli
04c6bbed90 Filter (#1075)
* Working tests

* More tests, a bugfix (yay tests) and docs

* Changed filter description adding v prefix to versions

* Updated docs to be more precise

* More robust, changed docs

* Fixed copy paste bug
2019-03-18 22:07:27 -07:00
Chad Kunde
7811524c22 Version filtering (#1050)
* extend filtering logic and configuration to include version lists

Module filtering is very useful, but many deployments will need to
satisfy even more granular constrainsts.  Enterprises may need
approved lists specific down to the minor (or patch) version element.

Version filtering logic is similar to the module filtering, in that
it's a prefix match of the version requested against each entry in the
version filter list.

Closes #1045

* include version filtering in documentation with example

* allow filtering when version is missing

Endpoints that do not specify a version, such as "@v/list", only need
to be filtered by module rules.
2019-02-05 09:04:09 +01:00
Manu Gupta
9cca0ada44 Filter file configuration set up (#840)
* When the filter file is missing throw a fatal

* Ignore path when file is not specified

* Fix build failure on ci

* Remove logs

* Fix propagate and handle errors

* Fix build error

* Actually check filter file

* Check for errors in the test suite as well

* Improve test coverage

* Add more tests

* Simplify NewFilter function

* Make file format rules pretty stringent

* Fix test failure

* Show line numbers on errors as well

* Fix typo

* Fix typo again
2018-11-01 13:51:12 +01:00
Manu Gupta
657c9d04a3 If a filter file is not found and is in config, throw an error (#788)
* When the filter file is missing throw a fatal

* Ignore path when file is not specified

* Fix build failure on ci

* Remove logs

* Fix propagate and handle errors

* Fix build error

* Actually check filter file

* Check for errors in the test suite as well

* Improve test coverage

* Add more tests

* Simplify NewFilter function

* Address review comments
2018-10-31 10:08:15 -07:00
Rohan Chakravarthy
0e470d0294 Plumb config - Latest (#627)
* switch proxy to config file

pull in single flight changes

* changes for single-flight

* intermediate stage. All tests passing. pkg still has env refs

* remove all env references

* delete config/env entirely

* fix failing tests

* create the config.toml file as part of dev setup

* create config file only if it doesn't exist

* update Dockerfiles to use config file

* move composing elements to the top

* verbose parameter naming

* newline

* add flag for config file path

* update docs with config file flag

* remove unnecessary nil check

* use filepath.join

* rename redis port to address

* fix path.join

* fix issues after merge

* add vendor dir
2018-09-11 15:04:20 -07:00
Marwan Sulaiman
78687a7948 pkg/module: fix comment (#485) 2018-08-14 17:03:16 -07:00
Michal Pristas
327fecaedd rename Private to Direct (#481) 2018-08-14 11:13:36 +02:00
Michal Pristas
72a4af135a Removed ShouldProcess (#480)
* removed shouldProcess
* avoid Default as a return value for Rule
2018-08-14 10:28:39 +02:00
Federico Paolinelli
e6d4996bad Added support for private repos (#456)
* Added filter for private repos. Non private repos get redirected to
olympus

* Changed filter to allow private modules

* Changed config file name function

* Added filter tests

* The middleware returns 200 for privates, redirects public, 404 for
disabled repos

* Removed printf

* Removed forgotten printf

* Removed logger from the middleware func, not used anymore

* Removed unused (uncommented) function

* Replaced 404 with 403 in case of banned modules

* Fixed test path / cleaned olympus endpoint suffix

* Added error operation to GetVersion

* Moved filter test in custom file, reverted injection of the filter into
the app

* Removed white line

* Clarified comment for ignoring getversion error

* Added todo comment to fill the cache and serve the request with the
cache

* Added error handling to filter

* Removed commented early version of the test
2018-08-13 16:35:17 -07:00
Michal Pristas
514ac49659 Support for exclude include (#212)
* almost there

* loading file

* fixed after real test

* fixed includes"

* configurable filter name

* custom error
2018-07-09 09:58:51 -07:00