Code Monkey home page Code Monkey logo

astarte-client-elixir's Introduction

Astarte Client Elixir

Elixir HTTP client to interact with the Astarte API

Installation

If available in Hex, the package can be installed by adding astarte_client to your list of dependencies in mix.exs:

def deps do
  [
    {:astarte_client, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/astarte_client.

astarte-client-elixir's People

Contributors

arahmarchak avatar bettio avatar davidebriani avatar rbino avatar szakhlypa avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

astarte-client-elixir's Issues

Token renewal before expiry

The Astarte JWT token is generated only once during the client initialization

with {:ok, jwt} <- fetch_or_generate_jwt(opts) do

This token has a default expiry of 5 minutes. If the generated client is used after the token is expired, the client does not renew the token which will make Astarte reply with 403 Forbidden.

Proposed solution:
Validate JWT token expiry before using it. If close to the expiration time, renew the JWT

Add support for Pairing Device API

Right now we only support the Agent part of Astarte Pairing API. We should add support for the Device part (i.e. requesting broker info, requesting and verifying certificates) so that e.g. the Astare Device SDK Elixir can start using this library instead of having to reimplement the API Client.

Support managing Trigger Delivery Policies

The upcoming release of Astarte v1.1 will include the new resource type of Trigger Delivery Policies.
A set of CRUD APIs are available and existing policies can also be referenced by Triggers.
Supporting these operations on the astarte-client-elixir is desirable.

Further references on Trigger Delivery Policies:

  1. The JSON Schema, as per Astarte v1.1.0-alpha.0, for how Trigger Policies can be defined: astarte-platform/astarte#554 (comment)
  2. The Swagger file that defines the REST APIs available to manage Trigger Policies: https://github.com/astarte-platform/astarte/blob/master/apps/astarte_realm_management_api/priv/static/astarte_realm_management_api.yaml
  3. Documentation about the concepts of Triggers / Trigger Policies: https://docs.astarte-platform.org/snapshot/060-triggers.html#trigger-delivery-policies
  4. Documentation about using Triggers / Trigger Policies: https://docs.astarte-platform.org/snapshot/060-using_triggers.html#trigger-delivery-policies

Add documentation

We should start gradually start documenting all public functions and modules

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.