Skip to content

Commit 9861f79

Browse files
Added logging of auth error in http util (#222)
1 parent c7d2a47 commit 9861f79

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

utils/http/http.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ func (httpRequest *HttpOptions) handleResponse(response *http.Response) ([]byte,
137137
func verifyAuthInfoMatchesAgentTarget(
138138
target *cacao.AgentTarget, authInfo *cacao.AuthenticationInformation,
139139
) error {
140+
log.Trace("target id: ", target.AuthInfoIdentifier, " auth info object id: ", authInfo.ID)
140141
if target.AuthInfoIdentifier == "" || authInfo.ID == "" {
141142
return errors.New("target target.AuthInfoIndentifier or authInfo.ID is empty")
142143
}
@@ -163,6 +164,7 @@ func (httpOptions *HttpOptions) addAuthTo(request *http.Request) error {
163164
return nil
164165
}
165166
if err := verifyAuthInfoMatchesAgentTarget(httpOptions.Target, httpOptions.Auth); err != nil {
167+
log.Error(err)
166168
return errors.New("auth info does not match target Id")
167169
}
168170

0 commit comments

Comments
 (0)