Commit graph

43 commits

Author SHA1 Message Date
Michael Marineau
036aedf2d7 protocol: remove stray Event type
The Event struct was split into EventRequest and EventResponse back in
75a1125f but the older now unused type was never deleted.
2017-05-05 11:53:52 -07:00
Michael Marineau
a6290c1b4f protocol: add ParseRequest and ParseResponse functions
For parsing and verification of of HTTP request and response bodies,
including optional checking the Content-Type field which the handler
previously didn't do.
2017-05-04 13:25:46 -07:00
Michael Marineau
6198ba9443 protocol: style fix, use "ID" and "SHA" in identifiers. 2017-05-04 13:22:27 -07:00
Michael Marineau
5f9a499a46 package: fix SHA256 attribute name, now defined by the spec.
The old name was my own extension and unused by anything so there aren't
any compatibility issues here.
2017-05-02 13:15:04 -07:00
Michael Marineau
79e582819b protocol: sort xml attributes
A cosmetic change, though this will change the order in the XML output.
The spec lists fields alphabetically so this makes comparison easier.
2017-05-02 13:07:53 -07:00
Michael Marineau
9a796427d5 omaha: distinguish zero and unset in ping active days field
Unlike the other fields unset here would mean unknown rather than "0" so
we must distinguish between the two. In the end it isn't very
significant since our update server and none of our clients use these
self-reported active times, exclusively using when pings were received.
2017-04-24 13:05:53 -07:00
Michael Marineau
c7d81825c4 omaha: remove lingering references to mantle 2017-04-24 12:23:53 -07:00
Michael Marineau
4b95d8178b omaha: update upstream doc URL 2017-04-24 12:04:41 -07:00
Michael Marineau
4d02220019 omaha: add basic but functional omaha server for testing
This server doesn't care about app id, versions, or really anything.
Once a payload has been set it will use it for all update requests.
2017-04-21 14:12:44 -07:00
Nick Owens
e5eb9eb583 omaha: implement server based on OmahaHandler
As-is this server cannot do much and must be given an Updater
implementation to handle requests. Server.Mux is exposed to in case the
server needs to additional handlers for serving package payloads, etc.
2017-04-21 14:12:44 -07:00
Michael Marineau
f33cb66abb omaha: add complete http handler implementation
The handler is driven by something implementing the 'Updater' interface.
2017-04-21 14:12:44 -07:00
Michael Marineau
2cf1d8f13e omaha: support using status codes as error values 2017-04-21 14:12:44 -07:00
Michael Marineau
5e54ada1e9 omaha: add structure for representing a single app update
The protocol structures are intended for representing a collection of
apps and their updates but for a server's internal API and data store we
need to represent a self-contained app update manifest.
2017-04-21 14:12:44 -07:00
Michael Marineau
5543f86194 omaha: add helper method for computing package metadata 2017-04-21 14:12:44 -07:00
Michael Marineau
f208691b12 omaha: stop wrapping URL slice in a struct
Since splitting request and response structs it is no longer necessary
to work around Go's awkard handling of a `xml:"urls>url"` tag.
2017-04-21 14:12:44 -07:00
Michael Marineau
a3bc668225 omaha: add/fix missing or outdated attributes 2017-04-21 14:12:44 -07:00
Michael Marineau
75a1125f53 omaha: split request and response structures
Despite having common names between the request and response XML
structures the actual values which may appear in them are completely
disjoint. Splitting the types up makes the protocol easier to understand
when reading the code. When applicable, required fields like status are
passed to Add* methods.
2017-04-21 14:12:44 -07:00
Michael Marineau
ec70842bdd omaha: rework/cleanup protocol APIs
- Avoid long argument lists and only pass values that are strictly
   required such as status, fill in all other fields directly instead.
 - Fill OS struct in requests based on local system.
 - Define event and status codes as constants.
 - Misc style tweaks.
2017-04-21 14:12:44 -07:00
Michael Marineau
fef283aeb6 omaha: remove XMLName from nested structures
The special XMLName field is only useful in the top level structs which
need something to attach the lower case tag to. On the rest the default
behavior without XMLName works just fine so it is clutter.

