@@ -37,6 +37,7 @@ const (
37
37
headerOrganization = "x-apigee-organization"
38
38
headerScope = "x-apigee-scope"
39
39
headerCustomAttributes = "x-apigee-customattributes"
40
+ headerAnalyticsProduct = "x-apigee-analytics-product"
40
41
)
41
42
42
43
// encodeExtAuthzMetadata encodes given api and auth context into
@@ -47,15 +48,16 @@ func encodeExtAuthzMetadata(api string, ac *auth.Context, authorized bool) *stru
47
48
}
48
49
49
50
fields := map [string ]* structpb.Value {
50
- headerAccessToken : stringValueFrom (ac .AccessToken ),
51
- headerAPI : stringValueFrom (api ),
52
- headerAPIProducts : stringValueFrom (strings .Join (ac .APIProducts , "," )),
53
- headerApplication : stringValueFrom (ac .Application ),
54
- headerClientID : stringValueFrom (ac .ClientID ),
55
- headerDeveloperEmail : stringValueFrom (ac .DeveloperEmail ),
56
- headerEnvironment : stringValueFrom (ac .Environment ()),
57
- headerOrganization : stringValueFrom (ac .Organization ()),
58
- headerScope : stringValueFrom (strings .Join (ac .Scopes , " " )),
51
+ headerAccessToken : stringValueFrom (ac .AccessToken ),
52
+ headerAPI : stringValueFrom (api ),
53
+ headerAPIProducts : stringValueFrom (strings .Join (ac .APIProducts , "," )),
54
+ headerApplication : stringValueFrom (ac .Application ),
55
+ headerClientID : stringValueFrom (ac .ClientID ),
56
+ headerDeveloperEmail : stringValueFrom (ac .DeveloperEmail ),
57
+ headerEnvironment : stringValueFrom (ac .Environment ()),
58
+ headerOrganization : stringValueFrom (ac .Organization ()),
59
+ headerScope : stringValueFrom (strings .Join (ac .Scopes , " " )),
60
+ headerAnalyticsProduct : stringValueFrom ((ac .AnalyticsProduct )),
59
61
}
60
62
61
63
if ac .CustomAttributes != "" {
@@ -133,5 +135,6 @@ func (h *Handler) decodeExtAuthzMetadata(fields map[string]*structpb.Value) (str
133
135
DeveloperEmail : fields [headerDeveloperEmail ].GetStringValue (),
134
136
Scopes : strings .Split (fields [headerScope ].GetStringValue (), " " ),
135
137
CustomAttributes : fields [headerCustomAttributes ].GetStringValue (),
138
+ AnalyticsProduct : fields [headerAnalyticsProduct ].GetStringValue (),
136
139
}
137
140
}
0 commit comments