Skip to content

Commit 24aa9b3

Browse files
committed
remove unused EnvironmentInfo,AuthInfo,TeamInfo
Signed-off-by: Jared Tan <[email protected]>
1 parent 3105dd5 commit 24aa9b3

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: libhoneyreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: remove unused EnvironmentInfo,AuthInfo,TeamInfo
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [40669]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [api]

receiver/libhoneyreceiver/receiver.go

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,6 @@ type libhoneyReceiver struct {
4343
settings *receiver.Settings
4444
}
4545

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-
7346
func newLibhoneyReceiver(cfg *Config, set *receiver.Settings) (*libhoneyReceiver, error) {
7447
r := &libhoneyReceiver{
7548
cfg: cfg,
@@ -166,7 +139,7 @@ func (r *libhoneyReceiver) handleAuth(resp http.ResponseWriter, req *http.Reques
166139
authURL := fmt.Sprintf("%s/1/auth", r.cfg.AuthAPI)
167140
authReq, err := http.NewRequest(http.MethodGet, authURL, nil)
168141
if err != nil {
169-
errJSON, _ := json.Marshal(`{"error": "failed to create AuthInfo request"}`)
142+
errJSON, _ := json.Marshal(`{"error": "failed to create authInfo request"}`)
170143
writeResponse(resp, "json", http.StatusBadRequest, errJSON)
171144
return
172145
}
@@ -182,7 +155,7 @@ func (r *libhoneyReceiver) handleAuth(resp http.ResponseWriter, req *http.Reques
182155

183156
switch {
184157
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"}`)
186159
writeResponse(resp, "json", http.StatusBadRequest, errJSON)
187160
return
188161
case authResp.StatusCode > 299:

0 commit comments

Comments
 (0)