Skip to content

Commit

Permalink
[client] Remove experimental comment from Metadata (#9796)
Browse files Browse the repository at this point in the history
**Description:** 
Removes the `experimental` tag from `Metadata`. This feature has been
used in the headerssetter extension since Aug 2022.

**Link to tracking Issue:** 
Relates to
#9381
Related to
#9795
  • Loading branch information
TylerHelmuth committed Mar 27, 2024
1 parent 351fcf6 commit f237238
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions client/client.go
Expand Up @@ -98,15 +98,9 @@ type Info struct {
Auth AuthData

// Metadata is the request metadata from the client connecting to this connector.
// Experimental: *NOTE* this structure is subject to change or removal in the future.
Metadata Metadata
}

// Metadata is an immutable map, meant to contain request metadata.
type Metadata struct {
data map[string][]string
}

// AuthData represents the authentication data as seen by authenticators tied to
// the receivers.
type AuthData interface {
Expand All @@ -116,8 +110,7 @@ type AuthData interface {
// "membership" might return a list of strings.
GetAttribute(string) any

// GetAttributes returns the names of all attributes in this authentication
// data.
// GetAttributeNames returns the names of all attributes in this authentication data.
GetAttributeNames() []string
}

Expand All @@ -139,7 +132,12 @@ func FromContext(ctx context.Context) Info {
return c
}

// NewMetadata creates a new Metadata object to use in Info. md is used as-is.
// Metadata is an immutable map, meant to contain request metadata.
type Metadata struct {
data map[string][]string
}

// NewMetadata creates a new Metadata object to use in Info.
func NewMetadata(md map[string][]string) Metadata {
c := make(map[string][]string, len(md))
for k, v := range md {
Expand All @@ -151,6 +149,7 @@ func NewMetadata(md map[string][]string) Metadata {
}

// Get gets the value of the key from metadata, returning a copy.
// The key lookup is case-insensitive.
func (m Metadata) Get(key string) []string {
if len(m.data) == 0 {
return nil
Expand Down

0 comments on commit f237238

Please sign in to comment.