-
Notifications
You must be signed in to change notification settings - Fork 1
fix(FLEETMDM-001): CU-86akbhhtv 16 review findings across 13 files #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5522a80
aba046b
f544be0
41c0a03
c4a38c8
184a250
3eefa31
8c341a1
35ea2b7
ca38954
9d4ea73
fe8289c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,6 +105,8 @@ func (v Viewer) CanPerformPasswordReset() bool { | |
| return false | ||
| } | ||
|
|
||
| // >>> OPENFRAME(viewer-telemetry): add diagnostic/telemetry context and system viewer β openframe/docs/....md | ||
|
|
||
| // GetDiagnosticContext implements ctxerr.ErrorContextProvider | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ New NewSystemContext fork addition to viewer.go missing OPENFRAME sentinel comments Wrapped the fork-only additions (GetDiagnosticContext, GetTelemetryContext, maskEmail, systemUserName, systemUser, NewSystemContext) in π€ Prompt for AI agentsfix confidence: π‘ 85 medium β react π/π to teach the reviewer |
||
| func (v *Viewer) GetDiagnosticContext() map[string]any { | ||
| vdata := map[string]any{ | ||
|
|
@@ -156,3 +158,5 @@ var systemUser = &fleet.User{ | |
| func NewSystemContext(ctx context.Context) context.Context { | ||
| return NewContext(ctx, Viewer{User: systemUser}) | ||
| } | ||
|
|
||
| // <<< OPENFRAME(viewer-telemetry) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,12 +134,14 @@ func (d *Datastore) NewHost(ctx context.Context, host *fleet.Host) (*fleet.Host, | |
| logging.WithErr(ctx, err) | ||
| } | ||
| } | ||
| // >>> OPENFRAME(host-cache-invalidation): invalidate node_key cache on host creation β openframe/docs/host-cache.md | ||
| // A newly inserted host has no positive cache entry, but a stale negative | ||
| // cache entry for the new node_key could linger (up to hostCacheNegativeTTL) | ||
| // if the node_key had been probed moments before enrollment. Clearing it | ||
| // here ensures the next LoadHostByNodeKey populates the positive cache | ||
| // instead of returning a false NotFound. | ||
| d.invalidateAfterHostEnroll(ctx, h, "enroll") | ||
| // <<< OPENFRAME(host-cache-invalidation) | ||
| return h, nil | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ New fork file mysqlredis/hosts.go lacks OPENFRAME sentinel comments around fork-specific cache invalidation logic Wrapped each fork-specific cache-invalidation call in π€ Prompt for AI agentsfix confidence: π‘ 75 medium β react π/π to teach the reviewer |
||
| } | ||
|
|
||
|
|
@@ -153,9 +155,11 @@ func (d *Datastore) EnrollOsquery(ctx context.Context, opts ...fleet.DatastoreEn | |
| logging.WithErr(ctx, err) | ||
| } | ||
| } | ||
| // >>> OPENFRAME(host-cache-invalidation): invalidate stale cache on re-enrollment β openframe/docs/host-cache.md | ||
| // EnrollOsquery can update an existing row's node_key + team_id on | ||
| // re-enrollment, so the cached snapshot is stale after the call. | ||
| d.invalidateAfterHostEnroll(ctx, h, "enroll") | ||
| // <<< OPENFRAME(host-cache-invalidation) | ||
| return h, nil | ||
| } | ||
|
|
||
|
|
@@ -169,9 +173,11 @@ func (d *Datastore) DeleteHost(ctx context.Context, hid uint) error { | |
| logging.WithErr(ctx, err) | ||
| } | ||
| } | ||
| // >>> OPENFRAME(host-cache-invalidation): purge cache entry on host deletion β openframe/docs/host-cache.md | ||
| // Deleted row must not serve from cache: a stale hit would let the host | ||
| // authenticate after its deletion. | ||
| d.hostCacheDeleteByID(ctx, hid, "delete") | ||
| // <<< OPENFRAME(host-cache-invalidation) | ||
| return nil | ||
| } | ||
|
|
||
|
|
@@ -185,8 +191,10 @@ func (d *Datastore) DeleteHosts(ctx context.Context, ids []uint) error { | |
| logging.WithErr(ctx, err) | ||
| } | ||
| } | ||
| // >>> OPENFRAME(host-cache-invalidation): purge cache entries on batch host deletion β openframe/docs/host-cache.md | ||
| // Batched pipelined invalidation β see invalidateHostIDs for why. | ||
| d.invalidateHostIDs(ctx, ids, "delete") | ||
| // <<< OPENFRAME(host-cache-invalidation) | ||
| return nil | ||
| } | ||
|
|
||
|
|
@@ -204,7 +212,9 @@ func (d *Datastore) CleanupExpiredHosts(ctx context.Context) ([]fleet.DeletedHos | |
| logging.WithErr(ctx, err) | ||
| } | ||
| } | ||
| // >>> OPENFRAME(host-cache-invalidation): purge cache entries for expired hosts β openframe/docs/host-cache.md | ||
| d.invalidateHostIDs(ctx, ids, "delete") | ||
| // <<< OPENFRAME(host-cache-invalidation) | ||
| return details, nil | ||
| } | ||
|
|
||
|
|
@@ -218,7 +228,9 @@ func (d *Datastore) CleanupIncomingHosts(ctx context.Context, now time.Time) ([] | |
| logging.WithErr(ctx, err) | ||
| } | ||
| } | ||
| // >>> OPENFRAME(host-cache-invalidation): purge cache entries for cleaned up incoming hosts β openframe/docs/host-cache.md | ||
| d.invalidateHostIDs(ctx, ids, "delete") | ||
| // <<< OPENFRAME(host-cache-invalidation) | ||
| return ids, nil | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,7 @@ func (s *MySQLStorage) StoreAuthenticate(r *mdm.Request, msg *mdm.Authenticate) | |
| if r.Certificate != nil { | ||
| pemCert = cryptoutil.PEMCertificate(r.Certificate.Raw) | ||
| } | ||
| // >>> OPENFRAME(nanomdm-bootstrap-token-renewal): preserve bootstrap token across SCEP renewal β openframe/docs/nanomdm.md | ||
| // When a device undergoes SCEP certificate renewal, it sends a new | ||
| // Authenticate message. We must preserve the existing bootstrap token | ||
| // during renewal; clearing it causes commands that depend on it (e.g. | ||
|
Comment on lines
142
to
148
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ Fork-specific comment referencing openframe issue lacks required OPENFRAME sentinel wrapper In π€ Prompt for AI agentsfix confidence: π’ 92 high β react π/π to teach the reviewer |
||
|
|
@@ -170,6 +171,7 @@ UPDATE | |
| authenticate_at = CURRENT_TIMESTAMP;`, | ||
| r.ID, pemCert, nullEmptyString(msg.SerialNumber), msg.Raw, r.ID, r.ID, | ||
| ) | ||
| // <<< OPENFRAME(nanomdm-bootstrap-token-renewal) | ||
|
|
||
| return err | ||
| } | ||
|
|
@@ -378,3 +380,4 @@ func (s *MySQLStorage) SetRecoveryLockFailed(ctx context.Context, hostUUID strin | |
| s.logger.ErrorContext(ctx, "MySQLStorage.SetRecoveryLockFailed not implemented") | ||
| return nil | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,8 +38,13 @@ func (m *Store) GetCurrentTime(ctx context.Context) (time.Time, error) { | |
| func (m *Store) Drop() error { return nil } | ||
| func (m *Store) MigrateTables(ctx context.Context) error { return nil } | ||
| func (m *Store) MigrateData(ctx context.Context) error { return nil } | ||
|
|
||
| // >>> OPENFRAME(mock-migrate-openframe): add MigrateOpenframe mock stub for OpenFrame migration hook β openframe/docs/datastore.md | ||
| func (m *Store) MigrateOpenframe(ctx context.Context) error { return nil } | ||
|
|
||
| // <<< OPENFRAME(mock-migrate-openframe) | ||
| func (m *Store) MigrationStatus(ctx context.Context) (*fleet.MigrationStatus, error) { | ||
| return &fleet.MigrationStatus{}, nil | ||
| } | ||
| func (m *Store) Name() string { return "mock" } | ||
|
|
||
|
Comment on lines
38
to
+50
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ MigrateOpenframe addition to upstream server/mock/datastore.go lacks required OPENFRAME sentinel comments In π€ Prompt for AI agentsfix confidence: π‘ 75 medium β react π/π to teach the reviewer
Comment on lines
38
to
+50
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ server/mock/datastore.go MigrateOpenframe method inconsistently indented/formatted, likely a fork-specific addition without sentinel wrapping Same location ( π€ Prompt for AI agentsfix confidence: π‘ 60 medium β react π/π to teach the reviewer |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,6 +91,7 @@ func (t *Task) RecordLabelQueryExecutions(ctx context.Context, host *fleet.Host, | |
| } | ||
|
|
||
| func (t *Task) collectLabelQueryExecutions(ctx context.Context, ds fleet.Datastore, pool fleet.RedisPool, stats *collectorExecStats) error { | ||
| // >>> OPENFRAME(async-otel): add OTEL span for label collection task β openframe/docs/observability.md | ||
| // Create a root span for this async collection task if OTEL is enabled | ||
| if t.otelEnabled { | ||
| tracer := otel.Tracer("async") | ||
|
Comment on lines
91
to
97
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ async_label.go: OTEL span instrumentation added to upstream-shared file without OPENFRAME sentinel comments In π€ Prompt for AI agentsfix confidence: π’ 92 high β react π/π to teach the reviewer |
||
|
|
@@ -102,6 +103,7 @@ func (t *Task) collectLabelQueryExecutions(ctx context.Context, ds fleet.Datasto | |
| ) | ||
| defer span.End() | ||
| } | ||
| // <<< OPENFRAME(async-otel) | ||
|
|
||
| cfg := t.taskConfigs[config.AsyncTaskLabelMembership] | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,7 +124,7 @@ func (t *Task) RecordPolicyQueryExecutions(ctx context.Context, host *fleet.Host | |
| } | ||
|
|
||
| func (t *Task) collectPolicyQueryExecutions(ctx context.Context, ds fleet.Datastore, pool fleet.RedisPool, stats *collectorExecStats) error { | ||
| // Create a root span for this async collection task if OTEL is enabled | ||
| // >>> OPENFRAME(async-otel): add OTEL span for policy collection task β openframe/docs/observability.md | ||
| if t.otelEnabled { | ||
| tracer := otel.Tracer("async") | ||
| var span trace.Span | ||
|
Comment on lines
124
to
130
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ async_policy.go: OTEL span instrumentation added to upstream-shared file without OPENFRAME sentinel comments In π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
|
|
@@ -135,6 +135,7 @@ func (t *Task) collectPolicyQueryExecutions(ctx context.Context, ds fleet.Datast | |
| ) | ||
| defer span.End() | ||
| } | ||
| // <<< OPENFRAME(async-otel) | ||
|
|
||
| cfg := t.taskConfigs[config.AsyncTaskPolicyMembership] | ||
|
|
||
|
|
@@ -275,3 +276,4 @@ func (t *Task) GetHostPolicyReportedAt(ctx context.Context, host *fleet.Host) ti | |
| } | ||
| return host.PolicyUpdatedAt | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ import ( | |
| "github.com/go-kit/kit/endpoint" | ||
| ) | ||
|
|
||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π extractCertSerialFromHeader and iDevice URL auth fallback lack OPENFRAME sentinel comments Wrapped extractCertSerialFromHeader (including its doc comment) in server/service/endpoint_middleware.go with π€ Prompt for AI agentsfix confidence: π‘ 85 medium β react π/π to teach the reviewer |
||
| // >>> OPENFRAME(idevice-cert-auth): cert-serial extraction for iOS/iPadOS mTLS device auth β openframe/docs/idevice-cert-auth.md | ||
| // extractCertSerialFromHeader extracts certificate serial from X-Client-Cert-Serial | ||
| // header (set by load balancer during mTLS) for iOS/iPadOS device authentication. | ||
| func extractCertSerialFromHeader(ctx context.Context, r *http.Request) context.Context { | ||
|
|
@@ -39,6 +40,8 @@ func extractCertSerialFromHeader(ctx context.Context, r *http.Request) context.C | |
| return certserial.NewContext(ctx, serial) | ||
| } | ||
|
|
||
| // <<< OPENFRAME(idevice-cert-auth) | ||
|
|
||
| func logJSON(ctx context.Context, logger *slog.Logger, v any, key string) { | ||
| jsonV, err := json.Marshal(v) | ||
| if err != nil { | ||
|
|
@@ -76,6 +79,7 @@ func authenticatedDevice(svc fleet.Service, logger *slog.Logger, next endpoint.E | |
| var debug bool | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π Cert/token/URL authentication branching in authenticatedDevice is unwrapped fork logic Wrapped the cert/token/URL three-way authentication branch inside authenticatedDevice with π€ Prompt for AI agentsfix confidence: π‘ 80 medium β react π/π to teach the reviewer |
||
| var authnMethod authz_ctx.AuthenticationMethod | ||
|
|
||
| // >>> OPENFRAME(idevice-cert-auth): cert/token/URL authentication branching for iOS/iPadOS device auth β openframe/docs/idevice-cert-auth.md | ||
| if certSerial, ok := certserial.FromContext(ctx); ok { | ||
| // Header presence signals cert auth intent, even if serial is invalid. | ||
| host, debug, err = svc.AuthenticateDeviceByCertificate(ctx, certSerial, identifier) | ||
|
|
@@ -92,6 +96,7 @@ func authenticatedDevice(svc fleet.Service, logger *slog.Logger, next endpoint.E | |
| authnMethod = authz_ctx.AuthnDeviceURL | ||
| } | ||
| } | ||
| // <<< OPENFRAME(idevice-cert-auth) | ||
|
|
||
| if err != nil { | ||
| logging.WithErr(ctx, err) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,10 @@ type addFleetMaintainedAppRequest struct { | |
| Categories []string `json:"categories"` | ||
| } | ||
|
|
||
| // >>> OPENFRAME(maintained-apps-decode-request): DecodeRequest adds fleet_id/team_id | ||
| // aliasing and base64-encoded script field decoding to bypass WAF rules that may | ||
| // block requests containing shell/PowerShell script patterns. β openframe/docs/FLEETMDM-001.md | ||
|
|
||
| // DecodeRequest implements the RequestDecoder interface to support base64-encoded | ||
| // script fields. This allows bypassing WAF rules that may block requests containing | ||
| // shell/PowerShell script patterns. When the X-Fleet-Scripts-Encoded header is set | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π New base64-script-decoding feature in shared upstream file lacks OPENFRAME sentinel comments Wrapped the π€ Prompt for AI agentsfix confidence: π‘ 70 medium β react π/π to teach the reviewer |
||
|
|
@@ -83,6 +87,8 @@ func (addFleetMaintainedAppRequest) DecodeRequest(ctx context.Context, r *http.R | |
| return &req, nil | ||
| } | ||
|
|
||
| // <<< OPENFRAME(maintained-apps-decode-request) | ||
|
|
||
| type addFleetMaintainedAppResponse struct { | ||
| SoftwareTitleID uint `json:"software_title_id,omitempty"` | ||
| Err error `json:"error,omitempty"` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,6 +207,7 @@ func (updateSoftwareInstallerRequest) DecodeRequest(ctx context.Context, r *http | |
| } | ||
| } | ||
|
|
||
| // >>> OPENFRAME(waf-bypass-scripts): base64-encode scripts to avoid WAF pattern blocks β openframe/docs/waf-bypass.md | ||
| // Check if scripts are base64 encoded (to bypass WAF rules that block script patterns) | ||
| if isScriptsEncoded(r) { | ||
| if decoded.InstallScript != nil { | ||
|
|
@@ -238,6 +239,7 @@ func (updateSoftwareInstallerRequest) DecodeRequest(ctx context.Context, r *http | |
| decoded.PostInstallScript = &decodedScript | ||
| } | ||
| } | ||
| // <<< OPENFRAME(waf-bypass-scripts) | ||
|
|
||
| return &decoded, nil | ||
| } | ||
|
Comment on lines
239
to
245
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ Base64 script-encoding bypass logic added to upstream software_installers.go without OPENFRAME sentinel comments In π€ Prompt for AI agentsfix confidence: π’ 92 high β react π/π to teach the reviewer |
||
|
|
@@ -423,6 +425,7 @@ func (uploadSoftwareInstallerRequest) DecodeRequest(ctx context.Context, r *http | |
| decoded.AutomaticInstall = parsed | ||
| } | ||
|
|
||
| // >>> OPENFRAME(waf-bypass-scripts): base64-encode scripts to avoid WAF pattern blocks β openframe/docs/waf-bypass.md | ||
| // Check if scripts are base64 encoded (to bypass WAF rules that block script patterns) | ||
| if isScriptsEncoded(r) { | ||
| var err error | ||
|
Comment on lines
425
to
431
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ Same base64-decoding fork addition unwrapped in uploadSoftwareInstallerRequest.DecodeRequest In π€ Prompt for AI agentsfix confidence: π’ 92 high β react π/π to teach the reviewer |
||
|
|
@@ -439,6 +442,7 @@ func (uploadSoftwareInstallerRequest) DecodeRequest(ctx context.Context, r *http | |
| return nil, &fleet.BadRequestError{Message: "invalid base64 encoding for post_install_script"} | ||
| } | ||
| } | ||
| // <<< OPENFRAME(waf-bypass-scripts) | ||
|
|
||
| return &decoded, nil | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,10 @@ import ( | |
| "github.com/fleetdm/fleet/v4/server/fleet" | ||
| ) | ||
|
|
||
| // >>> OPENFRAME(msrc-display-version): match hosts missing DisplayVersion via OS name fallback β openframe/docs/msrc-matching.md | ||
| // displayVersionPattern matches Windows display version strings like "22H2", "23H2", "24H2". | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ MSRC display-version fallback logic added to upstream fleetdm product.go without OPENFRAME sentinel comments Wrapped all fork-specific MSRC display-version fallback logic in π€ Prompt for AI agentsfix confidence: π‘ 82 medium β react π/π to teach the reviewer |
||
| var displayVersionPattern = regexp.MustCompile(`\b\d{2}H[12]\b`) | ||
| // <<< OPENFRAME(msrc-display-version) | ||
|
|
||
| // Product abstracts a MS full product name. | ||
| // A full product name includes the name of the product plus its arch | ||
|
|
@@ -24,13 +26,15 @@ type Products map[string]Product | |
| var ErrNoMatch = errors.New("no product matches") | ||
|
|
||
| func (p Products) GetMatchForOS(ctx context.Context, os fleet.OperatingSystem) (string, error) { | ||
| // >>> OPENFRAME(msrc-display-version): match hosts missing DisplayVersion via OS name fallback β openframe/docs/msrc-matching.md | ||
| isServerCoreHost := strings.EqualFold(os.InstallationType, "Server Core") | ||
| installationTypeKnown := os.InstallationType != "" | ||
|
|
||
| // matchByDisplayVersion is set when we find a product whose display version | ||
| // (e.g. "22H2") matches the host's. matchByBuildNumber is the fallback for | ||
| // hosts that lack a display version (legacy builds 22000/10240 only). | ||
| var matchByDisplayVersion, matchByBuildNumber string | ||
| // <<< OPENFRAME(msrc-display-version) | ||
|
|
||
| for pID, product := range p { | ||
| normalizedOS := NewProductFromOS(os) | ||
|
|
@@ -43,6 +47,7 @@ func (p Products) GetMatchForOS(ctx context.Context, os fleet.OperatingSystem) ( | |
| continue | ||
| } | ||
|
|
||
| // >>> OPENFRAME(msrc-display-version): match hosts missing DisplayVersion via OS name fallback β openframe/docs/msrc-matching.md | ||
| // When the host's installation type is known, only match products | ||
| // that correspond to the correct installation type (Server Core vs full desktop). | ||
| if installationTypeKnown && product.IsServerCore() != isServerCoreHost { | ||
|
|
@@ -53,8 +58,10 @@ func (p Products) GetMatchForOS(ctx context.Context, os fleet.OperatingSystem) ( | |
| // (superset of Server Core CVEs) for deterministic matching. Only use | ||
| // a Server Core product if no desktop alternative has been found. | ||
| isCore := product.IsServerCore() | ||
| // <<< OPENFRAME(msrc-display-version) | ||
|
|
||
| if product.HasDisplayVersion() { | ||
| // >>> OPENFRAME(msrc-display-version): match hosts missing DisplayVersion via OS name fallback β openframe/docs/msrc-matching.md | ||
| // Use os.DisplayVersion if available, otherwise try to extract it from the OS name. | ||
| // The OS name may already contain the display version (e.g., "Microsoft Windows 10 Pro 22H2") | ||
| // even when the DisplayVersion field is empty, which can happen when osquery includes | ||
|
|
@@ -72,6 +79,7 @@ func (p Products) GetMatchForOS(ctx context.Context, os fleet.OperatingSystem) ( | |
| } | ||
| continue | ||
| } | ||
| // <<< OPENFRAME(msrc-display-version) | ||
| } | ||
|
|
||
| // If os.DisplayVersion is empty, we need to confirm that the product | ||
|
|
@@ -85,13 +93,16 @@ func (p Products) GetMatchForOS(ctx context.Context, os fleet.OperatingSystem) ( | |
| build = parts[2] | ||
| } | ||
| if build == "22000" || build == "10240" { | ||
| // >>> OPENFRAME(msrc-display-version): match hosts missing DisplayVersion via OS name fallback β openframe/docs/msrc-matching.md | ||
| if matchByBuildNumber == "" || !isCore { | ||
| matchByBuildNumber = pID | ||
| } | ||
| // <<< OPENFRAME(msrc-display-version) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // >>> OPENFRAME(msrc-display-version): match hosts missing DisplayVersion via OS name fallback β openframe/docs/msrc-matching.md | ||
| if matchByDisplayVersion == "" && matchByBuildNumber == "" { | ||
| return "", ctxerr.Wrap(ctx, ErrNoMatch) | ||
| } | ||
|
|
@@ -101,6 +112,7 @@ func (p Products) GetMatchForOS(ctx context.Context, os fleet.OperatingSystem) ( | |
| } | ||
|
|
||
| return matchByBuildNumber, nil | ||
| // <<< OPENFRAME(msrc-display-version) | ||
| } | ||
|
|
||
| func NewProductFromFullName(fullName string) Product { | ||
|
|
@@ -247,6 +259,7 @@ func (p Product) Name() string { | |
| } | ||
| } | ||
|
|
||
| // >>> OPENFRAME(msrc-display-version): match hosts missing DisplayVersion via OS name fallback β openframe/docs/msrc-matching.md | ||
| // IsServerCore returns true if the product name indicates a Server Core installation. | ||
| func (p Product) IsServerCore() bool { | ||
| return strings.Contains(strings.ToLower(string(p)), "server core") | ||
|
|
@@ -259,6 +272,7 @@ func extractDisplayVersionFromName(name string) string { | |
| match := displayVersionPattern.FindString(name) | ||
| return match | ||
| } | ||
| // <<< OPENFRAME(msrc-display-version) | ||
|
|
||
| // Matches checks whether product A matches product B by checking to see if both are for the same | ||
| // product and if the architecture they target are compatible. This function is commutative. | ||
|
|
@@ -269,3 +283,4 @@ func (p Product) Matches(o Product) bool { | |
|
|
||
| return p.Arch() == "all" || o.Arch() == "all" || p.Arch() == o.Arch() | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
𦩠π΄ Fork-specific fallback logic in upstream auth_token utility lacks OPENFRAME sentinel comments
Wrapped all fork-specific HTTPS-detection fallback logic in
frontend/utilities/auth_token/index.tswith// >>> OPENFRAME(auth-token-http-fallback): ... β openframe/docs/auth.md/// <<< OPENFRAME(auth-token-http-fallback)sentinel comment pairs: around theisSecure/getTokenNamefunction definitions, and around theCookie.setcall insave, theCookie.getcall inget, and theCookie.removecall inremove, since each of these call sites depends on the fork-specificgetTokenName/isSecurebehavior.π€ Prompt for AI agents
fix confidence: π‘ 85 medium β react π/π to teach the reviewer