Enable self-service for iOS/iPadOS IPA only - #35099
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat-32247-ios-ipados-self-service #35099 +/- ##
=====================================================================
Coverage ? 66.14%
=====================================================================
Files ? 2074
Lines ? 174838
Branches ? 7173
=====================================================================
Hits ? 115639
Misses ? 48575
Partials ? 10624
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| // TODO(mna): until we have SCEP-based authentication for iDevices, cheat by | ||
| // inserting a token for that host so we can use the self-service API. | ||
| hostSecret := uuid.NewString() | ||
| mysql.ExecAdhocSQL(t, s.ds, func(q sqlx.ExtContext) error { | ||
| _, err := q.ExecContext(context.Background(), `INSERT INTO host_device_auth (host_id, token) VALUES (?, ?)`, data.host.ID, hostSecret) | ||
| return err | ||
| }) |
There was a problem hiding this comment.
Heads-up @cdcme , once we have the cert-based auth we should update this hack to use the proper auth in integration tests.
There was a problem hiding this comment.
I just reviewed your cert-auth PR, I can submit a follow-up with proper auth when yours lands, I'll extract a helper func from your tests.
| // TODO(mna): until iDevice SCEP-based auth is implemented, cheat by adding a | ||
| // token associated with the iOS host so we can use the self-install endpoint. | ||
| mysql.ExecAdhocSQL(t, s.ds, func(q sqlx.ExtContext) error { | ||
| _, err := q.ExecContext(ctx, `INSERT INTO host_device_auth (host_id, token) VALUES (?, 'secret')`, iosHost.ID) | ||
| return err | ||
| }) |
There was a problem hiding this comment.
Same here @cdcme , once we have the cert-based auth we should update this hack to use the proper auth in integration tests.
Related issue: Resolves #34274
Checklist for submitter
If some of the following don't apply, delete the relevant line.
Changes file added for user-visible changes in
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Input data is properly validated,
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements)Testing
Added/updated automated tests
Where appropriate, automated tests simulate multiple hosts and test for host isolation (updates to one hosts's records do not affect another)
QA'd all new/changed functionality manually
Recording: https://drive.google.com/file/d/1yJTAmisOBQo9P0_BSKWQ3nTlUmOGZMwp/view?usp=drive_link
and https://drive.google.com/file/d/1qP-oXOsmI2mGeXrTFfDSbIWn4eYsqaq4/view?usp=drive_link
Database migrations