@@ -43,33 +43,6 @@ type libhoneyReceiver struct {
43
43
settings * receiver.Settings
44
44
}
45
45
46
- // TeamInfo is part of the AuthInfo struct that stores the team slug
47
- type TeamInfo struct {
48
- Slug string `json:"slug"`
49
-
50
- // prevent unkeyed literal initialization
51
- _ struct {}
52
- }
53
-
54
- // EnvironmentInfo is part of the AuthInfo struct that stores the environment slug and name
55
- type EnvironmentInfo struct {
56
- Slug string `json:"slug"`
57
- Name string `json:"name"`
58
-
59
- // prevent unkeyed literal initialization
60
- _ struct {}
61
- }
62
-
63
- // AuthInfo is used by Libhoney to validate team and environment information against Honeycomb's Auth API
64
- type AuthInfo struct {
65
- APIKeyAccess map [string ]bool `json:"api_key_access"`
66
- Team TeamInfo `json:"team"`
67
- Environment EnvironmentInfo `json:"environment"`
68
-
69
- // prevent unkeyed literal initialization
70
- _ struct {}
71
- }
72
-
73
46
func newLibhoneyReceiver (cfg * Config , set * receiver.Settings ) (* libhoneyReceiver , error ) {
74
47
r := & libhoneyReceiver {
75
48
cfg : cfg ,
@@ -166,7 +139,7 @@ func (r *libhoneyReceiver) handleAuth(resp http.ResponseWriter, req *http.Reques
166
139
authURL := fmt .Sprintf ("%s/1/auth" , r .cfg .AuthAPI )
167
140
authReq , err := http .NewRequest (http .MethodGet , authURL , nil )
168
141
if err != nil {
169
- errJSON , _ := json .Marshal (`{"error": "failed to create AuthInfo request"}` )
142
+ errJSON , _ := json .Marshal (`{"error": "failed to create authInfo request"}` )
170
143
writeResponse (resp , "json" , http .StatusBadRequest , errJSON )
171
144
return
172
145
}
@@ -182,7 +155,7 @@ func (r *libhoneyReceiver) handleAuth(resp http.ResponseWriter, req *http.Reques
182
155
183
156
switch {
184
157
case authResp .StatusCode == http .StatusUnauthorized :
185
- errJSON , _ := json .Marshal (`"error": "received 401 response for AuthInfo request from Honeycomb API - check your API key"}` )
158
+ errJSON , _ := json .Marshal (`"error": "received 401 response for authInfo request from Honeycomb API - check your API key"}` )
186
159
writeResponse (resp , "json" , http .StatusBadRequest , errJSON )
187
160
return
188
161
case authResp .StatusCode > 299 :
0 commit comments