* Make depclient construction function return an error if the client could not be constructed.
* Make depclient construction function return an error if the client could not be constructed.
* Add "feature not available" message when attempting to fetch dep devices without a configured dep client.
Add test demonstrating the "feature not available" error when constructing the management service without a dep client.
* Make a boolean --dep flag. DEP will be disabled by default, and prints a message to the console to inform the user of the dep feature status.
Incorrect flags when DEP is enabled will now exit with status 1 again.
* Create skeleton test suite for connect transport
* Remove service test because sqlmock never made it into the master branch.
Add transport test for connect loosely based on groobs management transport tests.
* Added mock command service.
Add single test for InstalledApplicationList
Add some modified real world responses as test data.
* Create fake device fixture for connect tests
* Add some more macOS responses.
Fix nullstring error in transport test.
proper teardown of httptest server.
* Even more responses from live system to use as test fixtures.
* Cleanup commented code.
Simple test for inserted applications with InstalledApplicationList response.
* Cleanup unused imports.
* Add tests for DeviceInformation and CertificateList.
Try to construct the command request in setup(), dirty hack.
* Use rollback instead of inline statements to destroy fixtures.
Fix incorrect plist in deviceinformation test.
Minor cleanups
* Add checkin authenticate test.
Fix some "down" migrations which didnt actually work.
* Basic coverage of checkin tests.
Fix invalid fixture base64 data.
* Tidy up mock management service and imports.
* Revert back to setup()/teardown() style per discussion with groob.
* Clean up imports
SCEP payload is optional in /mdm/enroll
SCEP challenge is optional in /mdm/enroll (warning about prompt)
Change CA cert to payload type com.apple.security.root
(cherry picked from commit 0d8d092)
Enrollment service now takes the TLS certificate path and provides a PKCS1 payload with the servers TLS certificate in order to trust it at enroll time.
* Stub new method for application datastore
Handle command failures more gracefully than continuously retrying. Failures are not logged
Add table for certificates.
(cherry picked from commit 9f580a6)
* Remove methods with signature NewDatastore() from datastores and injection of the logger instance into each datastore because groob is a doodoo head :)
Move NewDatastore methods into unit tests
Reinstate NewDB test
Create certificates package including a Certificate type and a datastore.
Began working on a method ackCertificateList in the connect service.
Boilerplate for management service test.
Renamed some tables in certificates migration, hopefully nobody notices.
Applications response handler should be omitted from this branch.
(cherry picked from commit 8bc2fc7)
* Add device uuid to certificate, as there will never be a normalised form of the certificate data.
Change statments to reflect table change from certificates to devices_certificates
Add the CertificateList request type to the connect service's Acknowledge method
Add certificates datastore to the management service, and add endpoints and request/responses for retrieving certificates by device uuid to the management endpoujnt.
Kludge. commits regarding app service will be amended.
(cherry picked from commit c723c80)
* Don't forget the endpoint definition for certificates!
(cherry picked from commit 4e5fc1f)
* Use byte field for certificate data.
(cherry picked from commit 66d5036)
* Fix empty import in certificates
(cherry picked from commit b6d4dca)
* Add table for certificates.
(cherry picked from commit 06bc231)
* Renamed some tables in certificates migration, hopefully nobody notices.
Rebase develop onto master
(cherry picked from commit 775484d)
* Certificate list responses are saved via replacing the entire certificate list on a per device basis. This is because neither the common name nor the data could be used as a unique constraint in the certificates table.
Few small changes to imports/style.
(cherry picked from commit e0a63e1)
* Properly rollback if certificate insert fails for any certificate in a response.
(cherry picked from commit 99e1ea1)
* Fix several incorrect statements and struct tags which were preventing the certificates management endpoint from listing certs.
Certificate listing is working without a base64 encoded representation of each certificate.
(cherry picked from commit 685dfef)
* Add commands index to command datastore.
Add simple test for commands index
Add commands index endpoint
(cherry picked from commit 4e2a2a2)
* Add handler for GET /mdm/commands
(cherry picked from commit ae71b8f)
* Added Find() method to commands datastore so that the request that matches a response can be retrieved by the connect service.
Added Find() method to command service
(cherry picked from commit ebceb28)
* Fix globally scoped vars in command datastore test suite
* groob prefers inline definition of struct members.
* Uppercase CommandUuid
* Add ackCertificateList to connect service, accidentally omitted from installed_certificate_list PR #14
Make push endpoint conform to Errorer interface.
Wrap error return in management service.
Add missing certsDB in main.go, should have been part of installed_certificate_list PR #14
* Fix erraneous comma in mdmEnrollResponse
* Add log messages when the TLS certificate fails verification.
* Fix invalid return value.
Log when certificate cannot be parsed.
* MicroMDM will now exit with status code 1 if certificates are expired or invalid.
* Convert all time.Time pointers to value types.
Use UTC time when updating `last_checkin`.
Update `last_checkin` correctly on Authenticate, TokenUpdate, and query response.
Set database defaults to golangs zero value for time.Time which is `0001-01-01`.
* Add down migration for time defaults.
* Stub new method for application datastore
Handle command failures more gracefully than continuously retrying. Failures are not logged
Add table for certificates.
(cherry picked from commit 9f580a6)
* Remove methods with signature NewDatastore() from datastores and injection of the logger instance into each datastore because groob is a doodoo head :)
Move NewDatastore methods into unit tests
Reinstate NewDB test
Create certificates package including a Certificate type and a datastore.
Began working on a method ackCertificateList in the connect service.
Boilerplate for management service test.
Renamed some tables in certificates migration, hopefully nobody notices.
Applications response handler should be omitted from this branch.
(cherry picked from commit 8bc2fc7)
* Add device uuid to certificate, as there will never be a normalised form of the certificate data.
Change statments to reflect table change from certificates to devices_certificates
Add the CertificateList request type to the connect service's Acknowledge method
Add certificates datastore to the management service, and add endpoints and request/responses for retrieving certificates by device uuid to the management endpoujnt.
Kludge. commits regarding app service will be amended.
(cherry picked from commit c723c80)
* Don't forget the endpoint definition for certificates!
(cherry picked from commit 4e5fc1f)
* Use byte field for certificate data.
(cherry picked from commit 66d5036)
* Fix empty import in certificates
(cherry picked from commit b6d4dca)
* Add table for certificates.
(cherry picked from commit 06bc231)
* Renamed some tables in certificates migration, hopefully nobody notices.
Rebase develop onto master
(cherry picked from commit 775484d)
* Certificate list responses are saved via replacing the entire certificate list on a per device basis. This is because neither the common name nor the data could be used as a unique constraint in the certificates table.
Few small changes to imports/style.
(cherry picked from commit e0a63e1)
* Properly rollback if certificate insert fails for any certificate in a response.
(cherry picked from commit 99e1ea1)
* Fix several incorrect statements and struct tags which were preventing the certificates management endpoint from listing certs.
Certificate listing is working without a base64 encoded representation of each certificate.
(cherry picked from commit 685dfef)
* Add commands index to command datastore.
Add simple test for commands index
Add commands index endpoint
(cherry picked from commit 4e2a2a2)
* Add handler for GET /mdm/commands
(cherry picked from commit ae71b8f)
* Added Find() method to commands datastore so that the request that matches a response can be retrieved by the connect service.
Added Find() method to command service
(cherry picked from commit ebceb28)
* Fix globally scoped vars in command datastore test suite
* groob prefers inline definition of struct members.
* Uppercase CommandUuid
* Add ackCertificateList to connect service, accidentally omitted from installed_certificate_list PR #14
Make push endpoint conform to Errorer interface.
Wrap error return in management service.
Add missing certsDB in main.go, should have been part of installed_certificate_list PR #14
* Fix erraneous comma in mdmEnrollResponse
* Model is sent with Authenticate message so best to update it there without having to query DeviceInformation.
* Incorrect struct tags result in PayloadScope not being included in the mdm enroll profile output.
* Stub new method for application datastore
Handle command failures more gracefully than continuously retrying. Failures are not logged
Add table for certificates.
(cherry picked from commit 9f580a6)
* Remove methods with signature NewDatastore() from datastores and injection of the logger instance into each datastore because groob is a doodoo head :)
Move NewDatastore methods into unit tests
Reinstate NewDB test
Create certificates package including a Certificate type and a datastore.
Began working on a method ackCertificateList in the connect service.
Boilerplate for management service test.
Renamed some tables in certificates migration, hopefully nobody notices.
Applications response handler should be omitted from this branch.
(cherry picked from commit 8bc2fc7)
* Add device uuid to certificate, as there will never be a normalised form of the certificate data.
Change statments to reflect table change from certificates to devices_certificates
Add the CertificateList request type to the connect service's Acknowledge method
Add certificates datastore to the management service, and add endpoints and request/responses for retrieving certificates by device uuid to the management endpoujnt.
Kludge. commits regarding app service will be amended.
(cherry picked from commit c723c80)
* Don't forget the endpoint definition for certificates!
(cherry picked from commit 4e5fc1f)
* Use byte field for certificate data.
(cherry picked from commit 66d5036)
* Fix empty import in certificates
(cherry picked from commit b6d4dca)
* Add table for certificates.
(cherry picked from commit 06bc231)
* Renamed some tables in certificates migration, hopefully nobody notices.
Rebase develop onto master
(cherry picked from commit 775484d)
* Certificate list responses are saved via replacing the entire certificate list on a per device basis. This is because neither the common name nor the data could be used as a unique constraint in the certificates table.
Few small changes to imports/style.
(cherry picked from commit e0a63e1)
* Properly rollback if certificate insert fails for any certificate in a response.
(cherry picked from commit 99e1ea1)
* Fix several incorrect statements and struct tags which were preventing the certificates management endpoint from listing certs.
Certificate listing is working without a base64 encoded representation of each certificate.
(cherry picked from commit 685dfef)
* Add commands index to command datastore.
Add simple test for commands index
Add commands index endpoint
(cherry picked from commit 4e2a2a2)
* Add handler for GET /mdm/commands
(cherry picked from commit ae71b8f)
* Added Find() method to commands datastore so that the request that matches a response can be retrieved by the connect service.
Added Find() method to command service
(cherry picked from commit ebceb28)
* Fix globally scoped vars in command datastore test suite
* groob prefers inline definition of struct members.
* Uppercase CommandUuid
* Add ackCertificateList to connect service, accidentally omitted from installed_certificate_list PR #14
Make push endpoint conform to Errorer interface.
Wrap error return in management service.
Add missing certsDB in main.go, should have been part of installed_certificate_list PR #14
* Fix erraneous comma in mdmEnrollResponse
* Model is sent with Authenticate message so best to update it there without having to query DeviceInformation.
* Stub new method for application datastore
Handle command failures more gracefully than continuously retrying. Failures are not logged
Add table for certificates.
(cherry picked from commit 9f580a6)
* Remove methods with signature NewDatastore() from datastores and injection of the logger instance into each datastore because groob is a doodoo head :)
Move NewDatastore methods into unit tests
Reinstate NewDB test
Create certificates package including a Certificate type and a datastore.
Began working on a method ackCertificateList in the connect service.
Boilerplate for management service test.
Renamed some tables in certificates migration, hopefully nobody notices.
Applications response handler should be omitted from this branch.
(cherry picked from commit 8bc2fc7)
* Add device uuid to certificate, as there will never be a normalised form of the certificate data.
Change statments to reflect table change from certificates to devices_certificates
Add the CertificateList request type to the connect service's Acknowledge method
Add certificates datastore to the management service, and add endpoints and request/responses for retrieving certificates by device uuid to the management endpoujnt.
Kludge. commits regarding app service will be amended.
(cherry picked from commit c723c80)
* Don't forget the endpoint definition for certificates!
(cherry picked from commit 4e5fc1f)
* Use byte field for certificate data.
(cherry picked from commit 66d5036)
* Fix empty import in certificates
(cherry picked from commit b6d4dca)
* Add table for certificates.
(cherry picked from commit 06bc231)
* Renamed some tables in certificates migration, hopefully nobody notices.
Rebase develop onto master
(cherry picked from commit 775484d)
* Certificate list responses are saved via replacing the entire certificate list on a per device basis. This is because neither the common name nor the data could be used as a unique constraint in the certificates table.
Few small changes to imports/style.
(cherry picked from commit e0a63e1)
* Properly rollback if certificate insert fails for any certificate in a response.
(cherry picked from commit 99e1ea1)
* Fix several incorrect statements and struct tags which were preventing the certificates management endpoint from listing certs.
Certificate listing is working without a base64 encoded representation of each certificate.
(cherry picked from commit 685dfef)
* Add commands index to command datastore.
Add simple test for commands index
Add commands index endpoint
(cherry picked from commit 4e2a2a2)
* Add handler for GET /mdm/commands
(cherry picked from commit ae71b8f)
* Added Find() method to commands datastore so that the request that matches a response can be retrieved by the connect service.
Added Find() method to command service
(cherry picked from commit ebceb28)
* Fix globally scoped vars in command datastore test suite
* groob prefers inline definition of struct members.
* Uppercase CommandUuid
* Add ackCertificateList to connect service, accidentally omitted from installed_certificate_list PR #14
Make push endpoint conform to Errorer interface.
Wrap error return in management service.
Add missing certsDB in main.go, should have been part of installed_certificate_list PR #14
* Fix erraneous comma in mdmEnrollResponse
* Rename certificates to certficiate
Rename applications to application
* Stub new method for application datastore
Handle command failures more gracefully than continuously retrying. Failures are not logged
Add table for certificates.
(cherry picked from commit 9f580a6)
* Remove methods with signature NewDatastore() from datastores and injection of the logger instance into each datastore because groob is a doodoo head :)
Move NewDatastore methods into unit tests
Reinstate NewDB test
Create certificates package including a Certificate type and a datastore.
Began working on a method ackCertificateList in the connect service.
Boilerplate for management service test.
Renamed some tables in certificates migration, hopefully nobody notices.
Applications response handler should be omitted from this branch.
(cherry picked from commit 8bc2fc7)
* Add device uuid to certificate, as there will never be a normalised form of the certificate data.
Change statments to reflect table change from certificates to devices_certificates
Add the CertificateList request type to the connect service's Acknowledge method
Add certificates datastore to the management service, and add endpoints and request/responses for retrieving certificates by device uuid to the management endpoujnt.
Kludge. commits regarding app service will be amended.
(cherry picked from commit c723c80)
* Don't forget the endpoint definition for certificates!
(cherry picked from commit 4e5fc1f)
* Use byte field for certificate data.
(cherry picked from commit 66d5036)
* Fix empty import in certificates
(cherry picked from commit b6d4dca)
* Add table for certificates.
(cherry picked from commit 06bc231)
* Renamed some tables in certificates migration, hopefully nobody notices.
Rebase develop onto master
(cherry picked from commit 775484d)
* Certificate list responses are saved via replacing the entire certificate list on a per device basis. This is because neither the common name nor the data could be used as a unique constraint in the certificates table.
Few small changes to imports/style.
(cherry picked from commit e0a63e1)
* Properly rollback if certificate insert fails for any certificate in a response.
(cherry picked from commit 99e1ea1)
* Fix several incorrect statements and struct tags which were preventing the certificates management endpoint from listing certs.
Certificate listing is working without a base64 encoded representation of each certificate.
(cherry picked from commit 685dfef)
* Add commands index to command datastore.
Add simple test for commands index
Add commands index endpoint
(cherry picked from commit 4e2a2a2)
* Add handler for GET /mdm/commands
(cherry picked from commit ae71b8f)
* Added Find() method to commands datastore so that the request that matches a response can be retrieved by the connect service.
Added Find() method to command service
(cherry picked from commit ebceb28)
* Fix globally scoped vars in command datastore test suite
* groob prefers inline definition of struct members.
* Uppercase CommandUuid
* Add ackCertificateList to connect service, accidentally omitted from installed_certificate_list PR #14
Make push endpoint conform to Errorer interface.
Wrap error return in management service.
Add missing certsDB in main.go, should have been part of installed_certificate_list PR #14
* Fix erraneous comma in mdmEnrollResponse
* Include certificate statement builders.
These are necessary to support the current revision of the installed_certificates package.
* Stub new method for application datastore
Handle command failures more gracefully than continuously retrying. Failures are not logged
Add table for certificates.
(cherry picked from commit 9f580a6)
* Remove methods with signature NewDatastore() from datastores and injection of the logger instance into each datastore because groob is a doodoo head :)
Move NewDatastore methods into unit tests
Reinstate NewDB test
Create certificates package including a Certificate type and a datastore.
Began working on a method ackCertificateList in the connect service.
Boilerplate for management service test.
Renamed some tables in certificates migration, hopefully nobody notices.
Applications response handler should be omitted from this branch.
(cherry picked from commit 8bc2fc7)
* Add device uuid to certificate, as there will never be a normalised form of the certificate data.
Change statments to reflect table change from certificates to devices_certificates
Add the CertificateList request type to the connect service's Acknowledge method
Add certificates datastore to the management service, and add endpoints and request/responses for retrieving certificates by device uuid to the management endpoujnt.
Kludge. commits regarding app service will be amended.
(cherry picked from commit c723c80)
* Don't forget the endpoint definition for certificates!
(cherry picked from commit 4e5fc1f)
* Use byte field for certificate data.
(cherry picked from commit 66d5036)
* Fix empty import in certificates
(cherry picked from commit b6d4dca)
* Add table for certificates.
(cherry picked from commit 06bc231)
* Renamed some tables in certificates migration, hopefully nobody notices.
Rebase develop onto master
(cherry picked from commit 775484d)
* Certificate list responses are saved via replacing the entire certificate list on a per device basis. This is because neither the common name nor the data could be used as a unique constraint in the certificates table.
Few small changes to imports/style.
(cherry picked from commit e0a63e1)
* Properly rollback if certificate insert fails for any certificate in a response.
(cherry picked from commit 99e1ea1)
* Fix several incorrect statements and struct tags which were preventing the certificates management endpoint from listing certs.
Certificate listing is working without a base64 encoded representation of each certificate.
(cherry picked from commit 685dfef)
* Add commands index to command datastore.
Add simple test for commands index
Add commands index endpoint
(cherry picked from commit 4e2a2a2)
* Add handler for GET /mdm/commands
(cherry picked from commit ae71b8f)
* Added Find() method to commands datastore so that the request that matches a response can be retrieved by the connect service.
Added Find() method to command service
(cherry picked from commit ebceb28)
* Fix globally scoped vars in command datastore test suite
* groob prefers inline definition of struct members.
* Uppercase CommandUuid
* Add ackCertificateList to connect service, accidentally omitted from installed_certificate_list PR #14
Make push endpoint conform to Errorer interface.
Wrap error return in management service.
Add missing certsDB in main.go, should have been part of installed_certificate_list PR #14
* Fix erraneous comma in mdmEnrollResponse
* Stub new method for application datastore
Handle command failures more gracefully than continuously retrying. Failures are not logged
Add table for certificates.
(cherry picked from commit 9f580a6)
* Remove methods with signature NewDatastore() from datastores and injection of the logger instance into each datastore because groob is a doodoo head :)
Move NewDatastore methods into unit tests
Reinstate NewDB test
Create certificates package including a Certificate type and a datastore.
Began working on a method ackCertificateList in the connect service.
Boilerplate for management service test.
Renamed some tables in certificates migration, hopefully nobody notices.
Applications response handler should be omitted from this branch.
(cherry picked from commit 8bc2fc7)
* Add device uuid to certificate, as there will never be a normalised form of the certificate data.
Change statments to reflect table change from certificates to devices_certificates
Add the CertificateList request type to the connect service's Acknowledge method
Add certificates datastore to the management service, and add endpoints and request/responses for retrieving certificates by device uuid to the management endpoujnt.
Kludge. commits regarding app service will be amended.
(cherry picked from commit c723c80)
* Don't forget the endpoint definition for certificates!
(cherry picked from commit 4e5fc1f)
* Use byte field for certificate data.
(cherry picked from commit 66d5036)
* Fix empty import in certificates
(cherry picked from commit b6d4dca)
* Add table for certificates.
(cherry picked from commit 06bc231)
* Renamed some tables in certificates migration, hopefully nobody notices.
Rebase develop onto master
(cherry picked from commit 775484d)
* Certificate list responses are saved via replacing the entire certificate list on a per device basis. This is because neither the common name nor the data could be used as a unique constraint in the certificates table.
Few small changes to imports/style.
(cherry picked from commit e0a63e1)
* Properly rollback if certificate insert fails for any certificate in a response.
(cherry picked from commit 99e1ea1)
* Fix several incorrect statements and struct tags which were preventing the certificates management endpoint from listing certs.
Certificate listing is working without a base64 encoded representation of each certificate.
(cherry picked from commit 685dfef)
* Add commands index to command datastore.
Add simple test for commands index
Add commands index endpoint
(cherry picked from commit 4e2a2a2)
* Add handler for GET /mdm/commands
(cherry picked from commit ae71b8f)
* Added Find() method to commands datastore so that the request that matches a response can be retrieved by the connect service.
Added Find() method to command service
(cherry picked from commit ebceb28)
* Fix globally scoped vars in command datastore test suite
* groob prefers inline definition of struct members.
* Uppercase CommandUuid
* Add ackCertificateList to connect service, accidentally omitted from installed_certificate_list PR #14
Make push endpoint conform to Errorer interface.
Wrap error return in management service.
Add missing certsDB in main.go, should have been part of installed_certificate_list PR #14
* Stub new method for application datastore
Handle command failures more gracefully than continuously retrying. Failures are not logged
Add table for certificates.
(cherry picked from commit 9f580a6)
* Remove methods with signature NewDatastore() from datastores and injection of the logger instance into each datastore because groob is a doodoo head :)
Move NewDatastore methods into unit tests
Reinstate NewDB test
Create certificates package including a Certificate type and a datastore.
Began working on a method ackCertificateList in the connect service.
Boilerplate for management service test.
Renamed some tables in certificates migration, hopefully nobody notices.
Applications response handler should be omitted from this branch.
(cherry picked from commit 8bc2fc7)
* Add device uuid to certificate, as there will never be a normalised form of the certificate data.
Change statments to reflect table change from certificates to devices_certificates
Add the CertificateList request type to the connect service's Acknowledge method
Add certificates datastore to the management service, and add endpoints and request/responses for retrieving certificates by device uuid to the management endpoujnt.
Kludge. commits regarding app service will be amended.
(cherry picked from commit c723c80)
* Don't forget the endpoint definition for certificates!
(cherry picked from commit 4e5fc1f)
* Use byte field for certificate data.
(cherry picked from commit 66d5036)
* Fix empty import in certificates
(cherry picked from commit b6d4dca)
* Add table for certificates.
(cherry picked from commit 06bc231)
* Renamed some tables in certificates migration, hopefully nobody notices.
Rebase develop onto master
(cherry picked from commit 775484d)
* Certificate list responses are saved via replacing the entire certificate list on a per device basis. This is because neither the common name nor the data could be used as a unique constraint in the certificates table.
Few small changes to imports/style.
(cherry picked from commit e0a63e1)
* Properly rollback if certificate insert fails for any certificate in a response.
(cherry picked from commit 99e1ea1)
* Fix several incorrect statements and struct tags which were preventing the certificates management endpoint from listing certs.
Certificate listing is working without a base64 encoded representation of each certificate.
(cherry picked from commit 685dfef)
* Add commands index to command datastore.
Add simple test for commands index
Add commands index endpoint
(cherry picked from commit 4e2a2a2)
* Add handler for GET /mdm/commands
(cherry picked from commit ae71b8f)
* Added Find() method to commands datastore so that the request that matches a response can be retrieved by the connect service.
Added Find() method to command service
(cherry picked from commit ebceb28)
* Fix globally scoped vars in command datastore test suite
* groob prefers inline definition of struct members.
* Uppercase CommandUuid
* Add commands index to command datastore.
Add simple test for commands index
Add commands index endpoint
(cherry picked from commit 4e2a2a2)
* Add handler for GET /mdm/commands
(cherry picked from commit ae71b8f)
* Added Find() method to commands datastore so that the request that matches a response can be retrieved by the connect service.
Added Find() method to command service
(cherry picked from commit ebceb28)
* Fix globally scoped vars in command datastore test suite
* groob prefers inline definition of struct members.
* Uppercase CommandUuid
* Add table `applications` and `devices_applications` for tracking installed applications per device and total installed application count.
(cherry picked from commit fba935d)
* Define new datastore for retrieving installed applications by device uuid
Add InstalledApps method to management service
Add endpoint for installed applications at /management/v1/devices/uuid/applications
(cherry picked from commit 07b2deb)
* REMOVED: Flesh out implementation of acknowledging InstalledApplicationList response.
Additional tags on Application for database.
Applications datastore supports select with arbitrary where clauses
Changed the signatures of all the ack handlers in connect service.
(cherry picked from commit f16b776)
* Revert acknowledge handlers code.
Add stub for acknowledging installed applications list.
(cherry picked from commit 82f7e3a)
* Fix some error strings in application datastore which still referred to devices.
Add method SaveApplicationByDeviceUUID to add rows to `devices_applications` for the specified device uuid
Add method NewDatastore since NewDB was untestable using mocks.
Connect service now takes an applications datastore as one of its parameters.
ackInstalledApplicationList implemented but not tested for InstallApplicationList responses.
(cherry picked from commit 97a97d9)
* Further comments on applications datastore.
Attempt to make some where clause helper functions.
Expand test suites to cover many different type of installed applications.
All tests passing.
(cherry picked from commit be99fcd)
* Additional comments
Fix methods which returned a pointer to a slice which is pointless.
Moved statement building functions in applications package to statement.go.
Fixed acknowledge handler if device UDID does not match any enrolled device (happens a lot in test cases).
Preliminary re-implementation of ackInstalledApplicationList
Added tests for the connect service.
(cherry picked from commit 92f253c)
* Add basic test for ackInstalledApplicationList
(cherry picked from commit 66ec74c)
* Fix wrong positional parameters.
Add handler for InstalledApplicationList request type.
installed applications are inserted but their relationship to the current device is not yet recorded. work in progress.
(cherry picked from commit e90c78d)
* Fixed slices which used make() showing the wrong capacity.
Removed a bunch of debug print statements.
Further enhanced connect service test with sql mocking.
(cherry picked from commit 0913934)
* Add regression test for bundle with size that is too large for int field.
Change applications table migration to use bigint field for `bundle_size`
(cherry picked from commit 3038d17)
* Note about difference between iOS and macOS Responses in comments.
Handle iOS response to InstalledApplicationList
Empty test for duplicate applications regression
Update management service test to fit new signature for NewService()
(cherry picked from commit db7c431)
* Changed application response storage to devices_applications, similar to certificates. Every time the device reports a new list, the application list gets replaced.
Add PayloadScope to enroll endpoint because interactive enrollment always seems to try to use the User scope.
(cherry picked from commit 0b0a01d)
* Merge change that removes NewDatastore() from applications/datastore.
* Add setup and teardown to application datastore test.
Remove existing tests because they were using the old Datastore interface.
* Remove invalid imports whoops
* Removed commented code.
Imported name device clashed with variable name device, renamed.
* Fix applications datastore New method in connect service test suite.
* Pull all vars out of global scope in connect service test.
* Add flag url (MICROMDM_PUBLIC_URL) for public facing mdm enrollment url.
Add flag scep-url (MICROMDM_SCEP_URL) for scep payload in enrollment profile.
(cherry picked from commit 1cc09e3)
* enroll service allows scep challenge via flag --scep-challenge or env MICROMDM_SCEP_CHALLENGE
remove reference to certificates and apps, those will be in other branches.
(cherry picked from commit e417ba8)
* Add MDM payload
Add NewPayload method
Profiles and payloads created by their factory methods automatically generate a UUID
Add go-kit service for enroll.
Merge rebase for enroll service
(cherry picked from commit 6843b20)
* Fleshed out a bit more of the enroll service.
Rebase onto master
(cherry picked from commit 69dc230)
* Add endpoint and transport for Enroll service.
Rebase develop onto master
(cherry picked from commit 1501b2e)
* Fix several compilation errors regarding syntax.
Rebase develop onto master
(cherry picked from commit fe3d039)
* More consistent naming of Payloads.
Merge develop onto master
(cherry picked from commit 6f70231)
* Fix error with plist encoding by dereferencing nested payloads.
Add correct header for enrollment profile.
Enrollment works with micromdm/scep server!
Rebase develop onto master
(cherry picked from commit 7e858c3)
* Warnings are more helpful if you omit pieces of configuration.
CA payload for SCEP includes identifier.
CORS methods, app service, cert service omitted for this commit, will be cherry picked into a different branch.
(cherry picked from commit 9219be2)
* enroll package follows the style of go-kit
(cherry picked from commit fb03d3c)
* Fix variable naming of URL and SCEPURL.
Remove duplicate enroll service.
* Fix variable naming in main URL, SCEP, CORS
* Fix errors returned in mdmEnrollResponse.
Query by both device.SerialNumber and device.UDID
join WHERE conditions using the OR logical operator. I can't determine whether this has an impact elsewhere.