Conversation
PR SummaryMedium Risk Overview Extends Makes Reviewed by Cursor Bugbot for commit 2e4ccad. Bugbot is set up for automated code reviews on this repo. Configure here. |
da69802 to
2e4ccad
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: TLS cert and key file paths silently discarded
RunHTTPServernow passes the configured cert/key paths into the TLS serve calls and appliesTLSClientCAFiletoServer.TLSConfigfor mutual TLS.
- ✅ Fixed: Case-sensitive service type check inconsistent with human check
PrincipalFromActornow treatsserviceactor types case-insensitively so mixed-case service tokens still populateprincipal.Service.
You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 2e4ccad. Configure here.
| if cfg.Listener != nil { | ||
| err = cfg.Server.ServeTLS(cfg.Listener, "", "") | ||
| } else { | ||
| err = cfg.Server.ListenAndServeTLS("", "") |
There was a problem hiding this comment.
TLS cert and key file paths silently discarded
High Severity
cfg.TLSCertFile and cfg.TLSKeyFile are checked to decide whether to enter the TLS branch, but empty strings "" are passed to ServeTLS and ListenAndServeTLS instead of the actual file paths. Unless the caller has pre-populated Server.TLSConfig.Certificates, the server will fail to start with a TLS handshake error. The TLSClientCAFile field is similarly logged but never applied to configure mutual TLS.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 2e4ccad. Configure here.
| } | ||
| if principal.TokenType == "service" { | ||
| principal.Service = principal.Subject | ||
| } |
There was a problem hiding this comment.
Case-sensitive service type check inconsistent with human check
Low Severity
PrincipalFromActor uses a case-sensitive comparison principal.TokenType == "service" to decide whether to populate the Service field, while isHumanActorType (called two lines earlier on the same actor.Type value) uses strings.ToLower for its comparison. If a TokenVerifier implementation returns an actor with type "Service" or "SERVICE", the principal would not get the Service field set from the Subject, yet isHumanActorType would correctly handle equivalent casing for human/user types.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 2e4ccad. Configure here.


Summary
Validation