@@ -18,15 +18,15 @@ import (
18
18
type Server interface {
19
19
extension.Extension
20
20
21
- // Authenticate checks whether the given headers map contains valid auth data. Successfully authenticated calls will always return a nil error.
21
+ // Authenticate checks whether the given map contains valid auth data. Successfully authenticated calls will always return a nil error.
22
22
// When the authentication fails, an error must be returned and the caller must not retry. This function is typically called from interceptors,
23
23
// on behalf of receivers, but receivers can still call this directly if the usage of interceptors isn't suitable.
24
24
// The deadline and cancellation given to this function must be respected, but note that authentication data has to be part of the map, not context.
25
25
// The resulting context should contain the authentication data, such as the principal/username, group membership (if available), and the raw
26
26
// authentication data (if possible). This will allow other components in the pipeline to make decisions based on that data, such as routing based
27
27
// on tenancy as determined by the group membership, or passing through the authentication data to the next collector/backend.
28
28
// The context keys to be used are not defined yet.
29
- Authenticate (ctx context.Context , headers map [string ][]string ) (context.Context , error )
29
+ Authenticate (ctx context.Context , sources map [string ][]string ) (context.Context , error )
30
30
}
31
31
32
32
type defaultServer struct {
@@ -39,14 +39,14 @@ type defaultServer struct {
39
39
type ServerOption func (* defaultServer )
40
40
41
41
// ServerAuthenticateFunc defines the signature for the function responsible for performing the authentication based
42
- // on the given headers map. See Server.Authenticate.
43
- type ServerAuthenticateFunc func (ctx context.Context , headers map [string ][]string ) (context.Context , error )
42
+ // on the given sources map. See Server.Authenticate.
43
+ type ServerAuthenticateFunc func (ctx context.Context , sources map [string ][]string ) (context.Context , error )
44
44
45
- func (f ServerAuthenticateFunc ) Authenticate (ctx context.Context , headers map [string ][]string ) (context.Context , error ) {
45
+ func (f ServerAuthenticateFunc ) Authenticate (ctx context.Context , sources map [string ][]string ) (context.Context , error ) {
46
46
if f == nil {
47
47
return ctx , nil
48
48
}
49
- return f (ctx , headers )
49
+ return f (ctx , sources )
50
50
}
51
51
52
52
// WithServerAuthenticate specifies which function to use to perform the authentication.
0 commit comments