mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 18:36:30 +02:00
authorize: fix not found check (#3410)
This commit is contained in:
parent
4635509d5c
commit
493148b13f
2 changed files with 6 additions and 2 deletions
|
@ -3,11 +3,10 @@ package authorize
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/open-policy-agent/opa/storage"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/telemetry/trace"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/session"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/user"
|
||||
"github.com/pomerium/pomerium/pkg/storage"
|
||||
)
|
||||
|
||||
type sessionOrServiceAccount interface {
|
||||
|
|
|
@ -113,3 +113,8 @@ func matchProtoMapValue(fd protoreflect.FieldDescriptor, m protoreflect.Map, que
|
|||
})
|
||||
return matches
|
||||
}
|
||||
|
||||
// IsNotFound returns true if the error is because a record was not found.
|
||||
func IsNotFound(err error) bool {
|
||||
return errors.Is(err, ErrNotFound) || status.Code(err) == codes.NotFound
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue