Skip to content

fix: Restore moved device auth#578

Merged
dz0ny merged 1 commit into
mainfrom
fix/issue-850-moved-device-auth
May 22, 2026
Merged

fix: Restore moved device auth#578
dz0ny merged 1 commit into
mainfrom
fix/issue-850-moved-device-auth

Conversation

@dz0ny
Copy link
Copy Markdown
Member

@dz0ny dz0ny commented May 22, 2026

Refs teamniteo/pareto#850

Copilot AI review requested due to automatic review settings May 22, 2026 09:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

🚀 Dev Builds Available

Development builds for this PR are available in the workflow artifacts.

Available builds:

  • Windows (agent, installer, tray)
  • Linux (agent)
  • macOS (agent)

Download the build artifact to test the latest changes.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ParetoSecurity/agent/team 91.74% (-2.01%) 👎
Total 52.97%

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ParetoSecurity/agent/team/report.go 92.31% (-3.85%) 65 (+13) 60 (+10) 5 (+3) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ParetoSecurity/agent/team/report_test.go

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores handling for “moved device” responses during team reporting by accepting a 301 response and updating local auth/team configuration accordingly (refs teamniteo/pareto#850).

Changes:

  • Accepts 301 Moved Permanently as a non-error response for ReportToTeam and captures the HTTP status.
  • Parses the 301 response body to extract and persist the updated device auth token and derived team ID.
  • Adds a test case validating config updates when the report endpoint returns 301 with a new auth.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
team/report.go Allows 301 responses, captures status code, and updates config from the moved-device payload.
team/report_test.go Adds coverage for the moved-device 301 path and asserts updated TeamID/AuthToken behavior.

Comment thread team/report.go Outdated
Comment thread team/report_test.go
Comment thread team/report_test.go
@dz0ny dz0ny force-pushed the fix/issue-850-moved-device-auth branch from 024fae2 to 4741e6b Compare May 22, 2026 11:03
@dz0ny dz0ny requested a review from zupo May 22, 2026 13:24
@dz0ny dz0ny merged commit 179e520 into main May 22, 2026
42 checks passed
@dz0ny dz0ny deleted the fix/issue-850-moved-device-auth branch May 22, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants