mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 16:59:22 +02:00
wip
This commit is contained in:
parent
2ad3493c80
commit
3617c67e41
5 changed files with 78 additions and 60 deletions
|
@ -34,11 +34,7 @@ func (a *Authorize) Check(ctx context.Context, in *envoy_service_auth_v3.CheckRe
|
|||
ctx, span := a.tracer.Start(ctx, "authorize.grpc.Check")
|
||||
defer span.End()
|
||||
|
||||
querier := storage.NewCachingQuerier(
|
||||
storage.NewQuerier(a.state.Load().dataBrokerClient),
|
||||
storage.GlobalCache,
|
||||
)
|
||||
ctx = storage.WithQuerier(ctx, querier)
|
||||
ctx = a.withQuerierForCheckRequest(ctx)
|
||||
|
||||
state := a.state.Load()
|
||||
|
||||
|
@ -172,6 +168,14 @@ func (a *Authorize) getMatchingPolicy(routeID uint64) *config.Policy {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (a *Authorize) withQuerierForCheckRequest(ctx context.Context) context.Context {
|
||||
querier := storage.NewCachingQuerier(
|
||||
storage.NewQuerier(a.state.Load().dataBrokerClient),
|
||||
storage.GlobalCache,
|
||||
)
|
||||
return storage.WithQuerier(ctx, querier)
|
||||
}
|
||||
|
||||
func getHTTPRequestFromCheckRequest(req *envoy_service_auth_v3.CheckRequest) *http.Request {
|
||||
hattrs := req.GetAttributes().GetRequest().GetHttp()
|
||||
u := getCheckRequestURL(req)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue