Remove debug auth logs (#1426)
Co-authored-by: Ben Toogood <ben@micro.mu>
This commit is contained in:
parent
e204f3e2e8
commit
1a53307a78
@ -124,8 +124,6 @@ func (s *svc) Revoke(role string, res *auth.Resource) error {
|
|||||||
|
|
||||||
// Verify an account has access to a resource
|
// Verify an account has access to a resource
|
||||||
func (s *svc) Verify(acc *auth.Account, res *auth.Resource) error {
|
func (s *svc) Verify(acc *auth.Account, res *auth.Resource) error {
|
||||||
log.Infof("%v requesting access to %v:%v:%v", acc.ID, res.Type, res.Name, res.Endpoint)
|
|
||||||
|
|
||||||
queries := [][]string{
|
queries := [][]string{
|
||||||
{res.Type, res.Name, res.Endpoint}, // check for specific role, e.g. service.foo.ListFoo:admin (role is checked in accessForRule)
|
{res.Type, res.Name, res.Endpoint}, // check for specific role, e.g. service.foo.ListFoo:admin (role is checked in accessForRule)
|
||||||
{res.Type, res.Name, "*"}, // check for wildcard endpoint, e.g. service.foo*
|
{res.Type, res.Name, "*"}, // check for wildcard endpoint, e.g. service.foo*
|
||||||
@ -144,8 +142,6 @@ func (s *svc) Verify(acc *auth.Account, res *auth.Resource) error {
|
|||||||
|
|
||||||
for _, q := range queries {
|
for _, q := range queries {
|
||||||
for _, rule := range s.listRules(q...) {
|
for _, rule := range s.listRules(q...) {
|
||||||
log.Infof("Checking rule: %v for resource: %v:%v:%v", rule.Id, res.Type, res.Name, res.Endpoint)
|
|
||||||
|
|
||||||
switch accessForRule(rule, acc, res) {
|
switch accessForRule(rule, acc, res) {
|
||||||
case rulePb.Access_UNKNOWN:
|
case rulePb.Access_UNKNOWN:
|
||||||
continue // rule did not specify access, check the next rule
|
continue // rule did not specify access, check the next rule
|
||||||
@ -248,7 +244,6 @@ func (s *svc) listRules(filters ...string) []*rulePb.Rule {
|
|||||||
|
|
||||||
// loadRules retrieves the rules from the auth service
|
// loadRules retrieves the rules from the auth service
|
||||||
func (s *svc) loadRules() {
|
func (s *svc) loadRules() {
|
||||||
log.Infof("Loading rules from auth service")
|
|
||||||
rsp, err := s.rule.List(context.TODO(), &rulePb.ListRequest{})
|
rsp, err := s.rule.List(context.TODO(), &rulePb.ListRequest{})
|
||||||
s.Lock()
|
s.Lock()
|
||||||
defer s.Unlock()
|
defer s.Unlock()
|
||||||
@ -258,7 +253,6 @@ func (s *svc) loadRules() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("Loaded %v rules from the auth service", len(rsp.Rules))
|
|
||||||
s.rules = rsp.Rules
|
s.rules = rsp.Rules
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user