Authn: Stat registration (#62934)

* reorganize auth usage stats

* usage stat privilege elevators

* stat count of modified role

* cfg related info

* add authn anon client

* kv store

* ensure anon enabled is collected even if client is not registered

* fix usage stats test
This commit is contained in:
Jo
2023-02-06 17:23:53 +01:00
committed by GitHub
parent ac942d5e72
commit 14a78b58e9
9 changed files with 114 additions and 48 deletions

View File

@@ -114,6 +114,13 @@ type ProxyClient interface {
AuthenticateProxy(ctx context.Context, r *Request, username string, additional map[string]string) (*Identity, error)
}
// UsageStatClient is an optional interface that auth clients can implement.
// Clients that implements this interface can specify a usage stat collection hook
type UsageStatClient interface {
Client
UsageStatFn(ctx context.Context) (map[string]interface{}, error)
}
type Request struct {
// OrgID will be populated by authn.Service
OrgID int64