projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
19217: Silence SQL logs during database reset.
[arvados.git]
/
services
/
ws
/
permission.go
diff --git
a/services/ws/permission.go
b/services/ws/permission.go
index 8bfcfcb9e69cf1699b2f335e766dd71c636b733c..ac895f80e5fd7ae7933558fbfa6e6acb97a6c7b0 100644
(file)
--- a/
services/ws/permission.go
+++ b/
services/ws/permission.go
@@
-1,11
+1,17
@@
-package main
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+package ws
import (
import (
+ "context"
"net/http"
"net/url"
"time"
"net/http"
"net/url"
"time"
- "git.curoverse.com/arvados.git/sdk/go/arvados"
+ "git.arvados.org/arvados.git/sdk/go/arvados"
+ "git.arvados.org/arvados.git/sdk/go/ctxlog"
)
const (
)
const (
@@
-15,7
+21,7
@@
const (
type permChecker interface {
SetToken(token string)
type permChecker interface {
SetToken(token string)
- Check(uuid string) (bool, error)
+ Check(
ctx context.Context,
uuid string) (bool, error)
}
func newPermChecker(ac arvados.Client) permChecker {
}
func newPermChecker(ac arvados.Client) permChecker {
@@
-50,9
+56,9
@@
func (pc *cachingPermChecker) SetToken(token string) {
pc.cache = make(map[string]cacheEnt)
}
pc.cache = make(map[string]cacheEnt)
}
-func (pc *cachingPermChecker) Check(uuid string) (bool, error) {
+func (pc *cachingPermChecker) Check(
ctx context.Context,
uuid string) (bool, error) {
pc.nChecks++
pc.nChecks++
- logger :=
logger(nil
).
+ logger :=
ctxlog.FromContext(ctx
).
WithField("token", pc.Client.AuthToken).
WithField("uuid", uuid)
pc.tidy()
WithField("token", pc.Client.AuthToken).
WithField("uuid", uuid)
pc.tidy()
@@
-70,7
+76,8
@@
func (pc *cachingPermChecker) Check(uuid string) (bool, error) {
pc.nMisses++
err = pc.RequestAndDecode(&buf, "GET", path, nil, url.Values{
pc.nMisses++
err = pc.RequestAndDecode(&buf, "GET", path, nil, url.Values{
- "select": {`["uuid"]`},
+ "include_trash": {"true"},
+ "select": {`["uuid"]`},
})
var allowed bool
})
var allowed bool