AuthN: Add auth proxy client (#61555)

* AuthN: set up boilerplate for proxy client

* AuthN: Implement Test for proxy client

* AuthN: parse accept list in constructor

* AuthN: add proxy client interface

* AuthN: handle error

* AuthN: Implement the proxy client interface for ldap

* AuthN: change reciever name

* AuthN: add grafana as a proxy client

* AuthN: for error returned

* AuthN: add tests for grafana proxy auth

* AuthN: swap order of grafan and ldap auth

* AuthN: Parse additional proxy headers in proxy client and pass down
This commit is contained in:
Karl Persson
2023-01-17 10:07:46 +01:00
committed by GitHub
parent c1d3b59643
commit b44b6fc5c6
11 changed files with 678 additions and 33 deletions

View File

@@ -25,6 +25,7 @@ const (
ClientRender = "auth.client.render"
ClientSession = "auth.client.session"
ClientForm = "auth.client.form"
ClientProxy = "auth.client.proxy"
)
const (
@@ -72,6 +73,10 @@ type PasswordClient interface {
AuthenticatePassword(ctx context.Context, r *Request, username, password string) (*Identity, error)
}
type ProxyClient interface {
AuthenticateProxy(ctx context.Context, r *Request, username string, additional map[string]string) (*Identity, error)
}
type Request struct {
// OrgID will be populated by authn.Service
OrgID int64