github-vet / github-vet/rangeloop-pointer-findings
kyma-incubator/compass: components/director/internal/oathkeeper/model.go; 18 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [kyma-incubator/compass](https://www.github.com/kyma-incubator/compass) at [components/director/internal/oathkeeper/model.go](https://github.com/kyma-incubator/compass/blob/9b55563638ca47b0a09cf5e20b634785e0d586aa/components/director/internal/oathkeeper/model.go#L105-L122)
Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first issue it finds, so please do not limit your consideration to the contents of the below message.
> reference to authn was used in a composite literal at line 121
[Click here to see the code in its original context.](https://github.com/kyma-incubator/compass/blob/9b55563638ca47b0a09cf5e20b634785e0d586aa/components/director/internal/oathkeeper/model.go#L105-L122)
Click here to show the 18 line(s) of Go which triggered the analyzer.
```go
for _, authn := range authenticators {
uniqueAttribute := gjson.Get(extra, authn.Attributes.UniqueAttribute.Key).String()
if uniqueAttribute == "" || uniqueAttribute != authn.Attributes.UniqueAttribute.Value {
continue
}
log.D().Infof("Request token matches %q authenticator", authn.Name)
identity, ok := d.Body.Extra[authn.Attributes.IdentityAttribute.Key]
if !ok {
return nil, apperrors.NewInvalidDataError("missing identity attribute from %q authenticator token", authn.Name)
}
authID, err := str.Cast(identity)
if err != nil {
return nil, errors.Wrapf(err, "while parsing the value for %s", identity)
}
return &AuthDetails{AuthID: authID, AuthFlow: JWTAuthFlow, Authenticator: &authn}, nil
}
```
Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.
commit ID: 9b55563638ca47b0a09cf5e20b634785e0d586aa
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.