mirror of
https://github.com/gomods/athens
synced 2026-02-03 12:10:32 +00:00
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>
This commit is contained in:
committed by
GitHub
parent
93cef4f37f
commit
1acdf17a4a
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/gomods/athens/pkg/auth"
|
||||
"github.com/gomods/athens/pkg/errors"
|
||||
"github.com/gomods/athens/pkg/index"
|
||||
"github.com/gomods/athens/pkg/log"
|
||||
@@ -53,12 +52,8 @@ func (s *stasher) Stash(ctx context.Context, mod, ver string) (string, error) {
|
||||
|
||||
// create a new context that ditches whatever deadline the caller passed
|
||||
// but keep the tracing info so that we can properly trace the whole thing.
|
||||
tok, ok := auth.FromContext(ctx)
|
||||
ctx, cancel := context.WithTimeout(trace.NewContext(context.Background(), span), time.Minute*10)
|
||||
defer cancel()
|
||||
if ok {
|
||||
ctx = auth.SetAuthInContext(ctx, tok)
|
||||
}
|
||||
v, err := s.fetchModule(ctx, mod, ver)
|
||||
if err != nil {
|
||||
return "", errors.E(op, err)
|
||||
|
||||
Reference in New Issue
Block a user