Skip to content
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

Added ability to upload profiles with secret variables using the /configuration_profiles endpoint. #25012

Merged
merged 6 commits into from
Dec 30, 2024

Conversation

getvictor
Copy link
Member

Added ability to upload profiles with secret variables using the /configuration_profiles endpoint.
#25011

Checklist for submitter

  • If database migrations are included, checked table schema to confirm autoupdate
  • Manual QA for all new/changed functionality

Copy link

codecov bot commented Dec 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.79%. Comparing base (e94aa2d) to head (a33e03f).
Report is 15 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #25012   +/-   ##
=======================================
  Coverage   63.78%   63.79%           
=======================================
  Files        1610     1610           
  Lines      153230   153232    +2     
  Branches     3959     4012   +53     
=======================================
+ Hits        97743    97755   +12     
+ Misses      47695    47684   -11     
- Partials     7792     7793    +1     
Flag Coverage Δ
backend 64.64% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@getvictor getvictor marked this pull request as ready for review December 25, 2024 23:14
@getvictor getvictor requested a review from a team as a code owner December 25, 2024 23:14
@@ -19,8 +19,9 @@ func Up_20241209164540(tx *sql.Tx) error {
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
value BLOB NOT NULL, -- 64KB max value size
created_at TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
updated_at TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
-- Using DATETIME instead of TIMESTAMP to prevent future Y2K38 issues, since updated_at is used as a trigger to resend profiles
Copy link
Member

Choose a reason for hiding this comment

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

Should this be a new pattern? Or is this just for this one case?

Copy link
Member Author

Choose a reason for hiding this comment

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

DATETIME uses more storage than TIMESTAMP. We can discuss in backend sync.

Copy link
Member

Choose a reason for hiding this comment

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

OK, is this change for the next PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I just wanted to get it in since I wasn't sure if the next PR would make the cut/release.

@getvictor getvictor merged commit 5f4400b into main Dec 30, 2024
25 checks passed
@getvictor getvictor deleted the victor/25011-upload-profiles-with-secrets branch December 30, 2024 19:07
getvictor added a commit that referenced this pull request Dec 30, 2024
#24900 

This PR includes and depends on PR #25012, which should be
reviewed/merged before this one.

Windows profiles are not included in this PR due to issue #25030

This PR adds the following functionality: Apple config/DDM profile is
resent to the device when the profile contains secret variables, and the
values of those variables have changed. For example.
- Upload secret variables
- Upload profile
- Device gets profile
- Upload the same profile
- Nothing happens
- Upload a different secret variable value
- Upload the same profile
- Device gets updated profile

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files)
for more information.
- [x] Added/updated tests
- [x] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [x] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [x] Manual QA for all new/changed functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants