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

Initial Device HTTP Endpoint Implementation #38

Closed
paulstatezny opened this issue Feb 21, 2018 · 2 comments
Closed

Initial Device HTTP Endpoint Implementation #38

paulstatezny opened this issue Feb 21, 2018 · 2 comments

Comments

@paulstatezny
Copy link
Contributor

paulstatezny commented Feb 21, 2018

Acceptance Criteria:

  • There is an API endpoint at GET /firmware-update
  • When any of the following conditions are met, the endpoint returns a 401 error:
    • The X-Client-Dn header is missing.
    • The X-Client-Dn header is not in the format CN=identifier.
    • The identifier in the X-Client-Dn header is not the case-sensitive identifier of a device in the devices table.
  • The endpoint checks whether the device is eligible for a firmware update.
  • A device is eligible for a firmware update if a deployment is found where the following is true:
    • The device (in the database) and firmware match in both architecture and platform
    • The device's current_version matches each of the version_requirements of the deployment. (Via Version.match?/3)
    • The device has all tags specified in the deployment.
  • Integration tests
  • The endpoint returns the following structure:
{
  "eligible_firmware_update": "http://example.com/path/to/firmware/1.0.1/file.fw"
}

(If not eligible for a firmware update, null is returned:)

{
  "eligible_firmware_update": null
}

Notes:

  • This implementation does not allow for different tenants to have devices with the same identifier. This is an acknowledged major problem with this first version; we'll need to address it before using the product.
@paulstatezny paulstatezny changed the title Initial Websocket Implementation Initial Device HTTP Endpoint Implementation Feb 21, 2018
@fhunleth fhunleth added this to the V2 milestone May 30, 2018
@fhunleth
Copy link
Contributor

We're currently going full steam down the Phoenix channels path to getting firmware updates, but this issue is still important since some devices would prefer to remain disconnected most of the time (e.g., devices connected over metered connections). I'm marking this as V2 since the current client work won't exercise this.

@jlmcgehee21
Copy link
Contributor

I believe this is live now: #287

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

No branches or pull requests

4 participants