Commit Graph

31 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
Aaron Schlesinger
1acdf17a4a Reverting passthrough auth (#1700)
* Reverting PR 1650

https://github.com/gomods/athens/pull/1650 was a big change to the
authentication/authorization code, which we have decided to pull
out and potentially move into a separate process/project

Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>

* removing commented, unused code

Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>

* removing more commented, unused code

Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>

* removing more unused code

Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
2021-03-11 11:28:15 -08: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
ef15c3458b Allow users to specify the module fetcher's temporary directory (#1636) 2020-06-25 17:15:15 -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
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
7519a77bbe pkg/module: return KindNotFound on incorrect mod download (#1300) 2019-07-08 14:36:18 -07:00
marpio
8e5b6981d3 Remove dummy mod dir (#1121) 2019-05-03 22:52:36 +02:00
Mark D
ef3d69ea4a Fix for issue #1192 (#1193)
* adding support for lower case http proxy env variables

* adding in extra blank line
2019-04-22 11:18:27 -07:00
dfinkel
a7aee5b235 pkg/module: include SSH_AUTH_SOCK in go get env (#1184)
* pkg/module: include SSH_AUTH_SOCK in go get env

When running locally, it's convenient to use a user's ssh-agent. For
that to work, we need to propagate SSH_AUTH_SOCK.

* pkg/module: Verify existence for SSH_AUTH_SOCK

SSH_AUTH_SOCK is expected to indicate a unix socket on the local
filesystem. If it isn't a unix socket (after symlink resolution) we can
ignore it. (although ssh will ignore it as well)
2019-04-09 14:54:47 -07:00
Marwan Sulaiman
16c6b029ac pkg/module: include SSH environments (#1164) 2019-03-28 13:54:36 -04:00
Marwan Sulaiman
f0e931311b pkg/stash: allow nonsemver requests to be resolved properly (#1015) 2019-01-07 20:51:22 -05:00
Pontus Leitzler
5ab820de96 Propagate HOME env to go command execution (#960) 2018-12-06 11:12:24 -08:00
marpio
bc4e533d49 Use go mod download -json (#710)
* use go mod download -json

* annotate json, fix build

* add comment

* address review feedback
2018-10-01 20:53:17 +02:00
Marwan Sulaiman
5dcaeb8ab8 Trace stash operations (#682)
* Trace stash operations

* fix build
2018-09-20 10:59:42 -04:00
tnextday
d4c1363d9c Add HTTP_PROXY environment variable to go_get_fetcher (#668)
* Add HTTP_PROXY env to go_get_fetcher

* gofmt
2018-09-17 20:28:42 +02:00
marpio
f25c427239 Fix for Windows 10 (#648)
* ps: add cdefault conf

* init - add config

* add required env vars for win10

* update test_e2e.ps1 to use go build -mod=vendor
2018-09-13 13:57:37 -07:00
Marwan Sulaiman
ea96158f8f Athens: introduce Single Flight (#573)
* Athens: introduce singleflight

* fix ci

* small fixes

* Remove unnecessary method

* simplify folder structure

* dcoument stasher iface

* fixes

* Fix olympus

* Remove Version from Download Protocol

* fix olympus

* refactor fetcher

* consolodate wrapping styles

* fix olympus

* Further refactoring

* fix typo
2018-09-03 16:31:13 -04:00
Marwan Sulaiman
4a618990a2 pkg/download/goget: ensure each List func gets its own GOPATH (#559)
* pkg/download/goget: ensure each List func gets its own GOPATH

* Add list tests

* fix diskref tests
2018-08-24 10:19:17 -04:00
marpio
76121fb5cb Fix running the athens proxy on windows (#554)
* use parent env

* rename

* use only required vars

* review feedback

* add windows env vars

* ups

* fix

* rm op
2018-08-24 01:55:55 -04:00
Marwan Sulaiman
889de448dc Fetcher: switch to mod download (#448) 2018-08-15 12:33:00 -04:00
Marwan Sulaiman
44625459fc Download: move cache location (#404)
* Download: move cache location

* beta3

* trying differnet repo

* avoid go breaking stuff
2018-08-04 11:29:30 -07:00
Dinesh Kumar
85213f20b3 Goget Fetcher should error out if gobinpath is not valid (#377)
* Goget fetcher should error out if gobinpath is not valid

* Propogating the error from goget initialisation to main, to stop application

* wrapping errors with op, using exec.command(gobin).Run to verify gobin, clean up

* Inlining afero fs to goget call, and new go getfetcher

* Revert "Inlining afero fs to goget call, and new go getfetcher"

This reverts commit ae31fe6a2b.

* Fixing example test
2018-08-02 10:00:37 -04:00
Marwan Sulaiman
441e21d281 Proxy: fill cache on Protocol.Version (#374) 2018-07-31 23:11:49 -07:00
Rohan Chakravarthy
bbe1ce1873 zip.Close() also clears the GOPATH of the underlying diskRef (#367)
* zip.Close() also clears underlying diskRef

* remove unnecessary constructor

* use GoBinPath() in example
2018-07-31 12:38:45 -04:00
Rohan Chakravarthy
c7d0c0a8e6 Ensure diskRef cleans up everything in it's own GOPATH (#354)
* Ensure diskRef cleans up everything in it's own GOPATH

* cleanup diskref opens. Fix err return in go_get_fetcher

* Remove Noop ref from go_get_fetcher.Fetch()

* handle temp dir cleanup and return nil diskref
2018-07-30 19:14:06 -04:00
Marwan Sulaiman
add15e68cd download: clean up Kahona (#345) 2018-07-27 15:18:14 -07:00
Carolyn Van Slyck
fd7c1326d3 Backfill the cache on a miss (#342)
* add middlewares to fill the cache and to populate contexts with module and versions

* Carolyn tries to fix Aaron's code

* #DOINSTUFF

* updated env var

* fix all the things

* magic patch for olympus

* Add latest handler

* Remove deprecated return param

* go fmt all the things
2018-07-27 14:37:23 -07:00
Marwan Sulaiman
7b590b1885 download: add list from go cli (#336)
* download: add list from go cli

* download: include goget tests + hacky hack

* download: move dummyMod to pkg/module

* Olympus: pass dp and lggr to /list

* download: add Version to interface

* download: document Protocol
2018-07-27 11:56:32 -07:00
Aaron Schlesinger
ab9a4c0f41 Moving the fetch logic into 'pkg/module' (#291)
* add module fetch and fetchers

* Breaking module ref out of the fetcher

* disk ref in progress

* very broken go get fetcher

* refactoring ref and fixing up the disk ref

* adding a test for the disk ref

* doing test setup right

* passing version

* fixing syntax err

* removing raw format string

in favor of a function that does the same thing

* removing obsolete godoc

* removing the switch in favor of nested if statements

hopefully this is easier to read

* passing data into the format strings

* refactoring the closer

* creating and looking for files in the root

* genericFetcher => goGetFetcher

* remove the clear method on go get fetcher

the ref returned from fetch does it

* remove unnecessary call to isVgoInstalled

calls to fetch will fail if vgo is not installed

* remove unneeded dirName

* adding preliminary test for the go get fetcher

* adding a test for fetch

* executing fetch test

* adding docs and simplifying the fetcher

* declaring the storage version up front

* fixing the source path

* creating test files in a separate function

* closing files immediately

instead of aggregating them for later. whaaat was I thinking???

* passing context into storage driver

* not closing the source file

* not putting the module name in quotes anymore

* adding a warning about deleting the package

* adding go binary name

* embedding github API limit error

* check files in the success path

* passing errors up

not just messages

* doh

* using vgo for the go get fetcher tests

* not using multierror because it's unneeded

* less code 😄

* custom error

* removing unused import

* return noop refs

* adding link to issue for the TODO

* simplifying

* simplifying moar!

* using config.FmtModVer

* simplifying

* defer closing the zip

* closing the zip

* adding comment about closing the ver.Zip

* GO_BINARY_NAME => GO_BINARY_PATH

* using errors pkg

* fixing compile err

* removing redundant args

* removing requirement that caller calls Clear on fetch error

* fixing build

* fix

* adding masterminds semver

* returning better error

and checking version format

* removing unused error

* using proper semver function

* fixin compile err

* rm that shizz
2018-07-26 13:08:07 -07:00