The datastore tags have been dropped too since they are not needed.
2017-04-21 14:12:44 -07:00
Nick Owens
6ab36bd0dc omaha: fix go vet complaints
omaha/protocol_test.go:83: ExampleOmaha_NewResponse refers to unknown identifier: Omaha
omaha/protocol_test.go:134: ExampleOmaha_NewRequest refers to unknown identifier: Omaha
2017-04-21 14:12:44 -07:00
Michael Marineau
8650026537 omaha: update file header style and file names 2017-04-21 14:12:44 -07:00
Michael Marineau
909299725c omaha: embed test data into the test code 2017-04-21 14:12:44 -07:00
Peter Waller
33e7ba03da Update link to ServerProtocol.md 2015-11-01 08:51:39 +00:00
Ed Rooth
392deac926 fix(event): add optional errorcode field to event 2014-05-23 11:26:29 -07:00
Ed Rooth
1d08943ef3 feat(omaha): add "ping" event type. 2014-05-14 16:16:44 -07:00
Brandon Philips
fdce701e81 feat(omaha): add a machineid field 2014-03-17 14:29:04 -07:00
Brandon Philips
963d7e4623 fix(omaha): fixup Oem test after change
I forgot to run the tests after making the change to OEM. Fix.
2014-03-16 21:04:57 -07:00
Brandon Philips
2c86b12c25 fix(omaha): Oem to OEM
Be consistent with the Go style guide and make the acronym fully
uppercase.
2014-03-16 21:00:20 -07:00
Brandon Philips
ddc4c22205 feat(omaha): add oem and previousbootid
Add two new extensions for coreos
2013-09-03 16:39:37 -07:00
Brandon Philips
5ad4a72076 fix(omaha): go fmt 2013-09-03 16:20:46 -07:00
Brandon Philips
528535f63e feat(omaha): add a bootid field
the bootid field will be used by CoreOS to uniquely identify a boot of
an instance.
2013-07-09 11:48:57 -07:00
Brandon Philips
c2c4ee6b06 Merge pull request #7 from philips/add-track-extension
Add track extension
2013-07-02 09:53:22 -07:00
Brandon Philips
ac9df07313 chore(omaha): group the update engine extensions together 2013-07-02 09:47:19 -07:00
Brandon Philips
5140f37b40 feat(omaha): add Track field
this is another update_engine extension. Add it.
2013-07-02 09:41:53 -07:00
Joshua Deare
5d21f061f7 added json omitempty tags
bigquery was throwing errors without these due to null defined fields
2013-07-01 13:17:08 -07:00
Joshua Deare
2315500129 terminated XMLName from appearing in json
when we need json encoding(putting AppRequestLogs into bigquery)
we don't want the XMLName tag adding on needless data
2013-06-28 22:48:55 -07:00
Brandon Philips
94018ed305 feat(omaha): add more update_engine extensions 2013-06-26 15:53:31 -07:00
Brandon Philips
60265ef0fc fix(omaha): create section for update_engine extensions
add this comment section just so it is a littlemore clear what is going
on.
2013-06-26 10:39:52 -07:00
Brandon Philips
d68e528e59 feat(omaha): add disablebackoff field to action
another extension added by the the chromeos update engine
2013-06-26 10:39:52 -07:00
Joshua Deare
da9eaa53f9 added nil datastore tags to XMLName
now if a struct is put in datastore it won't be bloated
with needless XMLName field
2013-06-25 16:39:01 -07:00
Brandon Philips
51340c1e14 omaha: add support for multiple events
add a test and support for multiple events
2013-06-25 08:08:19 -07:00
Brandon Philips
651d843622 fix(omaha_test): fixup the tests after moving
fix tests after moving files around
2013-06-23 20:32:43 -07:00
Brandon Philips
acc428b640 fix(omaha): follow go standards with package name
The last item in a package path in Go should match the package name.
This is not the case right now.

Fix by making the new import path:

github.com/coreos/go-omaha/omaha
2013-06-23 19:54:27 -07:00